From cfab1646f2a34b52de5fd4afaddf97f71e7fab70 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 14 Mar 2009 12:39:09 +0100 Subject: [PATCH] Adjust configuration for new grml2usb layout; fix dirname usage --- debian/changelog | 7 +++++++ default_config | 45 +++++++++++++++++++++++++++++++++++------- templates/grub-pxelinux_config | 7 +++++-- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3acd95d..94570f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-terminalserver (0.99.2) unstable; urgency=low + + * Fix usage of dirname if no files can be located. [Closes: issue575] + * Adjust configuration for new grml2usb layout. + + -- Michael Prokop Sat, 14 Mar 2009 12:37:26 +0100 + grml-terminalserver (0.99.1) unstable; urgency=low * fix create-netboot to work with new initrds diff --git a/default_config b/default_config index 33a25ac..c6f88fc 100644 --- a/default_config +++ b/default_config @@ -14,19 +14,39 @@ else MOUNT_POINT_="/cdrom" fi -DATA_PATH_="$MOUNT_POINT_/boot" +# assume we have a grml2usb system +if [ -d "$MOUNT_POINT_"/boot/release ] ; then + DATA_PATH_="$MOUNT_POINT_/boot/release" +else # no grml2usb but running from CD + DATA_PATH_="$MOUNT_POINT_/boot" +fi -ISOLIN_PATH_="$DATA_PATH_/isolinux" -test -d $ISOLIN_PATH_ || ISOLIN_PATH_="$MOUNT_POINT_" +# new grml2usb layout +if [ -d "$MOUNT_POINT_"/boot/syslinux ] ; then + ISOLIN_PATH_="$MOUNT_POINT_/boot/syslinux" + test -d $ISOLIN_PATH_ || ISOLIN_PATH_="$MOUNT_POINT_" +else # old layout + ISOLIN_PATH_="$DATA_PATH_/isolinux" + test -d $ISOLIN_PATH_ || ISOLIN_PATH_="$MOUNT_POINT_" +fi + +# addons +if [[ "$(find $MOUNT_POINT_ -maxdepth 3 -name memtest |head -n1)" != "" ]] ; then + ADDONS_PATH_="$(dirname $(find $MOUNT_POINT_ -maxdepth 3 -name memtest |head -n1))" +fi -ADDONS_PATH_="$(dirname $(find $MOUNT_POINT_ -maxdepth 3 -name memtest |head -n1))" if [[ $ADDONS_PATH_ == "" ]]; then - ADDONS_PATH_="$MOUNT_POINT_" + ADDONS_PATH_="$MOUNT_POINT_" +fi + +if [[ "$(find $DATA_PATH_/ -maxdepth 2 -name linux26 |head -n1)" != "" ]] ; then + MULTIBOOT_PATH_="$(dirname $(find $DATA_PATH_ -maxdepth 2 -name linux26 |head -n1))" +else + MULTIBOOT_PATH_="$MOUNT_POINT_" fi -MULTIBOOT_PATH_="$(dirname $(find $DATA_PATH_ -maxdepth 2 -name linux26 |head -n1))" if [[ $MULTIBOOT_PATH_ == "" ]]; then - MULTIBOOT_PATH_="$MOUNT_POINT_" + MULTIBOOT_PATH_="$MOUNT_POINT_" fi KERNEL_IMAGE_="$MULTIBOOT_PATH_/linux26" @@ -36,8 +56,19 @@ ORIGINAL_INITRD_="$MULTIBOOT_PATH_/initrd.gz" MEMTEST_IMAGE_="$ADDONS_PATH_/memtest" PXE_BOOT_MSG_="$ISOLIN_PATH_/boot.msg" +# grml2usb with grub doesn't provide boot.msg, so generate a default one +if ! [ -f "$PXE_BOOT_MSG_" ] ; then + PXE_BOOT_MSG_="$(mktemp)" + cat > $PXE_BOOT_MSG_ << EOF +17 logo.16 + +Some information and boot options available via keys F2 - F10. http://grml.org/ + +EOF +fi PXE_BOOT_LOGO_="$ISOLIN_PATH_/logo.16" IPTABLES_SNAT_="true" +# EOF diff --git a/templates/grub-pxelinux_config b/templates/grub-pxelinux_config index d224569..b41e7b0 100644 --- a/templates/grub-pxelinux_config +++ b/templates/grub-pxelinux_config @@ -17,15 +17,18 @@ # # GLOBAL_README_END +if grep -q live-media-path= /proc/cmdline 2>/dev/null ; then + live_media_path_="live-media-path=$(awk -F live-media-path= '{print $2}' /proc/cmdline)" +fi # default boot arguments used for both grub and pxelinux if [ -e '/live/cow' ]; then default_boot_args_="root=/dev/nfs rw nfsroot=$IP_:$MOUNT_POINT_ \ -boot=live lang=us nomce quiet apm=power-off nodhcp noprompt noeject" +boot=live $live_media_path_ nomce quiet apm=power-off nodhcp noprompt noeject" else default_boot_args_="ramdisk_size=24000 root=/dev/ram0 rw \ init=/etc/init nfsdir=$IP_:$MOUNT_POINT_ nodhcp noprompt noeject \ -apm=power-off nomce lang=us" +apm=power-off nomce" fi # special boot arguments required by grub -- 2.1.4