Merge ~natureshadow/ltsp:boot-method-nfsi into ltsp:master

Proposed by Dominik George
Status: Needs review
Proposed branch: ~natureshadow/ltsp:boot-method-nfsi
Merge into: ltsp:master
Diff against target: 140 lines (+27/-7)
6 files modified
client/Debian/etc/ltsp/update-kernels.conf (+4/-1)
client/Debian/share/initramfs-tools/scripts/nfs-bottom/ltsploop (+2/-2)
client/Redhat/etc/ltsp/update-kernels.conf (+4/-1)
client/Ubuntu/etc/ltsp/update-kernels.conf (+4/-1)
client/share/ltsp/update-kernels (+2/-1)
server/share/ltsp/plugins/ltsp-build-client/Debian/095-squashfs-image (+11/-1)
Reviewer Review Type Date Requested Status
LTSP5 developers Pending
Review via email: mp+368453@code.launchpad.net

Description of the change

This change allows the loading of a squashfs image over NFS instead of NBD by setting a boot method of NFSI (cf. https://sourceforge.net/p/ltsp/mailman/message/36669125/)

I am not sure about selecting the image name by $ARCH. Please give feedback on that.

To post a comment you must log in.

Unmerged commits

2b8e8fe... by Dominik George <email address hidden>

Support NFSI boot method everywhere.

NFSI means NFS image and can be used to mounta (squash)fs image over
NFS instead of NBS.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/client/Debian/etc/ltsp/update-kernels.conf b/client/Debian/etc/ltsp/update-kernels.conf
2index f6e7bd4..bef0870 100644
3--- a/client/Debian/etc/ltsp/update-kernels.conf
4+++ b/client/Debian/etc/ltsp/update-kernels.conf
5@@ -13,7 +13,7 @@
6 #IFCPU64=true
7
8 # Supported boot methods
9-BOOT_METHODS="NBD AOE NFS"
10+BOOT_METHODS="NBD NFSI AOE NFS"
11
12 # Default commandline arguments common to all boot methods
13 CMDLINE_LINUX_DEFAULT="init=/sbin/init-ltsp quiet"
14@@ -21,6 +21,9 @@ CMDLINE_LINUX_DEFAULT="init=/sbin/init-ltsp quiet"
15 # Commandline used with NFS root
16 CMDLINE_NFS="root=/dev/nfs ip=dhcp boot=nfs"
17
18+# Commandline used with NFSI (squashfs image over NFS) root
19+CMDLINE_NFSI="$CMDLINE_NFS nfsroot=$BASE/images ltsploop=$ARCH.img"
20+
21 # Commandline used with NBD root
22 CMDLINE_NBD="root=/dev/nbd0"
23
24diff --git a/client/Debian/share/initramfs-tools/scripts/nfs-bottom/ltsploop b/client/Debian/share/initramfs-tools/scripts/nfs-bottom/ltsploop
25index 12bc460..d9d5a37 100755
26--- a/client/Debian/share/initramfs-tools/scripts/nfs-bottom/ltsploop
27+++ b/client/Debian/share/initramfs-tools/scripts/nfs-bottom/ltsploop
28@@ -2,11 +2,11 @@
29
30 # Quick hack to mount an image file over NFS, as an alternative to NBD mounts.
31 #
32-# Requires specifying nfsroot=/opt/ltsp/images and ltsploop=ARCH.img on the
33+# Requires specifying nfsroot=$BASE/images and ltsploop=ARCH.img on the
34 # commandline. ltsploopfs=FS can be used to specify the filesystem, defaults to
35 # "squashfs"
36 #
37-# Also needs a dummy /opt/ltsp/images/sbin/init-ltsp to be an executable file
38+# Also needs a dummy $BASE/images/sbin/init-ltsp to be an executable file
39 # to work around a bug/feature in initramfs-tools's nfs mount checks...
40
41 PREREQ=""
42diff --git a/client/Redhat/etc/ltsp/update-kernels.conf b/client/Redhat/etc/ltsp/update-kernels.conf
43index 759be5e..a81f9bd 100644
44--- a/client/Redhat/etc/ltsp/update-kernels.conf
45+++ b/client/Redhat/etc/ltsp/update-kernels.conf
46@@ -13,7 +13,7 @@
47 #IFCPU64=true
48
49 # Supported boot methods
50-#BOOT_METHODS="NBD NFS AOE"
51+#BOOT_METHODS="NBD NFSI NFS AOE"
52
53 # Default commandline arguments common to all boot methods
54 #CMDLINE_LINUX_DEFAULT="init=/sbin/init-ltsp forcepae"
55@@ -21,6 +21,9 @@
56 # Commandline used with NFS root
57 #CMDLINE_NFS="root=dhcp"
58
59+# Commandline used with NFSI (squashfs image over NFS) root
60+#CMDLINE_NFSI="$CMDLINE_NFS nfsroot=$BASE/images ltsploop=$ARCH.img"
61+
62 # Commandline used with NBD root
63 #CMDLINE_NBD="root=/dev/nbd0"
64
65diff --git a/client/Ubuntu/etc/ltsp/update-kernels.conf b/client/Ubuntu/etc/ltsp/update-kernels.conf
66index 453f15f..53900d1 100644
67--- a/client/Ubuntu/etc/ltsp/update-kernels.conf
68+++ b/client/Ubuntu/etc/ltsp/update-kernels.conf
69@@ -13,7 +13,7 @@
70 #IFCPU64=true
71
72 # Supported boot methods
73-BOOT_METHODS="NBD NFS AOE"
74+BOOT_METHODS="NBD NFSI NFS AOE"
75
76 # Default commandline arguments common to all boot methods
77 CMDLINE_LINUX_DEFAULT="init=/sbin/init-ltsp forcepae"
78@@ -21,6 +21,9 @@ CMDLINE_LINUX_DEFAULT="init=/sbin/init-ltsp forcepae"
79 # Commandline used with NFS root
80 CMDLINE_NFS="root=/dev/nfs ip=dhcp boot=nfs"
81
82+# Commandline used with NFSI (squashfs image over NFS) root
83+CMDLINE_NFSI="$CMDLINE_NFS nfsroot=$BASE/images ltsploop=$ARCH.img"
84+
85 # Commandline used with NBD root
86 CMDLINE_NBD="root=/dev/nbd0"
87
88diff --git a/client/share/ltsp/update-kernels b/client/share/ltsp/update-kernels
89index 568bdb6..a9c4a71 100755
90--- a/client/share/ltsp/update-kernels
91+++ b/client/share/ltsp/update-kernels
92@@ -95,9 +95,10 @@ CHROOT_NAME=${CHROOT_NAME:-"$(detect_arch)"}
93 # Ensure default values for BOOT_METHODS, CMDLINE_LINUX_DEFAULTS, CMDLINE_NFS
94 # and CMDLINE_NBD. Distros *should* ship an /etc/ltsp/update-kernels.conf with
95 # appropriate values for their distro.
96-BOOT_METHODS=${BOOT_METHODS:-"NFS NBD AOE"}
97+BOOT_METHODS=${BOOT_METHODS:-"NFS NBD NFSI AOE"}
98 CMDLINE_LINUX_DEFAULTS=${CMDLINE_LINUX_DEFAULTS:-"ro init=/sbin/init-ltsp"}
99 CMDLINE_NFS=${CMDLINE_NFS:-"root=/dev/nfs ip=dhcp"}
100+CMDLINE_NFSI=${CMDLINE_NFSI:-"$CMDLINE_NFS nfsroot=$BASE/images ltsploop=$ARCH.img"}
101 CMDLINE_NBD=${CMDLINE_NBD:-"root=/dev/nbd0"}
102 CMDLINE_AOE=${CMDLINE_AOE:-"root=/dev/etherd/e0.0"}
103
104diff --git a/server/share/ltsp/plugins/ltsp-build-client/Debian/095-squashfs-image b/server/share/ltsp/plugins/ltsp-build-client/Debian/095-squashfs-image
105index 51b7c1b..752658b 100644
106--- a/server/share/ltsp/plugins/ltsp-build-client/Debian/095-squashfs-image
107+++ b/server/share/ltsp/plugins/ltsp-build-client/Debian/095-squashfs-image
108@@ -3,6 +3,7 @@ case "$MODE" in
109 add_option "squashfs-image" "`eval_gettext "create squashfs image for use with NBD"`" "advanced" "false"
110 add_option "no-squashfs-image" "`eval_gettext "skip squashfs image creation"`" "advanced" "false"
111 add_option "nfs-root" "`eval_gettext "use NFS instead of NBD as default"`" "advanced" "false"
112+ add_option "nfs-image" "`eval_gettext "use NFS to load (squash)fs image instead of NBD as default"`" "advanced" "false"
113 ;;
114 configure)
115 if [ -n "$option_squashfs_image_value" ]; then
116@@ -17,6 +18,11 @@ case "$MODE" in
117 # set an environment variable we can pick up later
118 NFS_ROOT="True"
119 fi
120+ if [ -n "$option_nfs_image_value" ]; then
121+ # set an environment variable we can pick up later
122+ NFS_IMAGE="True"
123+ SQUASHFS_IMAGE="True"
124+ fi
125 if [ -z "$SQUASHFS_IMAGE" ]; then
126 SQUASHFS_IMAGE="True"
127 fi
128@@ -24,7 +30,11 @@ case "$MODE" in
129 after-install)
130 if [ "True" = "$NFS_ROOT" ]; then
131 mkdir -p $ROOT/etc/ltsp/update-kernels.conf.d
132- echo 'BOOT_METHODS="NFS NBD AOE"' > $ROOT/etc/ltsp/update-kernels.conf.d/nfs
133+ echo 'BOOT_METHODS="NFS NBD NFSI AOE"' > $ROOT/etc/ltsp/update-kernels.conf.d/nfs
134+ fi
135+ if [ "True" = "$NFS_IMAGE" ]; then
136+ mkdir -p $ROOT/etc/ltsp/update-kernels.conf.d
137+ echo 'BOOT_METHODS="NFSI NFS NBD AOE"' > $ROOT/etc/ltsp/update-kernels.conf.d/nfs
138 fi
139 ;;
140 finalization)

Subscribers

People subscribed via source and target branches