# exit on any error:
set -e
-GRML_LIVE_VERSION='0.9.18'
+GRML_LIVE_VERSION='0.9.20'
PN="$(basename $0)"
CMDLINE="$0 $@"
ISO_DATE="$(date +%Y-%m-%d)"
# /usr/share/debootstrap/scripts/unstable does not exist, instead use 'sid':
case $SUITE in
unstable) SUITE='sid' ;;
+ # make sure that we *NEVER* write any broken suite name to sources.list,
+ # otherwise we won't be able to adjust it one next (correct) execution
+ stable) ;;
+ testing) ;;
+ etch) ;;
+ lenny) ;;
+ squeeze) ;;
+ sid) ;;
+ *) echo "Sorry, $SUITE is not a valid Debian suite, exiting.">&2; bailout 1 ;;
esac
DIST=" etch\| stable\| lenny\| squeeze\| testing\| sid\| unstable"
if [ -z "$NO_ADDONS" ] ; then
if ! [ -d /usr/share/grml-live/templates/boot/addons/bsd4grml ] ; then
- ewarn "Boot addons not found, skipping therefor. (Consider installing package grml-live-addons)" ; eend 0
+ ewarn "Boot addons not found, skipping therefore. (Consider installing package grml-live-addons)" ; eend 0
else
# copy only files so we can handle bsd4grml on its own
for file in ${TEMPLATE_DIRECTORY}/boot/addons/* ; do
sed -i "s/%GRML_NAME_SQUASHFS%/$GRML_NAME_SQUASHFS/" "$BUILD_OUTPUT"/boot/isolinux/f4
sed -i "s/%GRML_NAME_SQUASHFS%/$GRML_NAME_SQUASHFS/" "$BUILD_OUTPUT"/boot/isolinux/f5
+ # jump back to grub from bsd4grml:
+ if [ -e "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 ]; then
+ if [ -e "$BUILD_OUTPUT"/boot/grub/core.img ]; then
+ GRUB_VERSION=2
+ else
+ GRUB_VERSION=1
+ fi
+ if [ -e "$BUILD_OUTPUT"/boot/grub/stage2 ]; then
+ GRUB_LEGACY=stage2
+ else
+ GRUB_LEGACY=stage2_eltorito
+ fi
+
+ # why not ed(1)?
+ for file in "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 \
+ "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.cfg; do
+ sed -i -e "s!%GRUB_VERSION%!$GRUB_VERSION!g" \
+ -e "s!%GRUB_LEGACY%!$GRUB_LEGACY!g" "$file"
+ done
+ fi
+
# autostart for Windows:
if [ -d "${TEMPLATE_DIRECTORY}/windows/autostart/" ] ; then
cp ${TEMPLATE_DIRECTORY}/windows/autostart/* "$BUILD_OUTPUT"/
fi
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then
+
+ # support mkisofs as well as genisoimage
+ if which mkisofs >/dev/null 2>&1; then
+ MKISOFS=mkisofs
+ elif which genisoimage >/dev/null 2>&1; then
+ MKISOFS=genisoimage
+ else
+ log "Sorry, neither mkisofs nor genisoimage available - can not create ISO."
+ eerror "Sorry, neither mkisofs nor genisoimage available - can not create ISO." ; eend 1
+ bailout
+ fi
+
log "$ISO_OUTPUT exists already, skipping stage 'iso build'"
ewarn "$ISO_OUTPUT exists already, skipping stage 'iso build'" ; eend 0
else
CURRENT_DIR=$(pwd)
if cd "$BUILD_OUTPUT" ; then
- log "mkisofs -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b $BOOT_FILE -o ${ISO_OUTPUT}/${ISO_NAME} ."
- mkisofs -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \
+ log "$MKISOFS -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b $BOOT_FILE -o ${ISO_OUTPUT}/${ISO_NAME} ."
+ $MKISOFS -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \
-l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \
-b $BOOT_FILE -no-pad \
-o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
log "Creating hybrid ISO file with manifold method"
einfo "Creating hybrid ISO file with manifold method"
echo 1 63 | \
- mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 1 -g $cyls:16:32 | \
+ mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 1 -p 0x83 -g $cyls:16:32 | \
cat - boot/grub/core.img | \
dd conv=notrunc of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null
eend $?