[issue889] grml-live still uses grub-legacy

Thorsten Glaser bts at bts.grml.org
Mon Dec 6 22:12:26 CET 2010


Thorsten Glaser <tg at mirbsd.org> added the comment:

attached patch might implement this; untested

we do *NOT* use cdboot.img or -boot-info-table but the same method
manifold-boot uses (and MirBSD ISOs use for El Torito boot, incidentally)!

----------
files: 0001-support-BOOT_METHOD-grub2-El-Torito-boot-Manifold-bo.patch, screenshot.png
messages: 3306, 3351, 3584
nosy: suntong
priority: wish
status: chatting
title: grml-live still uses grub-legacy
topic: grml-live

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue889>
_____________________________________
-------------- next part --------------
>From 36a055e1a84aace76c84700c88dc78a2fef08e37 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg at mirbsd.org>
Date: Mon, 6 Dec 2010 21:11:01 +0000
Subject: [PATCH] =?utf-8?q?support=20BOOT=5FMETHOD=3Dgrub2=20(El=20Torito=20boot=20=E2=80=93=20Manifold=20boot=20already=20did)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Issue #889

Signed-off-by: Thorsten Glaser <tg at mirbsd.org>
---
 etc/grml/grml-live.conf |    2 +-
 grml-live               |   26 +++++++++++++++++---------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/etc/grml/grml-live.conf b/etc/grml/grml-live.conf
index 6563eec..30b508c 100644
--- a/etc/grml/grml-live.conf
+++ b/etc/grml/grml-live.conf
@@ -109,7 +109,7 @@
 # SQUASHFS_OPTIONS="-nolzma"
 
 # Which bootloader do you want to use? Default: isolinux
-# Supported values: isolinux, grub
+# Supported values: isolinux, grub, grub2
 # BOOT_METHOD='isolinux'
 
 # Directory of configuration files for grml-live's FAI:
diff --git a/grml-live b/grml-live
index 4dfbef9..6100b63 100755
--- a/grml-live
+++ b/grml-live
@@ -1019,9 +1019,11 @@ find .. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; >
 [ -n "$ISO_NAME" ] || ISO_NAME="${GRML_NAME}_${VERSION}.iso"
 
 if [ "$BOOT_METHOD" = "isolinux" ] ; then
-   BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
+   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_FILE="boot/grub/stage2"
+   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
 
 if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ]  ; then
@@ -1051,11 +1053,21 @@ else
 
    CURRENT_DIR=$(pwd)
    if cd "$BUILD_OUTPUT" ; then
-      log "$MKISOFS -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b $BOOT_FILE -o ${ISO_OUTPUT}/${ISO_NAME} ."
+      if [ "$BOOT_METHOD" = "grub2" ]; then
+         # those are in 2048-byte sectors, so 1 16 matches 4 63 below
+         echo 1 16 | mksh /usr/share/grml-live/scripts/bootgrub.mksh -B 11 \
+            >boot/grub/toriboot.bin
+      fi
+      log "$MKISOFS -V '${GRML_NAME} ${VERSION}' -publisher 'grml-live | grml.org' -l -r -J $BOOT_ARGS -o ${ISO_OUTPUT}/${ISO_NAME} ."
       "$MKISOFS" -V "${GRML_NAME} ${VERSION}" -publisher 'grml-live | grml.org' \
-              -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table    \
-              -b $BOOT_FILE -no-pad \
+              -l -r -J $BOOT_ARGS -no-pad \
               -o "${ISO_OUTPUT}/${ISO_NAME}" . ; RC=$?
+      # both of these need core.img there, so it’s easier to write it here
+      if [ "$BOOT_METHOD" = "grub2" ] || [ "$HYBRID_METHOD" = "grub2" ]; then
+         # must be <= 30720 bytes
+         dd if=boot/grub/core.img of="${ISO_OUTPUT}/${ISO_NAME}" \
+           conv=notrunc bs=512 seek=4 2>/dev/null
+      fi
 
       # pad the output ISO to multiples of 256 KiB for partition table support
       siz=$($getfilesize "${ISO_OUTPUT}/${ISO_NAME}")
@@ -1101,10 +1113,6 @@ else
            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
            else
               # read only one but 2048-byte sized (scale: << 2) sector
               echo $bootoff $bootoff | \
-- 
1.6.3.1



More information about the Bugs-changes mailing list