Skip to content

Commit 2825eec

Browse files
committed
adding debian mod layer for initrds
1 parent 241460b commit 2825eec

File tree

3 files changed

+26
-70
lines changed

3 files changed

+26
-70
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
global:
1010
- DEBIAN_FRONTEND="noninteractive"
1111
- DOCKERHUB_LIVE="netbootxyz/mod-layers"
12-
- DOCKER_TAG="ubuntu-18.04"
12+
- DOCKER_TAG="debian-10"
1313

1414
jobs:
1515
include:

Dockerfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ RUN \
2222
strip src/curl && \
2323
echo "**** organize files ****" && \
2424
mkdir -p \
25-
/curlout/bin \
25+
/curlout/usr/bin \
2626
/curlout/etc/ssl/certs && \
2727
cp \
2828
src/curl \
29-
/curlout/bin && \
29+
/curlout/usr/bin && \
3030
cp \
3131
/etc/ssl/cert.pem \
3232
/curlout/etc/ssl/certs/ca-certificates.crt
3333

3434
# final mod layer
35-
FROM ubuntu:bionic
35+
FROM debian:buster
3636

3737
# environment settings
3838
ARG DEBIAN_FRONTEND="noninteractive"
@@ -46,19 +46,18 @@ RUN \
4646
echo "**** install deps ****" && \
4747
apt-get update && \
4848
apt-get install -y \
49-
casper \
50-
patch \
49+
live-boot \
50+
patch \
5151
rsync && \
52-
echo "**** patch casper ****" && \
53-
patch /usr/share/initramfs-tools/scripts/casper < /patch && \
52+
echo "**** patch live-boot ****" && \
53+
patch /lib/live/boot/9990-mount-http.sh < /patch && \
5454
echo "**** organize files ****" && \
5555
mkdir -p \
5656
/buildout \
57-
/modlayer/scripts && \
58-
cp \
59-
/usr/share/initramfs-tools/scripts/casper \
60-
/modlayer/scripts/ && \
57+
/modlayer/usr/lib/live/boot && \
6158
cp -ax \
6259
/curlout/* \
63-
/modlayer/
64-
60+
/modlayer/ && \
61+
cp \
62+
/lib/live/boot/9990-mount-http.sh \
63+
/modlayer/usr/lib/live/boot/

root/patch

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,14 @@
1-
--- casper 2017-05-14 00:09:40.000000000 +0000
2-
+++ casper.new 2019-11-16 07:47:52.791003189 +0000
3-
@@ -33,6 +33,10 @@
4-
parse_cmdline() {
5-
for x in $(cat /proc/cmdline); do
6-
case $x in
7-
+ netboot=*)
8-
+ export NETBOOT="${x#netboot=}";;
9-
+ fetch=*)
10-
+ export URL="${x#fetch=}";;
11-
showmounts|show-cow)
12-
export SHOWMOUNTS='Yes' ;;
13-
persistent)
14-
@@ -212,20 +216,34 @@
15-
NFSROOT=${ROOTSERVER}:${ROOTPATH}
16-
fi
1+
--- 9990-mount-http.sh 2019-06-14 09:55:07.000000000 +0000
2+
+++ 9990-mount-http.sh.new 2019-11-15 08:38:03.225447344 +0000
3+
@@ -41,7 +41,10 @@
174

18-
- [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
19-
-
20-
- if [ "${NETBOOT}" != "nfs" ] && do_cifsmount ; then
21-
- rc=0
22-
- elif do_nfsmount ; then
23-
- NETBOOT="nfs"
24-
- export NETBOOT
25-
- rc=0
26-
- fi
27-
+ case ${NETBOOT} in
28-
+ nfs)
29-
+ [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
30-
+ if do_nfsmount ; then rc=0; fi ;;
31-
+ cifs)
32-
+ [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
33-
+ if do_cifsmount ; then rc=0; fi ;;
34-
+ http)
35-
+ [ "$quiet" != "y" ] && log_begin_msg "Trying netboot from ${URL}"
36-
+ if do_httpmount ; then rc=0; fi ;;
37-
+ esac
38-
39-
[ "$quiet" != "y" ] && log_end_msg
40-
return ${rc}
41-
}
42-
43-
+do_httpmount() {
44-
+ rc=1
45-
+ mkdir -p ${mountpoint}
46-
+ mount -t tmpfs -o size=`/bin/curl -sI ${URL} | sed -ne '/Content-Length/{s/.*: //;p}'` tmpfs ${mountpoint}
47-
+ mkdir -p ${mountpoint}/casper
48-
+ if /bin/curl -L ${URL} -o ${mountpoint}/casper/root.squashfs; then rc=0; fi
49-
+ if [ ! -z "$(/bin/curl -sI "${URL}".part2 | grep "200 OK\|302 Found" || :)" ]; then
50-
+ if /bin/curl -L ${URL}.part2 -o ->> ${mountpoint}/casper/root.squashfs; then rc=0; fi
51-
+ fi
52-
+ return ${rc}
53-
+}
54-
+
55-
do_nfsmount() {
56-
rc=1
57-
modprobe "${MP_QUIET}" nfs
5+
*)
6+
log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})"
7+
- wget "${url}" -O "${dest}/$(basename ${url})"
8+
+ /bin/curl -L "${url}" -o "${dest}/$(basename ${url})"
9+
+ if [ ! -z "$(/bin/curl -sI "${url}".part2 | grep "200 OK\|302 Found" || :)" ]; then
10+
+ /bin/curl -L "${url}".part2 -o ->> "${dest}/$(basename ${url})"
11+
+ fi
12+
;;
13+
esac
14+
else

0 commit comments

Comments
 (0)