From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JQ974-0000ga-Qb for mharc-grub-devel@gnu.org; Fri, 15 Feb 2008 17:32:58 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQ973-0000fW-2y for grub-devel@gnu.org; Fri, 15 Feb 2008 17:32:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQ972-0000ez-C4 for grub-devel@gnu.org; Fri, 15 Feb 2008 17:32:56 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQ972-0000et-7w for grub-devel@gnu.org; Fri, 15 Feb 2008 17:32:56 -0500 Received: from mailout02.sul.t-online.de ([194.25.134.17] helo=mailout02.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JQ971-0006VW-So for grub-devel@gnu.org; Fri, 15 Feb 2008 17:32:56 -0500 Received: from fwd27.aul.t-online.de by mailout02.sul.t-online.com with smtp id 1JQ970-0004G3-03; Fri, 15 Feb 2008 23:32:54 +0100 Received: from [10.3.2.2] (Xd4iCMZZ8hN1EWUHTg3KNuZkgJ9rEV4V6D5gbfdMmMvDzHHoT0CD5sXLVApkOmEQGG@[217.235.229.202]) by fwd27.aul.t-online.de with esmtp id 1JQ96w-2AWDMO0; Fri, 15 Feb 2008 23:32:50 +0100 Message-ID: <47B61311.90005@t-online.de> Date: Fri, 15 Feb 2008 23:32:49 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 MIME-Version: 1.0 To: The development of GRUB 2 References: <47ACA35C.6080803@t-online.de> <20080208231411.GC17287@thorin> <47ACE69B.7070101@t-online.de> <47ADDD07.3080203@t-online.de> <20080209215923.GA25086@thorin> <1202598270.2418.6.camel@dv> <47AEFF8C.6090505@t-online.de> <20080210151412.GA7404@thorin> In-Reply-To: <20080210151412.GA7404@thorin> Content-Type: multipart/mixed; boundary="------------020102020408090903010708" X-ID: Xd4iCMZZ8hN1EWUHTg3KNuZkgJ9rEV4V6D5gbfdMmMvDzHHoT0CD5sXLVApkOmEQGG X-TOI-MSGID: a06a1baf-55af-4cbf-85b7-c84def659d4a X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] Create floppy emulation boot CD with grub-mkimage X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2008 22:32:57 -0000 This is a multi-part message in MIME format. --------------020102020408090903010708 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Robert Millan wrote: > On Sun, Feb 10, 2008 at 02:43:40PM +0100, Christian Franke wrote: > >> This results in 6 possible image variants: >> >> 1. Floppy: --image-type=floppy >> 2. CD, no emulation: --image-type=cdrom [--emulation=none] >> 3. CD, floppy emulation: --image-type=cdrom --emulation=floppy >> 4. CD, hdd emulation: --image-type=cdrom --emulation=hdd >> 5. USB without partitions: --image-type=superfloppy >> 6. USB with partitions: --image-type=hdd >> >> It may be possible to use the image #1 as image #5. >> > > I don't think it is really practical to support USB drives in grub-mkrescue. > You'd have to require root permissions, which IMO beats the point of having > a separate script from grub-install in first place. > > It may be useful to create small rescue images which can be later put on USB key with dd. (BTW: The "floppy" image actually boots from USB at least on one of my PC. It appears as hd0). Here a new patch, it uses the --emulation=floppy syntax from above. My recent tests (see "[PATCH] Ensure boot CD can be accessed") show that direct CD boot might always not work. The patch also adds a --joliet option, useful to access the long file names on Windows (which has no RR support). Christian 2008-02-15 Christian Franke * util/i386/pc/grub-mkrescue.in: Add --emulation=floppy to create a floppy emulation boot CD when non emulation mode does not work. Add --joliet to enable Joliet cdrom filesystem extension. --------------020102020408090903010708 Content-Type: text/x-patch; name="grub2-mkrescue-emulation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-mkrescue-emulation.patch" --- grub2.orig/util/i386/pc/grub-mkrescue.in 2008-02-09 14:02:56.057039500 +0100 +++ grub2/util/i386/pc/grub-mkrescue.in 2008-02-15 23:09:26.843750000 +0100 @@ -46,6 +46,8 @@ Make GRUB rescue image. --pkglibdir=DIR use images from directory DIR instead of ${pkglibdir} --grub-mkimage=FILE use FILE as grub-mkimage --image-type=TYPE select floppy or cdrom (default) + --emulation=TYPE select boot emulation type floppy, or none (default) + --joliet enable Joliet filesystem extension (cdrom only) grub-mkimage generates a bootable rescue image of the specified type. @@ -56,6 +58,8 @@ EOF image_type=cdrom input_dir=${pkglibdir} grub_mkimage=grub-mkimage +emulation=none +joliet= # Check the arguments. for option in "$@"; do @@ -82,6 +86,16 @@ for option in "$@"; do echo "Unknown image type \`$image_type'" 1>&2 exit 1 ;; esac ;; + --emulation=*) + emulation=`echo "$option" | sed 's/--emulation=//'` + case "$emulation" in + floppy|none) ;; + *) + echo "Unknown emulation type \`$emulation'" 1>&2 + exit 1 ;; + esac ;; + --joliet) + joliet="-J" ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -113,7 +127,7 @@ if test "x$overlay" = x ; then : ; else cp -dpR ${overlay}/* ${aux_dir}/ fi -if [ "x${image_type}" = "xfloppy" ] ; then +if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then # build memdisk memdisk_img=`mktemp` tar -C ${aux_dir} -cf ${memdisk_img} boot @@ -125,8 +139,21 @@ if [ "x${image_type}" = "xfloppy" ] ; th rm -f ${memdisk_img} # build floppy image - cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > $output_image + if [ "x${image_type}" = xcdrom ] ; then + floppy_dir=`mktemp -d` + floppy_img=${floppy_dir}/grub_floppy.img + else + floppy_img=${output_image} + fi + cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > ${floppy_img} rm -f ${core_img} + + if [ "x${image_type}" = xcdrom ] ; then + # build iso image + genisoimage -b grub_floppy.img \ + -o ${output_image} -r ${joliet} ${floppy_dir} + rm -rf ${floppy_dir} + fi else # build core.img core_img=`mktemp` @@ -139,7 +166,7 @@ else # build iso image genisoimage -b boot/grub/grub_eltorito \ -no-emul-boot -boot-load-size 4 -boot-info-table \ - -o ${output_image} -r ${aux_dir} + -o ${output_image} -r ${joliet} ${aux_dir} rm -rf ${aux_dir} fi --------------020102020408090903010708--