From 0b95222ad1f04f4a2c8698b397b08f776c5eec71 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sun, 25 Oct 2009 00:14:07 +0200 Subject: [PATCH] Use grml2usb to generate pxelinux menu. Add dependency for grml2usb in debian/control. --- debian/control | 2 +- templates/grub-pxelinux_config | 52 +++++++++++++++--------------------------- 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/debian/control b/debian/control index 02ac7cb..151100a 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Vcs-Browser: http://git.grml.org/?p=grml-terminalserver.git Package: grml-terminalserver Architecture: any -Depends: grml-shlib (>=1.02.03), grml-terminalserver-data (>=0.63), dialog, dhcp3-server, atftpd (>=0.7.dfsg-1.2), syslinux, gcc, ipcalc, ash, libc6-dev [i386], gcc-multilib [amd64], make, nfs-kernel-server +Depends: grml-shlib (>=1.02.03), grml-terminalserver-data (>=0.63), dialog, dhcp3-server, atftpd (>=0.7.dfsg-1.2), syslinux, gcc, ipcalc, ash, libc6-dev [i386], gcc-multilib [amd64], make, nfs-kernel-server, grml2usb (>=0.9.14) Description: terminalserver for grml This software should netboot grml on other computers over the network. The terminalserver also works with NON-PXE diff --git a/templates/grub-pxelinux_config b/templates/grub-pxelinux_config index b41e7b0..f80c4a7 100644 --- a/templates/grub-pxelinux_config +++ b/templates/grub-pxelinux_config @@ -24,7 +24,7 @@ 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 $live_media_path_ nomce quiet apm=power-off nodhcp noprompt noeject" +nodhcp noprompt noeject" else default_boot_args_="ramdisk_size=24000 root=/dev/ram0 rw \ init=/etc/init nfsdir=$IP_:$MOUNT_POINT_ nodhcp noprompt noeject \ @@ -96,40 +96,26 @@ ret_=$? ### ## create pxelinux config ### +DEST_DIR=$(mktemp -d) +grml2usb --bootloader-only --remove-bootoption='initrd=/boot/[a-z0-9/.]*/initrd.gz' \ + --remove-bootoption='live-media-path=[a-z0-9/.-]+/' \ + --bootoptions="$pxe_def_boot_args_ $BOOT_ARGS_" /live/image "$DEST_DIR" -cat >"$TFTPD_DATA_DIR_/pxelinux.cfg/default" </dev/null + +# only append live-media-path if needed +if [ ! -z "$live_media_path_" ] ; then + sed -i -e 's/\(.*append.*\)/\1 live-media-path='$live_media_path_'/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null +fi + +mv "$TFTPD_DATA_DIR_/syslinux.cfg" "$TFTPD_DATA_DIR_/pxelinux.cfg/default" +rm -rf "$DEST_DIR" let ret_=$ret_+$? return $ret_ -- 2.1.4