summaryrefslogtreecommitdiff
path: root/helpers/lh_binary_iso
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_binary_iso')
-rwxr-xr-xhelpers/lh_binary_iso39
1 files changed, 39 insertions, 0 deletions
diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso
index 0b8bb55..d9f3902 100755
--- a/helpers/lh_binary_iso
+++ b/helpers/lh_binary_iso
@@ -99,6 +99,12 @@ case "${LH_BOOTLOADER}" in
GENISOIMAGE_EXCLUDE="boot/grub/stage2_eltorito"
;;
+ grub2)
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -b boot/grub/grub_eltorito -J"
+ GENISOIMAGE_EXCLUDE="boot/grub/grub_eltorito"
+ ;;
+
silo)
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -G boot/isofs.b -B ..."
GENISOIMAGE_EXCLUDE="boot/isofs.b"
@@ -132,7 +138,40 @@ then
fi
fi
+if [ "${LH_BOOTLOADER}" = "grub2" ]
+then
+
cat > binary.sh << EOF
+#!/bin/sh
+
+input_dir=/usr/lib/grub/i386-pc
+
+# build core.img
+core_img=\$(mktemp)
+grub-mkimage -d ${input_dir} -o ${core_img} biosdisk iso9660
+
+# build grub_eltorito image
+cat ${input_dir}/cdboot.img ${core_img} > binary/boot/grub/grub_eltorito
+
+rm -f ${core_img}
+
+for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \
+ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
+ ${input_dir}/handler.lst ${input_dir}/parttool.lst
+do
+ if test -f "$file"
+ then
+ cp -f "$file" binary/boot/grub
+ fi
+done
+EOF
+
+else
+ echo "#!/bin/sh" > binary.sh
+fi
+
+cat >> binary.sh << EOF
+
genisoimage ${GENISOIMAGE_OPTIONS} -o binary.iso binary
EOF