remove fcopy backups all across /etc
[grml-live.git] / grml-live
index 498a535..4dfbef9 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -23,7 +23,7 @@ fi
 set -e
 
 # global variables
-GRML_LIVE_VERSION='0.11.0'
+GRML_LIVE_VERSION='0.12.0'
 PN="$(basename $0)"
 CMDLINE="$0 $@"
 SOURCES_LIST_FILE='/etc/grml/fai/apt/sources.list'
@@ -779,7 +779,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
 
       # generate addon list
       rm "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
-      for name in $(ls "${BUILD_OUTPUT}"/boot/isolinux/addon_*.cfg) ; do
+      for name in "${BUILD_OUTPUT}"/boot/isolinux/addon_*.cfg ; do
         include_name=$(basename "$name")
         echo "include $include_name"  >> "${BUILD_OUTPUT}/${ADDONS_LIST_FILE}"
       done
@@ -1088,19 +1088,28 @@ else
          fi
       # by default use our manifold boot method:
       else
+         # isoinfo is part of both mkisofs and genisoimage so we're good
+         bootoff=$(isoinfo -l -i "${ISO_OUTPUT}/${ISO_NAME}" | \
+           sed -n '/^.*\[ *\([0-9]*\)[] ].* ISOLINUX.BIN;1 *$/s//\1/p')
          if ! [ -r boot/grub/core.img ] ; then
            ewarn "boot/grub/core.img not found, not creating manifold boot ISO file"
+         elif [ "${bootoff:-0}" -lt 1 ] ; then
+           ewarn "isolinux.bin not found on the ISO file, disabling manifold boot"
          else
            log "Creating hybrid ISO file with manifold method"
            einfo "Creating hybrid ISO file with manifold method"
-           (
+           if [ "$HYBRID_METHOD" = "grub2" ] ; then
                # 512 bytes: MBR, partition table, load GRUB 2
                echo 4 63 | mksh /usr/share/grml-live/scripts/bootgrub.mksh -A -M 4:0x96 -g $cyls:16:32
                # pad to a whole of 2048 bytes (one CD sector)
                dd if=/dev/zero bs=512 count=3 2>/dev/null
                # append GRUB 2 (must be <=30720 bytes)
                cat boot/grub/core.img
-           ) | dd of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null
+           else
+              # read only one but 2048-byte sized (scale: << 2) sector
+              echo $bootoff $bootoff | \
+                 mksh /usr/share/grml-live/scripts/bootilnx.mksh -A -M 4:0x96 -g $cyls:16:32 -S 2
+           fi | dd of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null
            eend $?
          fi
       fi