On 09/22/2010 05:45 PM, Thomas Frauendorfer | Miray Software wrote: > Hi, > > On some boards, like the AsRock K7S41GX, Grub fails to boot from > superfloppy fat32 formated usb sticks. > This config isn't recommended in first place. You should really create partitions on the USB disk and leave some space between MBR and partition, then there will be no problem with this on-the-fly replacement. As an alternative you can use grub-mkrescue. As for your patch it may break in case when only backup is damaged. The correct algorithm would be sth like
if (!consistent (bpb)) { err = read_backup_bpb (bpb); if (err) return err; if (!consistent (bpb)) return grub_error (...); } Function consistent would contain all current checks (minus perhaps "FAT" string checking) plus the checks that e.g. number of fat entries and fat sectors is consistent. > The reason for the boot failure is that the bios of the mentioned > board replaces byte 0x24 of the bpb with the value 0x00 when it's > read through the bios function. > In fat16 this byte contains the Disc unit number, so this causes no > real harm there. > In fat32 this byte is part of the sectors per FAT information, so by > modifying this value the bios makes Grub unable to read the fat system. > > The attached workaround reads the backup bpb information on fat32 > filesystems and uses the sectors per fat information stored there. > > PS: I'm sorry if this mail is a duplicate, but I sent it before but I > wasn't subscribed so it might have been blocked/dropped before > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > -- Regards Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel