manifold supporting and using ISOLINUX now
[grml-live.git] / grml-live
index 498a535..151e464 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -1088,19 +1088,28 @@ else
          fi
       # by default use our manifold boot method:
       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"
          if ! [ -r boot/grub/core.img ] ; then
            ewarn "boot/grub/core.img not found, not creating manifold boot ISO file"
+         elif [ $bootoff -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"
          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
                # 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
            eend $?
          fi
       fi