All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: grub-devel@gnu.org
Subject: [PATCH] Create floppy emulation boot CD with grub-mkimage
Date: Fri, 08 Feb 2008 19:45:48 +0100	[thread overview]
Message-ID: <47ACA35C.6080803@t-online.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

A CD created by "grub-mkrescue --image-type=cdrom" does not work for me 
for some reason. Is it probably necessary to supply -boot-load-seg to 
genisoimage?

But booting a grub2 rescue floppy image in El Torito emulation mode 
works. This patch adds the image type "floppycd" to create such a CD.

Christian

2008-02-08  Christian Franke  <franke@computer.org>

	* util/i386/pc/grub-mkrescue.in: Add --image-type=floppycd
	to create a floppy emulation boot CD when non emulation mode
	does not work.



[-- Attachment #2: grub2-mkrescue-floppycd.patch --]
[-- Type: text/x-patch, Size: 1933 bytes --]

--- grub2.orig/util/i386/pc/grub-mkrescue.in	2008-02-03 20:29:54.562500000 +0100
+++ grub2/util/i386/pc/grub-mkrescue.in	2008-02-08 18:21:27.734375000 +0100
@@ -45,7 +45,7 @@ Make GRUB rescue image.
   --overlay=DIR           overlay directory DIR in the memdisk 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)
+  --image-type=TYPE       select floppy, floppycd, or cdrom (default)
 
 grub-mkimage generates a bootable rescue image of the specified type.
 
@@ -77,7 +77,7 @@ for option in "$@"; do
     --image-type=*)
     	image_type=`echo "$option" | sed 's/--image-type=//'`
         case "$image_type" in
-          floppy|cdrom) ;;
+          floppy|floppycd|cdrom) ;;
           *)
             echo "Unknown image type \`$image_type'" 1>&2
             exit 1 ;;
@@ -113,7 +113,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${image_type}" = "xfloppycd" ] ; then
   # build memdisk
   memdisk_img=`mktemp`
   tar -C ${aux_dir} -cf ${memdisk_img} boot
@@ -125,8 +125,20 @@ 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}" = "xfloppycd" ] ; then
+    floppy_dir=`mktemp -d`
+    floppy_img=${floppy_dir}/grub_floppy
+  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}" = "xfloppycd" ] ; then
+    # build iso image
+    genisoimage -b grub_floppy -o ${output_image} -r ${floppy_dir}
+    rm -rf ${floppy_dir}
+  fi
 else
   # build core.img
   core_img=`mktemp`

             reply	other threads:[~2008-02-08 18:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 18:45 Christian Franke [this message]
2008-02-08 19:17 ` [PATCH] Create floppy emulation boot CD with grub-mkimage Robert Millan
2008-02-08 22:03   ` Christian Franke
2008-02-08 22:45     ` Robert Millan
2008-02-08 23:07       ` Pavel Roskin
2008-02-08 23:10         ` Robert Millan
2008-02-08 23:17       ` Christian Franke
2008-02-08 23:35         ` Robert Millan
2008-02-09 11:56       ` Bean
2008-02-09 12:32         ` Robert Millan
2008-02-09 12:38           ` Bean
2008-02-09 16:53         ` Christian Franke
2008-02-09 17:15           ` Bean
2008-02-10 12:17             ` Christian Franke
2008-02-08 23:14 ` Robert Millan
2008-02-08 23:32   ` Christian Franke
2008-02-09 17:04     ` Christian Franke
2008-02-09 21:59       ` Robert Millan
2008-02-09 23:04         ` Pavel Roskin
2008-02-10 13:43           ` Christian Franke
2008-02-10 15:14             ` Robert Millan
2008-02-15 22:32               ` Christian Franke
2008-02-17 13:31                 ` Robert Millan
2008-02-17 15:29                   ` Christian Franke
2008-02-18  9:04                   ` tsah marco
2008-03-01 21:05                   ` Christian Franke
2008-03-03 20:46                     ` Robert Millan
2008-03-03 22:10                       ` Christian Franke
2008-03-03 22:24                         ` Robert Millan
2008-03-07 21:20                           ` Christian Franke
2008-04-13 15:13                             ` Robert Millan
  -- strict thread matches above, loose matches on Subject: below --
2008-03-04  2:11 Kalamatee
2008-03-04  2:12 ` Kalamatee
2008-03-04  9:22 Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ACA35C.6080803@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.