[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

merging ieee1275's grub-mkrescue into the common grub-mkrescue

From: Daniel Kahn Gillmor
Subject: merging ieee1275's grub-mkrescue into the common grub-mkrescue
Date: Wed, 17 Feb 2010 00:09:40 -0500
User-agent: Mozilla-Thunderbird (X11/20091109)

attached is a patch offered to merge the ieee1275 implementation of
grub-mkrescue into the common grub-mkrescue (currently shared only by
grub-coreboot and grub-pc).  It depends on grub-mkisofs supporting HFS
extensions, though.

Once grub-mkisofs can support these features, this patch would supercede
my earlier patch [0].  Perhaps the earlier patch should be applied in
the meantime to normalize the interface to grub-mkrescue?

The additional flags needed for support would be (see genisoimage(1) for
descriptions of what they do):

 -hfs-bless BLESSDIR

Looking at cdrkit's libhfs_iso/ directory, it appears that the code to
implement these features is mostly under "GPLv2 or later", despite the
disclaimer at http://www.cdrkit.org/ which claims plain GPLv2.

Similar code (probably with a common ancestor [1]) is also available in
the hfsutils package, which does appear to be unambiguously GPLv2+.
Neither hfsutils nor genisoimage offers a shared library, unfortunately.



[1] http://bugs.debian.org/570187
=== modified file 'util/grub-mkrescue.in'
--- util/grub-mkrescue.in       2009-12-22 17:20:27 +0000
+++ util/grub-mkrescue.in       2010-02-16 22:54:29 +0000
@@ -32,6 +32,7 @@
 coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed 
 pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-pc
+ieee1275_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed 
 # Usage: usage
 # Print the usage.
@@ -120,13 +121,18 @@
     if test -e "${pc_dir}" ; then
         process_input_dir ${pc_dir} pc
+    if test -e "${ieee1275_dir}" ; then
+        process_input_dir ${ieee1275_dir} ieee1275
+    fi
     process_input_dir ${override_dir} ${native_platform}
+    ieee1275_dir=
     case "${native_platform}" in
         coreboot) coreboot_dir=${override_dir} ;;
         pc) pc_dir=${override_dir} ;;
+        ieee1275) ieee1275_dir=${override_dir} ;;
@@ -183,10 +189,34 @@
                --embedded-boot ${embed_img}"
+# build ieee1275 core.img
+if test -e "${ieee1275_dir}" ; then
+    echo "Enabling ieee1275 support ..."
+    boot_dir=${iso9660_dir}/boot/grub/powerpc-ieee1275/boot
+    mkdir ${boot_dir}
+    grub-mkelfimage -n -d ${ieee1275_dir}/ -o ${boot_dir}/grub.img ${modules} 
+    modules="$(cat ${ieee1275_dir}/partmap.lst) ${modules}"
+    (for i in ${modules} ; do
+        echo "insmod $i"
+    done ; \
+    echo "source /boot/grub/grub.cfg") \
+    > ${iso9660_dir}/boot/grub/powerpc-ieee1275/grub.cfg
+    map_file=`mktemp`
+    cat >${map_file} <<EOF
+# EXTN          XLate   CREATOR   TYPE     Comment
+grub.img        Raw     'UNIX'    'tbxi'   "bootstrap"
+    grub_mkisofs_arguments="${grub_mkisofs_arguments} -hfs -part -no-desktop 
-map ${map_file} -hfs-bless ${boot_dir} -chrp-boot"
 # build iso image
 grub-mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o 
${output_image} -r ${iso9660_dir} ${source}
 rm -rf ${iso9660_dir}
 rm -f ${embed_img}
+rm -f ${map_file}
 exit 0

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]