From: Vladimir 'phcoder' Serbinenko Date: Mon, 23 Sep 2013 10:19:49 +0000 (+0200) Subject: * util/getroot.c (grub_util_biosdisk_get_grub_dev): Do not assume X-Git-Tag: grub-2.02-beta1~829 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f7d9c828010efb20dabd488db0ac166bf80e2e2;p=thirdparty%2Fgrub.git * util/getroot.c (grub_util_biosdisk_get_grub_dev): Do not assume that floppies are unpartitioned. --- diff --git a/ChangeLog b/ChangeLog index 8d95254d9..df33d84ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-09-23 Vladimir Serbinenko + + * util/getroot.c (grub_util_biosdisk_get_grub_dev): Do not assume + that floppies are unpartitioned. + 2013-09-23 Vladimir Serbinenko * util/getroot_unix.c [__MINGW32__ || __CYGWIN__]: diff --git a/util/getroot.c b/util/getroot.c index 1e8bddc93..0872bc0ae 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -43,15 +43,6 @@ #ifdef __linux__ #include /* ioctl */ #include -#ifndef MAJOR -# ifndef MINORBITS -# define MINORBITS 8 -# endif /* ! MINORBITS */ -# define MAJOR(dev) ((unsigned) ((dev) >> MINORBITS)) -#endif /* ! MAJOR */ -#ifndef FLOPPY_MAJOR -# define FLOPPY_MAJOR 2 -#endif /* ! FLOPPY_MAJOR */ #endif #include @@ -67,11 +58,6 @@ #include #include -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# define MAJOR(dev) major(dev) -# define FLOPPY_MAJOR 2 -#endif - #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) #include #endif @@ -84,21 +70,9 @@ #include #endif /* defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) */ -#if defined(__NetBSD__) || defined(__OpenBSD__) -# define MAJOR(dev) major(dev) -# ifdef HAVE_GETRAWPARTITION -# include /* getrawpartition */ -# endif /* HAVE_GETRAWPARTITION */ #if defined(__NetBSD__) # include #endif -# ifndef FLOPPY_MAJOR -# define FLOPPY_MAJOR 2 -# endif /* ! FLOPPY_MAJOR */ -# ifndef RAW_FLOPPY_MAJOR -# define RAW_FLOPPY_MAJOR 9 -# endif /* ! RAW_FLOPPY_MAJOR */ -#endif /* defined(__NetBSD__) */ grub_disk_addr_t grub_util_find_partition_start (const char *dev) @@ -377,14 +351,6 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) name = make_device_name (drive, -1, -1); -# ifdef FLOPPY_MAJOR - if (MAJOR (st.st_rdev) == FLOPPY_MAJOR) - return name; -# else - /* Since os_dev and convert_system_partition_to_system_disk (os_dev) are - * different, we know that os_dev cannot be a floppy device. */ -# endif - ctx.start = grub_util_find_partition_start (os_dev); if (grub_errno != GRUB_ERR_NONE) {