# set -e
# global variables
-GRML_LIVE_VERSION='0.15.1'
+GRML_LIVE_VERSION='0.16.1'
PN="$(basename $0)"
CMDLINE="$0 $@"
ADDONS_LIST_FILE='/boot/isolinux/addons_list.cfg'
echo -ne "\n"
}
-# Copy addonfile $1 from the TEMPLATE_DIRECTORY/compat (if exists),
-# or from $2 (the system path), or warn about the missing file.
+# Copy addonfile $1 from either
+# * the chroot (via $2, the system path),
+# * or from TEMPLATE_DIRECTORY/compat (if exists),
+# * or from the host system (again, using $2),
+# or warn about the missing file.
+#
# This is because:
+# * We assume that the chroot always has a "good" version of
+# the file. Also it makes sources handling easier.
# * On unstable, we Recommend the Debian packages containing
# these files. The user can override them by putting his
-# "better" version into TEMPLATE_DIRECTORY/compat.
+# "better" version into the chroot.
# * On stable, the Debian packages are probably not available,
# or outdated, so we look in TEMPLATE_DIRECTORY/compat first, where
# our grml-live-compat package installs current file versions.
copy_addon_file() {
- if [ ! -d "${BUILD_OUTPUT}/boot/$3/" ]; then
- mkdir -p "${BUILD_OUTPUT}/boot/$3"
+ DEST="${BUILD_OUTPUT}/boot/$3"
+ if [ ! -d "${DEST}/" ]; then
+ mkdir -p "${DEST}"
+ fi
+ if [ -e "$CHROOT_OUTPUT/$2/$1" ]; then
+ log "Copying $1 from chroot"
+ cp "$CHROOT_OUTPUT/$2/$1" "${DEST}/"
+ return $?
fi
if [ -e "${TEMPLATE_DIRECTORY}/compat/$3/$1" ]; then
- cp "${TEMPLATE_DIRECTORY}/compat/$3/$1" "${BUILD_OUTPUT}/boot/$3/"
+ log "Copying $1 from grml-live-compat"
+ cp "${TEMPLATE_DIRECTORY}/compat/$3/$1" "${DEST}/"
return $?
fi
if [ -e "$2/$1" ]; then
- echo "Copying $1 from system"
- cp "$2/$1" "${BUILD_OUTPUT}/boot/$3/"
+ log "Copying $1 from system"
+ cp "$2/$1" "${DEST}/"
return $?
fi
for file in memdisk chain.c32 hdt.c32 menu.c32; do
copy_addon_file "${file}" /usr/lib/syslinux addons
done
- # make memtest filename FAT16/8.3 compatible
- mv "${BUILD_OUTPUT}/boot/addons/memtest86+.bin" \
+
+ # make memtest filename FAT16/8.3 compatible
+ mv "${BUILD_OUTPUT}/boot/addons/memtest86+.bin" \
"${BUILD_OUTPUT}/boot/addons/memtest"
# copy only files so we can handle bsd4grml on its own
if [ -d "$TEMPLATE_DIRECTORY"/boot/addons/bsd4grml ] ; then
cp -a ${TEMPLATE_DIRECTORY}/boot/addons/bsd4grml "$BUILD_OUTPUT"/boot/addons/
else
- log "bsd4grml addon not found, skipping therefore."
- ewarn "bsd4grml addon not found, skipping therefore." ; eend 0
+ log "Missing addon file: bsd4grml"
+ ewarn "Missing addon file: bsd4grml" ; eend 0
fi
fi
if [ -e ${TEMPLATE_DIRECTORY}/compat/grub/linux.mod ]; then
cp "${TEMPLATE_DIRECTORY}"/compat/grub/* "${BUILD_OUTPUT}"/boot/grub/
else
- # copy system grub files if grml-live-compat is not
- # installed.
- 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
+ if ! which "grub-mkimage" >/dev/null 2>&1 ; then
+ log "grub-mkimage not found, skipping Grub step therefore." ; eend 0
+ ewarn "grub-mkimage not found, skipping Grub step therefore."
+ ewarn "Please install grub-pc-bin or grub-common >= 1.98+20100804-14." ; eend 0
+ elif ! grub-mkimage --help | grep -q -- --format ; then
+ log "grub-mkimage does not support --format=i386-pc, skipping Grub step therefore." ; eend 0
+ ewarn "grub-mkimage does not support --format=i386-pc, skipping Grub step therefore."
+ ewarn "Please install grub-common >= 1.98+20100804-14 or grub-pc-bin." ; eend 0
+ else
+ # copy system grub files if grml-live-compat is not installed
+ 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/
+ grub-mkimage -d /usr/lib/grub/*-pc -o \
+ "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc
+ fi
fi
if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then