]> git.proxmox.com Git - grub2.git/blob - debian/patches/disable-floppies.patch
New upstream release candidate (2.04~rc1)
[grub2.git] / debian / patches / disable-floppies.patch
1 From 069e6593fc700d24abc9735d3e7b2888d5143aea Mon Sep 17 00:00:00 2001
2 From: Colin Watson <cjwatson@debian.org>
3 Date: Mon, 13 Jan 2014 12:12:54 +0000
4 Subject: Disable use of floppy devices
5
6 An ugly kludge. Should this be merged upstream?
7
8 Author: Robert Millan
9
10 Patch-Name: disable-floppies.patch
11 ---
12 grub-core/kern/emu/hostdisk.c | 12 ++++++++++++
13 1 file changed, 12 insertions(+)
14
15 diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c
16 index e9ec680cd..8ac523953 100644
17 --- a/grub-core/kern/emu/hostdisk.c
18 +++ b/grub-core/kern/emu/hostdisk.c
19 @@ -532,6 +532,18 @@ read_device_map (const char *dev_map)
20 continue;
21 }
22
23 + if (! strncmp (p, "/dev/fd", sizeof ("/dev/fd") - 1))
24 + {
25 + char *q = p + sizeof ("/dev/fd") - 1;
26 + if (*q >= '0' && *q <= '9')
27 + {
28 + free (map[drive].drive);
29 + map[drive].drive = NULL;
30 + grub_util_info ("`%s' looks like a floppy drive, skipping", p);
31 + continue;
32 + }
33 + }
34 +
35 /* On Linux, the devfs uses symbolic links horribly, and that
36 confuses the interface very much, so use realpath to expand
37 symbolic links. */