[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1006612: live-build: netboot IPv6 only and NFSv4 → dracut



Package: live-build
Version: 1:20210902
Severity: wishlist
X-Debbugs-Cc: andi@debian.org

Hi,

we are using live-build to provide diskless (fat) client images in our
network.  Clients are IPv6 PXE booted and load Grub (bootnetx64.efi)
which in turn loads the kernel and initrd.  The rootfs is then mounted
from an NFS share.  This works fine so far, however, there are two
shortcomings, related to the initrd and klibc:

 • it is not possible (without tweaks) to use NFSv4 (#409272, #409271)
 • it is not possible to download/mount the rootfs using IPv6 (#627164)

A hack which seems to work for my setup is using dracut to build the
initrd.  To switch, use this draft patch applied to
'/usr/lib/live/build/chroot_hacks':  

/usr/lib/live/build$ diff -u chroot_hacks.orig chroot_hacks
--- chroot_hacks.orig	2022-01-16 21:04:27.445797506 +0100
+++ chroot_hacks	2022-02-28 12:40:52.147919670 +0100
@@ -66,7 +66,10 @@
 
 if [ "${LB_INITRAMFS}" != "none" ]
 then
-	Chroot chroot "${UPDATE_INITRAMFS_OPTIONS} update-initramfs -k all -t -u"
+	#Chroot chroot "${UPDATE_INITRAMFS_OPTIONS} update-initramfs -k all -t -u"
+	VER="$(find chroot/boot -maxdepth 1 -name 'vmlinuz-*' | sed 's#.*/vmlinuz-##')"
+        # Modules c.f. 'man dracut'
+	Chroot chroot "dracut --no-hostonly --force -m base -m livenet -m network -m nfs --kver $VER"
 fi

For the record, here are the grub menu entries I used for testing
(dracut seems to provide quite good support for live systems):

  menuentry "Debian GNU/Linux Live Dracut RAM" {
    linux  /d-i/n-live/vmlinuz boot=live components ip=dhcp6 root=live:http://[fd39:4487:170a::994]/d-i/n-live/filesystem.squashfs 
    initrd /d-i/n-live/initrd.img
  }
  
  menuentry "Debian GNU/Linux Live Dracut RAM fetch-NFS" {
    linux  /d-i/n-live/vmlinuz boot=live components ip=dhcp6 root=live:nfs4:[fd39:4487:170a::994]:/live/filesystem.squashfs rd.live.ram=1
    initrd /d-i/n-live/initrd.img
  }
  
  menuentry "Debian GNU/Linux Live Dracut mount-NFS" {
    linux  /d-i/n-live/vmlinuz boot=live components ip=dhcp6 root=live:nfs4:[fd39:4487:170a::994]:/live/filesystem.squashfs
    initrd /d-i/n-live/initrd.img
  }

Perhaps this is useful for others who run into the same problems or
live-build development for the future.

Best regards,

  Andi



-- debsums errors found:
debsums: changed file /usr/lib/live/build/chroot_hacks (from live-build package)

Reply to: