# set -e
# global variables
-GRML_LIVE_VERSION='0.15.0'
+GRML_LIVE_VERSION='0.15.1'
PN="$(basename $0)"
CMDLINE="$0 $@"
ADDONS_LIST_FILE='/boot/isolinux/addons_list.cfg'
log "Boot addons not found, skipping therefore. (Consider installing package grml-live-addons)"
ewarn "Boot addons not found, skipping therefore. (Consider installing package grml-live-addons)" ; eend 0
else
+ # copy addons from Depended packages
+ cp -a /usr/lib/ipxe/ipxe.lkrn "${TEMPLATE_DIRECTORY}/boot/addons/"
+ cp -a /usr/share/misc/pci.ids "${TEMPLATE_DIRECTORY}/boot/addons/"
+ cp -a /boot/memtest86+.bin "${TEMPLATE_DIRECTORY}/boot/addons/memtest"
+
# copy only files so we can handle bsd4grml on its own
for file in ${TEMPLATE_DIRECTORY}/boot/addons/* ; do
test -f $file && cp $file "$BUILD_OUTPUT"/boot/addons/
ewarn "grub templates do not exist, skipping therefore." ; eend 0
else
if ! [ -d "${BUILD_OUTPUT}/boot/grub" ] ; then
- cp -a ${TEMPLATE_DIRECTORY}/boot/grub "$BUILD_OUTPUT"/boot/
+ mkdir -p "${BUILD_OUTPUT}/boot/grub"
+ cp -a /usr/lib/grub/*-pc/*.mod "${BUILD_OUTPUT}/boot/grub"
+ cp -a /usr/lib/grub/*-pc/*.o "${BUILD_OUTPUT}/boot/grub"
+ cp -a /usr/lib/grub/*-pc/*.lst "${BUILD_OUTPUT}/boot/grub"
+ cp -a /usr/share/grub/ascii.pf2 "${BUILD_OUTPUT}/boot/grub"
+ /usr/bin/grub-mkimage -d /usr/lib/grub/*-pc -o \
+ "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc
fi
# make sure we have recent template files available, otherwise updating
done
# generate addon list
- rm "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
+ rm -f "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
for name in "${BUILD_OUTPUT}"/boot/isolinux/addon_*.cfg ; do
include_name=$(basename "$name")
echo "include $include_name" >> "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
log 'Using console based isolinux method as requested via $ISOLINUX_METHOD.'
einfo 'Using console based isolinux method as requested via $ISOLINUX_METHOD.'
if grep -q '^include console.cfg' "${BUILD_OUTPUT}/boot/isolinux/distri.cfg" ; then
- einfo "include for console.cfg already foud, nothing to do."
+ einfo "include for console.cfg already found, nothing to do."
eend 0
else
log "including console.cfg in ${BUILD_OUTPUT}/boot/isolinux/isolinux.cfg"
else
log 'Using graphical boot menu.'
if grep -q '^include vesamenu.cfg' "${BUILD_OUTPUT}/boot/isolinux/isolinux.cfg" ; then
- log "include for vesamenu.cfg already foud, nothing to do."
+ log "include for vesamenu.cfg already found, nothing to do."
else
log "including vesamenu.cfg in ${BUILD_OUTPUT}/boot/isolinux/isolinux.cfg"
echo "include vesamenu.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/isolinux.cfg"
fi
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
- else
- GRUB_VERSION=1
- fi
-
- for file in "$BUILD_OUTPUT"/boot/addons/bsd4grml/boot.6 \
- "$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
- elif [ -e "$BUILD_OUTPUT"/boot/grub/menu.lst -a -e "$BUILD_OUTPUT"/boot/grub/grub.cfg ] ; then
- sed -i "/%GRUB_LEGACY%/d" "$BUILD_OUTPUT"/boot/grub/menu.lst
- sed -i "/%GRUB_LEGACY%/d" "$BUILD_OUTPUT"/boot/grub/grub.cfg
- fi
-
DPKG_LIST="/var/log/fai/$HOSTNAME/last/dpkg.list" # the dpkg --list output of the chroot
if ! [ -r "$DPKG_LIST" ] ; then
ewarn "$DPKG_LIST could not be read, ignoring to store package information on ISO therefore."
if [ "$BOOT_METHOD" = "isolinux" ] ; then
BOOT_ARGS="-no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
-elif [ "$BOOT_METHOD" = "grub" ] ; then
- BOOT_ARGS="-no-emul-boot -boot-load-size 4 -boot-info-table -b boot/grub/stage2"
elif [ "$BOOT_METHOD" = "grub2" ] ; then
BOOT_ARGS="-no-emul-boot -boot-load-size 4 -b boot/grub/toriboot.bin"
fi