From: Colin Watson Date: Mon, 13 Jan 2014 12:12:54 +0000 (+0000) Subject: Disable use of floppy devices X-Git-Tag: archive/raspbian/2.12-8+rpi1^2~143 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=839ae0906ae29bee498dca90d07ab5b6c08690f4;p=grub2.git Disable use of floppy devices An ugly kludge. Should this be merged upstream? Author: Robert Millan Patch-Name: disable-floppies.patch Gbp-Pq: Name disable-floppies.patch --- diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 0e6eebd..3e39fc6 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -532,6 +532,18 @@ read_device_map (const char *dev_map) continue; } + if (! strncmp (p, "/dev/fd", sizeof ("/dev/fd") - 1)) + { + char *q = p + sizeof ("/dev/fd") - 1; + if (*q >= '0' && *q <= '9') + { + free (map[drive].drive); + map[drive].drive = NULL; + grub_util_info ("`%s' looks like a floppy drive, skipping", p); + continue; + } + } + /* On Linux, the devfs uses symbolic links horribly, and that confuses the interface very much, so use realpath to expand symbolic links. */