+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"<<EOT
+ include default.cfg
+include menuoptions.cfg
+include grml.cfg
+include options.cfg
+include isoprompt.cfg
+include hd.cfg
+include hidden.cfg
+EOT