- if ! $ROOTCMD update-initramfs -k "${initrd##vmlinuz-}" -c ; then
- echo "Creating fresh initramfs did not work, trying update instead:"
- $ROOTCMD update-initramfs -k "${initrd##vmlinuz-}" -u
- fi
+ if ! $ROOTCMD update-initramfs -k "${initrd##vmlinuz-}" -c ; then
+ echo "Creating fresh initramfs did not work, trying update instead:"
+ $ROOTCMD update-initramfs -k "${initrd##vmlinuz-}" -u
+ fi
+
+ # write it to /grml-live/, as we ignore that directory via
+ # /etc/grml/fai/config/grml/squashfs-excludes, to
+ # not include the file into the ISO itself, but have
+ # it available for netboot package usage
+ if [ -d "${target}"/etc/grml-netboot ] ; then
+ echo "Creating netboot initrd file (/grml-live/netboot.initrd)"
+ $ROOTCMD mkinitramfs -d /etc/grml-netboot -o /grml-live/netboot.initrd -k "${initrd##vmlinuz-}"
+ else
+ echo "Warning: /etc/grml-netboot doesn't exist, skipping netboot initrd generation."
+ fi