]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/getroot.c (grub_util_biosdisk_get_grub_dev): Do not assume
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 23 Sep 2013 10:19:49 +0000 (12:19 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 23 Sep 2013 10:19:49 +0000 (12:19 +0200)
that floppies are unpartitioned.

ChangeLog
util/getroot.c

index 8d95254d975ddc589a52ba88c7fbaa99750f98c1..df33d84ed9df19e7735dc664b89c05b47bacc5c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-23  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/getroot.c (grub_util_biosdisk_get_grub_dev): Do not assume
+       that floppies are unpartitioned.
+
 2013-09-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/getroot_unix.c [__MINGW32__ || __CYGWIN__]:
index 1e8bddc934112bb603501fba789abdcc8a1aa156..0872bc0aed606cff24f34ccc3340598d80b9c3b3 100644 (file)
 #ifdef __linux__
 #include <sys/ioctl.h>         /* ioctl */
 #include <sys/mount.h>
-#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 <sys/types.h>
 #include <grub/emu/hostdisk.h>
 #include <grub/emu/getroot.h>
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-# define MAJOR(dev) major(dev)
-# define FLOPPY_MAJOR  2
-#endif
-
 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
 #include <sys/mount.h>
 #endif
 #include <sys/mount.h>
 #endif /* defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) */
 
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-# define MAJOR(dev) major(dev)
-# ifdef HAVE_GETRAWPARTITION
-#  include <util.h>    /* getrawpartition */
-# endif /* HAVE_GETRAWPARTITION */
 #if defined(__NetBSD__)
 # include <sys/fdio.h>
 #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)
       {