Skip to contentSkip to conversation

don't assume floppy device exists

PATCH In review Robert Millan 2 participants 3 messages Sep 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't assume floppy device exists

grub-install used to fail with "/dev/fd0 not found" errors. See attached patch.

2006-09-14 Robert Millan <[email protected]>

* util/i386/pc/grub-mkdevicemap.c: Make sure floppy device exists before adding it to device.map.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended for
spam harvesters.  Writing to it will get you added to my black list.

2006-09-14 Robert Millan <[email protected]>

* util/i386/pc/grub-mkdevicemap.c: Make sure floppy device exists before adding it to device.map.

Index: util/i386/pc/grub-mkdevicemap.c
===================================================================
RCS file: /sources/grub/grub2/util/i386/pc/grub-mkdevicemap.c,v retrieving revision 1.2

i386/pc/grub-mkdevicemap.c +3 -0
diff -u -r1.2 grub-mkdevicemap.c
@@ -378,8 +378,11 @@
   for (i = 0; i < floppy_disks; i++)
     {
       char name[16];
+      struct stat st;
       
       get_floppy_disk_name (name, i);
+      if (stat (name, &st) < 0)
+	break;
       /* In floppies, write the map, whether check_device succeeds
 	 or not, because the user just may not insert floppies.  */
       if (fp)
#1 lore raw
Quoted 1 line · Robert Millan

grub-install used to fail with "/dev/fd0 not found" errors. See attached patch.

Thanks for the patch. Just keep sending them. ;-)

Quoted 4 lines

2006-09-14 Robert Millan <[email protected]>

* util/i386/pc/grub-mkdevicemap.c: Make sure floppy device exists before adding it to device.map.

I think it would be better to say "the floppy drive", no?

i386/pc/grub-mkdevicemap.c line 385

Quoted 2 lines
i386/pc/grub-mkdevicemap.c +2 -0
+      if (stat (name, &st) < 0)
+	break;

The indentation looks a bit weird in my mailclient. Please make sure the b of break is below the space after if.

After that, feel free to commit it.

--
Marco

#2 lore raw
Quoted 5 lines · Marco Gerards
Quoted 1 line · Robert Millan

grub-install used to fail with "/dev/fd0 not found" errors. See attached patch.

Thanks for the patch. Just keep sending them. ;-)

:)

Quoted 6 lines
Quoted 4 lines

2006-09-14 Robert Millan <[email protected]>

* util/i386/pc/grub-mkdevicemap.c: Make sure floppy device exists before adding it to device.map.

I think it would be better to say "the floppy drive", no?

As you like (using "the floppy device" after clarification via IRC).

Quoted 5 lines

i386/pc/grub-mkdevicemap.c line 385

Quoted 2 lines
i386/pc/grub-mkdevicemap.c +2 -0
+      if (stat (name, &st) < 0)
+	break;

The indentation looks a bit weird in my mailclient. Please make sure the b of break is below the space after if.

It is. I copied the indentation from the printf below (tab + spaces).

Quoted 1 line

After that, feel free to commit it.

Done.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended for
spam harvesters.  Writing to it will get you added to my black list.