I've fixed the genhd.c problem. Please apply this patch for the CVS
version of gnumach.

Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnumach/ChangeLog,v
retrieving revision 1.46
diff -u -r1.46 ChangeLog
--- ChangeLog   1999/06/02 07:00:19     1.46
+++ ChangeLog   1999/06/07 09:08:15
@@ -1,3 +1,12 @@
+1999-06-07  OKUJI Yoshinori  <[EMAIL PROTECTED]>
+
+       * linux/dev/drivers/block/genhd.c [MACH] (mach_minor): New
+       variable.
+       (add_bsd_partition): New function.
+       (bsd_disklabel_partition) [MACH]: Call add_bsd_partition.
+       (msdos_partition) [MACH]: Set mach_minor to MINOR before
+       calling bsd_disklabel_partition.
+       
 1999-06-02  Roland McGrath  <[EMAIL PROTECTED]>
 
        * kern/bootstrap.c (build_args_and_stack): If kernel_cmdline is
Index: linux/dev/drivers/block/genhd.c
===================================================================
RCS file: /usr/local/cvsroot/gnumach/linux/dev/drivers/block/genhd.c,v
retrieving revision 1.2
diff -u -r1.2 genhd.c
--- genhd.c     1999/05/04 15:30:41     1.2
+++ genhd.c     1999/06/07 09:08:16
@@ -111,6 +111,19 @@
        printk(" %s", disk_name(hd, minor, buf));
 }
 
+#ifdef MACH
+static int mach_minor;
+static void
+add_bsd_partition (struct gendisk *hd, int minor, int slice,
+                  int start, int size)
+{
+  char buf[16];
+  hd->part[minor].start_sect = start;
+  hd->part[minor].nr_sects = size;
+  printk (" %s%c", disk_name (hd, mach_minor, buf), slice);
+}
+#endif
+  
 static inline int is_extended_partition(struct partition *p)
 {
        return (SYS_IND(p) == DOS_EXTENDED_PARTITION ||
@@ -240,46 +253,20 @@
 
        p = &l->d_partitions[0];
        while (p - &l->d_partitions[0] <= BSD_MAXPARTITIONS) {
-#ifdef MACH
-         /* Print BSD slices like hd0s1a (Mach syntax) instead of hd0s5
-            (Linux syntax), and do not add them into HD. In Mach,
-            the partitions of HD will not be used anyway.  */
-         if (p->p_fstype != BSD_FS_UNUSED)
-           {
-             unsigned int part = current_minor & mask;
-             const char *maj = hd->major_name;
-             char unit = (current_minor >> hd->minor_shift) + '0';
-             char slice = p - &l->d_partitions[0] + 'a';
-             
-#ifdef CONFIG_BLK_DEV_IDE
-             switch (hd->major)
-               {
-               case IDE3_MAJOR:
-                 unit += 2;
-               case IDE2_MAJOR:
-                 unit += 2;
-               case IDE1_MAJOR:
-                 unit += 2;
-               case IDE0_MAJOR:
-                 maj = "hd";
-               }
-#endif
-             if (part)
-               printk (" %s%cs%d%c", maj, unit, part, slice);
-             else
-               printk (" %s%c%c", maj, unit, slice);
-           }
-         p++;
-#else /* ! MACH */
                if ((current_minor & mask) >= (4 + hd->max_p))
                        break;
 
                if (p->p_fstype != BSD_FS_UNUSED) {
+#ifdef MACH
+                 add_bsd_partition (hd, current_minor,
+                                    p - &l->d_partitions[0] + 'a',
+                                    p->p_offset, p->p_size);
+#else
                        add_partition(hd, current_minor, p->p_offset, 
p->p_size);
+#endif
                        current_minor++;
                }
                p++;
-#endif /* ! MACH */
        }
        brelse(bh);
 
@@ -412,6 +399,9 @@
 #ifdef CONFIG_BSD_DISKLABEL
                if (SYS_IND(p) == BSD_PARTITION) {
                        printk(" <");
+#ifdef MACH
+                       mach_minor = minor;
+#endif
                        bsd_disklabel_partition(hd, MKDEV(hd->major, minor));
                        printk(" >");
                }


Thanks,
OKUJI
----------------------------------------------------------------------
OKUJI Yoshinori  <[EMAIL PROTECTED]>           ^o-o^
http://duff.kuicr.kyoto-u.ac.jp/~okuji (in English)     m /

Reply via email to