Adjust live media path for new live-boot version
authorMichael Prokop <mika@grml.org>
Thu, 10 Jan 2013 12:14:07 +0000 (13:14 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 10 Jan 2013 12:19:57 +0000 (13:19 +0100)
Debian's live-boot changed the path from /live/image to
/lib/live/mount/medium, so adopt our code to support those
new versions without breaking older ISOs.

config
default_config
templates/grub-pxelinux_config

diff --git a/config b/config
index ea86850..b7e07b1 100644 (file)
--- a/config
+++ b/config
 #KERNEL_VERSION_=""
 
 # this is the path where the grml image/cdrom is placed (mounted)
-# default: /live/image
+# default: /lib/live/mount/medium
 #MOUNT_POINT_=""
 
 # path + name of the linux kernel you would want to boot
-# default: /live/image/boot/$GRML_NAME/vmlinuz
+# default: /lib/live/mount/medium/boot/$GRML_NAME/vmlinuz
 #KERNEL_IMAGE_=""
 
 # this is the initrd the grml-terminalserver-config edits
 # if the file is not found, default will be used
-# default: /live/image/boot/$GRML_NAME/initrd.img
+# default: /lib/live/mount/medium/boot/$GRML_NAME/initrd.img
 #ORIGINAL_INITRD_=""
 
 # path + name of the memtest image
-# default: /live/image/boot/addons/memtest
+# default: /lib/live/mount/medium/boot/addons/memtest
 #MEMTEST_IMAGE_=""
 
 # path to pxelinux boot message
-# default: /live/image/boot/isolinux/boot.msg
+# default: /lib/live/mount/medium/boot/isolinux/boot.msg
 #PXE_BOOT_MSG_=""
 
 # path to pxelinux boot logo
-# default: /live/image/boot/isolinux/logo.16
+# default: /lib/live/mount/medium/boot/isolinux/logo.16
 #PXE_BOOT_LOGO_=""
 
 # should the terminalserver activate snat for the clients to his default gateway?
index f643b45..aee7983 100644 (file)
@@ -8,10 +8,12 @@ MODULES_PATH_="/lib/modules"
 
 KERNEL_VERSION_=`uname -r`
 
-if [ -e '/live/image' ]; then
-  MOUNT_POINT_="/live/image"
+if [ -e /lib/live/mount/medium ] ; then
+  MOUNT_POINT_="/lib/live/mount/medium" # since around December 2012
+elif [ -e '/live/image' ]; then
+  MOUNT_POINT_="/live/image" # until around December 2012
 else
-  MOUNT_POINT_="/cdrom"
+  MOUNT_POINT_="/cdrom" # very old
 fi
 
 # assume we have a grml2usb system
index 59bda58..c3e99f1 100644 (file)
@@ -100,7 +100,17 @@ ret_=$?
 ## create pxelinux config
 ###
 DEST_DIR=$(mktemp -d)
-if [ -d /live/image/boot ] ; then
+if [ -d /lib/live/mount/medium/boot ] ; then # since around December 2012
+  grml2usb --bootloader-only \
+      --bootoptions="$pxe_def_boot_args_ $BOOT_ARGS_" \
+      --remove-bootoption=nodhcp \
+      /lib/live/mount/medium "$DEST_DIR"
+
+  mv "$DEST_DIR"/boot/syslinux/* "$TFTPD_DATA_DIR_/"
+  rmdir "$DEST_DIR"/boot/syslinux
+
+  mv "$DEST_DIR"/boot/ "$TFTPD_DATA_DIR_"
+elif [ -d /live/image/boot ] ; then # until around December 2012
   grml2usb --bootloader-only \
       --bootoptions="$pxe_def_boot_args_ $BOOT_ARGS_" \
       --remove-bootoption=nodhcp \