- mkdir -p "$BUILD_TARGET"/boot/isolinux
- mkdir "$BUILD_TARGET"/GRML
- cp /boot/memtest86+.bin "$BUILD_TARGET"/boot/isolinux/memtest
- cp "$CHROOT_TARGET"/boot/initrd* "$BUILD_TARGET"/boot/isolinux/initrd.gz
- cp "$CHROOT_TARGET"/boot/vmlinuz* "$BUILD_TARGET"/boot/isolinux/linux26
- cp /usr/lib/syslinux/chain.c32 "$BUILD_TARGET"/boot/isolinux/
- cp /usr/lib/syslinux/isolinux.bin "$BUILD_TARGET"/boot/isolinux/
- cp /usr/lib/syslinux/memdisk "$BUILD_TARGET"/boot/isolinux/
- cp /usr/lib/syslinux/menu.c32 "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/allinone.img "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/balder10.imz "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/boot-beep.msg "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/boot.msg "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/f* "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/isolinux.cfg "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/logo.16 "$BUILD_TARGET"/boot/isolinux/
- cp /usr/share/grml-live/x86_files/boot/isolinux/syslinux.cfg "$BUILD_TARGET"/boot/isolinux/
- # minirt26.gz
- # boot.cat
+ # booting stuff:
+ [ -d "$BUILD_OUTPUT"/boot/isolinux ] || mkdir -p "$BUILD_OUTPUT"/boot/isolinux
+ cp /boot/memtest86+.bin "$BUILD_OUTPUT"/boot/isolinux/memtest
+
+ # if we don't have an initrd we a) can't boot and b) there was an error
+ # during build, so check for the file:
+ if [ -f "$CHROOT_OUTPUT"/boot/initrd* ] ; then
+ cp "$CHROOT_OUTPUT"/boot/initrd* "$BUILD_OUTPUT"/boot/isolinux/initrd.gz
+ else
+ log "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting"
+ eerror "No initrd found inside $CHROOT_OUTPUT/boot/ - Exiting" ; eend 1
+ bailout 10
+ fi
+
+ cp "$CHROOT_OUTPUT"/boot/vmlinuz* "$BUILD_OUTPUT"/boot/isolinux/linux26
+ cp /usr/lib/syslinux/chain.c32 "$BUILD_OUTPUT"/boot/isolinux/
+ cp /usr/lib/syslinux/isolinux.bin "$BUILD_OUTPUT"/boot/isolinux/
+ cp /usr/lib/syslinux/memdisk "$BUILD_OUTPUT"/boot/isolinux/
+ cp /usr/lib/syslinux/menu.c32 "$BUILD_OUTPUT"/boot/isolinux/
+
+ [ -n "$TEMPLATE_DIRECTORY" ] || TEMPLATE_DIRECTORY='/usr/share/grml-live/templates'
+ if ! [ -d "${TEMPLATE_DIRECTORY}"/boot ] ; then
+ log "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting."
+ eerror "${TEMPLATE_DIRECTORY}/boot does not exist. Exiting." ; eend 1
+ bailout 8
+ fi
+
+ cp ${TEMPLATE_DIRECTORY}/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/
+ cp ${TEMPLATE_DIRECTORY}/boot/isolinux/* "$BUILD_OUTPUT"/boot/isolinux/
+
+ if ! [ -d "${BUILD_OUTPUT}/boot/grub" ] ; then
+ cp -a ${TEMPLATE_DIRECTORY}/boot/grub "$BUILD_OUTPUT"/boot/
+ fi
+
+ if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then
+ log "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting."
+ eerror "${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting." ; eend 1
+ bailout 9
+ fi
+
+ [ -d "$BUILD_OUTPUT"/GRML ] || mkdir "$BUILD_OUTPUT"/GRML
+ cp -a ${TEMPLATE_DIRECTORY}/GRML/* "$BUILD_OUTPUT"/GRML/
+
+ # adjust boot splash information:
+ RELEASE_INFO="$GRML_NAME $VERSION - Release Codename $RELEASENAME"
+ RELEASE_INFO="$(cut_string 68 "$RELEASE_INFO")"
+ RELEASE_INFO="$(extend_string_end 68 "$RELEASE_INFO")"
+
+ sed -i "s/%RELEASE_INFO%/$GRML_NAME $VERSION - $RELEASENAME/" "$BUILD_OUTPUT"/GRML/grml-version
+ sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_OUTPUT"/GRML/grml-version
+
+ sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_OUTPUT"/boot/isolinux/boot.msg
+ sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_OUTPUT"/boot/isolinux/boot.msg
+
+ sed -i "s/%RELEASE_INFO%/$RELEASE_INFO/" "$BUILD_OUTPUT"/boot/isolinux/boot-beep.msg
+ sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_OUTPUT"/boot/isolinux/boot-beep.msg
+
+ sed -i "s/%VERSION%/$VERSION/" "$BUILD_OUTPUT"/boot/grub/menu.lst
+ sed -i "s/%GRML_NAME%/$GRML_NAME/" "$BUILD_OUTPUT"/boot/grub/menu.lst
+
+ # autostart for Windows:
+ if [ -d "${TEMPLATE_DIRECTORY}/windows/autostart/" ] ; then
+ cp ${TEMPLATE_DIRECTORY}/windows/autostart/* "$BUILD_OUTPUT"/
+ fi
+
+ # windows-binaries: