X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=templates%2Fgrub-pxelinux_config;h=1be9b1807a8b0ca8d0ff27c96f9ec185b227e44d;hb=17edea1f26bf27b35d14ab06f282bdd920e724f7;hp=e87b371cbf8b9aff5055aee4c6c348bf1359db14;hpb=e962f8b2bae027c7582ea340ddf12405bf100752;p=grml-terminalserver.git diff --git a/templates/grub-pxelinux_config b/templates/grub-pxelinux_config index e87b371..1be9b18 100644 --- a/templates/grub-pxelinux_config +++ b/templates/grub-pxelinux_config @@ -1,5 +1,3 @@ -#!/bin/sh i like colors :) -# # the following variables are available in the template: # # $INTERFACE_ (interface for the terminalserver) @@ -19,21 +17,32 @@ # # 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 | awk '{print $1}')" +fi +if [ ! -d /live/image/boot ] ; then + live_media_path_="live-media-path=/" +fi # default boot arguments used for both grub and pxelinux -default_boot_args_="ramdisk_size=16384 root=/dev/ram0 rw \ +if [ -e "$MOUNT_POINT_" ]; then + default_boot_args_="root=/dev/nfs rw nfsroot=$IP_:$MOUNT_POINT_ \ +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" +fi # special boot arguments required by grub -grub_def_boot_args_="/linux26 $default_boot_args_" +grub_def_boot_args_="/vmlinuz $default_boot_args_ $live_media_path_" # special boot arguments required by pxelinux -pxe_def_boot_args_="$default_boot_args_ initrd=minirt26.gz" +pxe_def_boot_args_="$default_boot_args_" # default arguments for framebuffer console -def_fb_args_="video=vesafb:ypan,1024x768-16@60" -no_fb_args_="video=nofb" +def_fb_args_="vga=791" +no_fb_args_="vga=normal" ### ## create grub config @@ -45,7 +54,7 @@ timeout=10 title GRML root (nd) kernel $grub_def_boot_args_ $def_fb_args_ $BOOT_ARGS_ - initrd /minirt26.gz + initrd /initrd.img title GRML no framebuffer root (nd) @@ -54,27 +63,27 @@ title GRML no framebuffer title GRML small root (nd) kernel $grub_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_ - initrd /minirt26.gz + initrd /initrd.img title GRML small nofb root (nd) kernel $grub_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_ - initrd /minirt26.gz + initrd /initrd.img title GRML debuginit root (nd) kernel $grub_def_boot_args_ debuginitrd $def_fb_args_ $BOOT_ARGS_ - initrd /minirt26.gz + initrd /initrd.img title GRML debuginit nofb root (nd) kernel $grub_def_boot_args_ debuginitrd $no_fb_args_ $BOOT_ARGS_ - initrd /minirt26.gz + initrd /initrd.img title GRML rescue root (nd) kernel $grub_def_boot_args_ $no_fb_args_ - initrd /minirt26.gz + initrd /initrd.img title memtest root (nd) @@ -90,40 +99,77 @@ ret_=$? ### ## create pxelinux config ### +DEST_DIR=$(mktemp -d) +if [ -d /live/image/boot ] ; then + grml2usb --bootloader-only \ + --bootoptions="$pxe_def_boot_args_ $BOOT_ARGS_" \ + --remove-bootoption=nodhcp \ + /live/image "$DEST_DIR" + + mv "$DEST_DIR"/boot/syslinux/* "$TFTPD_DATA_DIR_/" + rmdir "$DEST_DIR"/boot/syslinux + + mv "$DEST_DIR"/boot/ "$TFTPD_DATA_DIR_" +else # there is no kernel inside /live/image copy it from /boot + if [ ! -d /usr/share/grml-live/templates/boot/isolinux ] ; then + echo "E: Could not find isolinux template directory" >&2 + exit 2 + fi + + array=( $(cat /etc/grml_version) ) + grml_name_=${array[0]} + grml_version_=${array[1]} + + cp /usr/share/grml-live/templates/boot/isolinux/* "$TFTPD_DATA_DIR_/" + + config_files_=$(find "$TFTPD_DATA_DIR_/" -name "*.cfg" -type f) + sed -i "s/%ARCH%/$(uname -m)/" $config_files_ + sed -i "s/%BOOTID%/$RANDOM/" $config_files_ + sed -i "s/%SHORT_NAME%/dummy/" $config_files_ + sed -i "s/%VERSION%/$grml_version_/" $config_files_ + sed -i "s/%GRML_NAME%/$grml_name_/" $config_files_ + sed -i "s/%DISTRI_SPLASH%/grml.png/" $config_files_ + sed -i "s/%DISTRI_INFO%/Grml/" $config_files_ + sed -i "s#\(^.*append.*initrd.*$\)#\1 $pxe_def_boot_args_ $BOOT_ARGS_#" $config_files_ + cat > "$TFTPD_DATA_DIR_/grmlmain.cfg"<"$TFTPD_DATA_DIR_/pxelinux.cfg/default" <