X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=templates%2Fgrub-pxelinux_config;h=19b669c3126b50f260bfb902832bff1fcac5e0fc;hb=9ac385407456701cb4935b88159095e133578053;hp=20be1b614a381c822a734cf07952226304cafe24;hpb=fdea9e5736375443ad3818136cab0bc41f9d9414;p=grml-terminalserver.git diff --git a/templates/grub-pxelinux_config b/templates/grub-pxelinux_config index 20be1b6..19b669c 100644 --- a/templates/grub-pxelinux_config +++ b/templates/grub-pxelinux_config @@ -18,7 +18,10 @@ # 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)" + live_media_path_="live-media-path=$(awk -F live-media-path= '{print $2}' /proc/cmdline)" +fi +if [ ! -d /live/image/boot ] ; then + live_media_path_="live-media-path=/" fi # default boot arguments used for both grub and pxelinux @@ -32,7 +35,7 @@ apm=power-off nomce" fi # special boot arguments required by grub -grub_def_boot_args_="/linux26 $default_boot_args_" +grub_def_boot_args_="/linux26 $default_boot_args_ $live_media_path_" # special boot arguments required by pxelinux pxe_def_boot_args_="$default_boot_args_" @@ -139,21 +142,22 @@ EOT fi +config_files_=$(find "$TFTPD_DATA_DIR_/" -name "*.cfg" -type f) # cd is multi iso, grml2usb got it right ;0 if [ -d "$MOUNT_POINT_"/boot/release ] ; then - sed -i -e 's#\(.*\)/boot/\(.*\)#\1\2#' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null + sed -i -e 's#\(.*\)/boot/\(.*\)#\1\2#' $config_files_ else - # remove normal kernel path and use our image - sed -i -e 's/.*kernel.*linux26/kernel linux26/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null - sed -i -e 's/\(initrd\)=[[:alnum:]/._-]*/\1=minirt26.gz/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null - - # only append live-media-path if needed - if [ ! -z "$live_media_path_" ] ; then - sed -i -e 's/\(live-media-path\)=[[:alnum:]/._-]*/\1='$live_media_path_'/' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/null - else - sed -i -e 's/live-media-path=[[:alnum:]/._-]*//' "$TFTPD_DATA_DIR_/"*.cfg 2>/dev/nul - fi + # remove normal kernel path and use our image + sed -i -e 's/.*kernel.*linux26/kernel linux26/' $config_files_ + sed -i -e 's/\(initrd\)=[[:alnum:]/._-]*/\1=minirt26.gz/' $config_files_ + # remove live-media-path per default + sed -i -e 's#live-media-path=[[:alnum:]/._-]*##' $config_files_ + + # append live-media-path if needed + if [ ! -z "$live_media_path_" ] ; then + sed -i -e "s#\(^.*append.*initrd.*$\)#\1 $live_media_path_#" $config_files_ + fi fi # adjust ldbsd.com bootline