]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
call fstat to get a geometry on Hurd, don't include linux/cdrom.h any longer.
authorokuji <okuji@localhost>
Sat, 30 Sep 2000 17:56:29 +0000 (17:56 +0000)
committerokuji <okuji@localhost>
Sat, 30 Sep 2000 17:56:29 +0000 (17:56 +0000)
ChangeLog
docs/grub.8
docs/mbchk.1
lib/device.c

index 050cdb8d26d854aedc9a98153e7901a6a197b33b..831740aacfd4a03adfa472de6a5cc4cf4b3b0ddc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2000-10-01  OKUJI Yoshinori  <okuji@gnu.org>
+
+       * lib/device.c [__linux__]: Don't include <linux/cdrom.h>.
+       [__linux__ && !CDROM_GET_CAPABILITY] (CDROM_GET_CAPABILITY):
+       Defined as 0x5331.
+       
+2000-10-01  OKUJI Yoshinori  <okuji@gnu.org>
+
+       * lib/device.c (get_drive_geometry) [__GNU__]: Get the number of
+       total sectors by fstat. The rest are filled with arbitrary
+       values.
+       
 2000-09-30  OKUJI Yoshinori  <okuji@gnu.org>
 
        * util/grub-install.in (convert): The code for gnu* (i.e.
index d3adbe0272e6277781e585d5544fc48fab3759ca..bf9ae05c261a260e3bc55d27e18b3e554030ef70 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.020.
-.TH GRUB "8" "September 2000" "grub (GNU GRUB 0.5.96)" FSF
+.TH GRUB "8" "October 2000" "grub (GNU GRUB 0.5.96)" FSF
 .SH NAME
 grub \- the grub shell
 .SH SYNOPSIS
index 9e78674291d5e56ab6fda0ec3676cf2079f0d8af..70433a425ee8555947742d22f93580569ffa5bc4 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.020.
-.TH MBCHK "1" "September 2000" "mbchk (GNU GRUB 0.5.96)" FSF
+.TH MBCHK "1" "October 2000" "mbchk (GNU GRUB 0.5.96)" FSF
 .SH NAME
 mbchk \- check the format of a Multiboot kernel
 .SH SYNOPSIS
index f35b1f9266d6629437e9e7e4bd8e6341a6687d81..77750c9575db683d1ad9ecd5e63648bede944c23 100644 (file)
@@ -44,7 +44,9 @@
 # include <linux/hdreg.h>      /* HDIO_GETGEO */
 # include <linux/major.h>      /* FLOPPY_MAJOR */
 # include <linux/kdev_t.h>     /* MAJOR */
-# include <linux/cdrom.h>      /* CDROM_GET_CAPABILITY */
+# ifndef CDROM_GET_CAPABILITY
+#  define CDROM_GET_CAPABILITY 0x5331  /* get capabilities */
+# endif /* ! CDROM_GET_CAPABILITY */
 # ifndef BLKGETSIZE
 #  define BLKGETSIZE   _IO(0x12,96)    /* return device size */
 # endif /* ! BLKGETSIZE */
@@ -94,7 +96,39 @@ get_drive_geometry (struct geometry *geom, char **map, int drive)
     close (fd);
     return;
   }
-  
+
+#elif defined(__GNU__)
+# warning "Automatic detection of geometries will be performed only \
+partially. This is not fatal."
+  /* Hurd */
+  {
+    /* For now, Hurd doesn't support the system call to get a geometry
+       from Mach, so get only the number of total sectors.  */
+    struct stat st;
+
+    if (fstat (fd, &st) || ! st.st_blocks)
+      goto fail;
+
+    geom->total_sectors = st.st_blocks;
+
+    /* Set the rest arbitrarily.  */
+    if (drive & 0x80)
+      {
+       geom->cylinders = DEFAULT_HD_CYLINDERS;
+       geom->heads = DEFAULT_HD_HEADS;
+       geom->sectors = DEFAULT_HD_SECTORS;
+      }
+    else
+      {
+       geom->cylinders = DEFAULT_FD_CYLINDERS;
+       geom->heads = DEFAULT_FD_HEADS;
+       geom->sectors = DEFAULT_FD_SECTORS;
+      }
+    
+    close (fd);
+    return;
+  }
+    
 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
   /* FreeBSD, NetBSD or OpenBSD */
   {