X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=grml-live;h=351854df1a254e9b564b3b7b6e0a1c7a8ff7e20f;hp=4d4722ae51e2820900bfc57ae48665fce3abe7c6;hb=ea0c8152188bc3ce0f5207a22778ef50c5b1df4c;hpb=fbf963a7daba8923a74992c3614015ecd705dff7 diff --git a/grml-live b/grml-live index 4d4722a..351854d 100755 --- a/grml-live +++ b/grml-live @@ -24,7 +24,7 @@ fi # 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' @@ -215,26 +215,39 @@ extend_string_end() { 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 log "Copying $1 from system" - cp "$2/$1" "${BUILD_OUTPUT}/boot/$3/" + cp "$2/$1" "${DEST}/" return $? fi @@ -755,8 +768,8 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then 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 @@ -771,18 +784,21 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then if [ -e ${TEMPLATE_DIRECTORY}/compat/grub/linux.mod ]; then cp "${TEMPLATE_DIRECTORY}"/compat/grub/* "${BUILD_OUTPUT}"/boot/grub/ else - if ! [ -x /usr/bin/grub-mkimage ] ; then + 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 "Either install grub-common >= 1.98+20100804-14 or grub-pc." ; eend 0 + 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. + # 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 \ + grub-mkimage -d /usr/lib/grub/*-pc -o \ "${BUILD_OUTPUT}/boot/grub/core.img" biosdisk iso9660 --format=i386-pc fi fi