# the following variables are available in the template: # # $INTERFACE_ (interface for the terminalserver) # $IP_ (ip for the terminalserver to bind) # $NETMASK_ (network mask) # $GW_ (gateway) # $NAMESERVERS_ (nameservers for the nodes) # $IPRANGE_FROM_ (user configured iprange, first ip) # $IPRANGE_TO_ (user configured iprange, last ip) # $NETWORK_ (first ip in this subnet) # $OPTIONS_ (options for grml-terminalserver) # $BOOT_ARGS_ (boot arguments for the nodes) # # NOTE: # templates are shellscript fragments and will be sourced from the # terminalserver # # GLOBAL_README_END # default boot arguments used for both grub and pxelinux 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 pxelinux pxe_def_boot_args_="$default_boot_args_" ### ## create pxelinux config ### DEST_DIR=$(mktemp -d) 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 \ /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 directory, can not operate without. Did you boot the system with the toram=... boot option? If so please either do not use the toram boot option at all or use boot option toram without any arguments (just \"toram\" instead of \"toram=...\")." >&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"<