set -e
# global variables
-GRML_LIVE_VERSION='0.9.24'
+GRML_LIVE_VERSION='0.9.29'
PN="$(basename $0)"
CMDLINE="$0 $@"
ISO_DATE="$(date +%Y-%m-%d)"
SOURCES_LIST_FILE='/etc/grml/fai/apt/sources.list'
+ADDONS_LIST_FILE='/boot/isolinux/addons_list.cfg'
# }}}
# usage information {{{
sed -i "s/%SQUASHFS_NAME%/$SQUASHFS_NAME/" "$BUILD_OUTPUT"/boot/isolinux/f4
sed -i "s/%SQUASHFS_NAME%/$SQUASHFS_NAME/" "$BUILD_OUTPUT"/boot/isolinux/f5
+ # generate addon list
+ rm "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
+ for name in $(ls "${BUILD_OUTPUT}"/boot/isolinux/addon_*.cfg) ; do
+ include_name=$(basename "$name")
+ echo "include $include_name" >> "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
+ done
+
if ! [ -r "${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg" ] || [ "$DISTRI_NAME" = "grml" ] ; then
log "including grmlmain.cfg in ${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
echo "include grmlmain.cfg" > "${BUILD_OUTPUT}/boot/isolinux/distri.cfg"
if [ ! -n "$NO_ADDONS" ] ; then
echo "include addons.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
fi
- echo "include hd.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
echo "include isoprompt.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
+ echo "include hd.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
echo "include hidden.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg"
else # assume we are building a custom distribution:
log "File ${BUILD_OUTPUT}/boot/isolinux/${DISTRI_NAME}.cfg found, using it."
fi
fi
- # jump back to grub from bsd4grml:
- if [ -e "$BUILD_OUTPUT"/boot/grub/stage2 ]; then
- GRUB_LEGACY=stage2
- else
- GRUB_LEGACY=stage2_eltorito
- fi
+ # jump back to grub from bsd4grml (/boot/grub/stage2):
+ GRUB_LEGACY=stage2
+
if [ -e "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 ]; then
if [ -e "$BUILD_OUTPUT"/boot/grub/core.img ]; then
GRUB_VERSION=2
GRUB_VERSION=1
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"
+ "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.cfg \
+ "$BUILD_OUTPUT"/boot/isolinux/*.cfg \
+ "$BUILD_OUTPUT"/boot/grub/grub.cfg \
+ "$BUILD_OUTPUT"/boot/grub/menu.lst ; do
+ if [ -e "$file" ] ; then
+ sed -i -e "s!%GRUB_VERSION%!$GRUB_VERSION!g" \
+ -e "s!%GRUB_LEGACY%!$GRUB_LEGACY!g" "$file"
+ fi
done
sed -i "s/%RELEASE_INFO%/$GRML_NAME $VERSION - $RELEASENAME/" "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6
fi
+
if [ -e "$BUILD_OUTPUT"/boot/grub/$GRUB_LEGACY ]; then
sed -i "s/%GRUB_LEGACY%/$GRUB_LEGACY/g" "$BUILD_OUTPUT"/boot/grub/menu.lst
sed -i "s/%GRUB_LEGACY%/$GRUB_LEGACY/g" "$BUILD_OUTPUT"/boot/grub/grub.cfg
if [ "$BOOT_METHOD" = "isolinux" ] ; then
BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
elif [ "$BOOT_METHOD" = "grub" ] ; then
- BOOT_FILE="boot/grub/stage2_eltorito"
+ BOOT_FILE="boot/grub/stage2"
fi
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then