bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ext2fs in a BSD slice


From: Cedric Ware
Subject: ext2fs in a BSD slice
Date: Mon, 18 Dec 2000 13:03:21 +0100

        Hello,

I have installed FreeBSD (4.2-RELEASE) and Linux (Debian 2.2r2) in
the same BSD slice, and I am using GRUB to boot them.  However, each
of them uses its native filesystem (ufs/ffs and ext2fs respectively)
and I noticed that GRUB would only mount the ext2 subpartition if it
was marked as "other".

Although FreeBSD did not assign a special code to ext2 subpartitions,
both NetBSD and OpenBSD seem to agree on 17 for that use.  I propose
the following patch, inspired from /usr/include/sys/disklabel.h in
Net and Open.

                                                Thank you,
                                                Cedric Ware.


diff -ru grub.old/stage2/fsys_ext2fs.c grub/stage2/fsys_ext2fs.c
--- grub.old/stage2/fsys_ext2fs.c       Fri Jul 28 18:51:15 2000
+++ grub/stage2/fsys_ext2fs.c   Sun Dec 17 15:04:37 2000
@@ -257,6 +257,7 @@
 
   if ((((current_drive & 0x80) || (current_slice != 0))
        && (current_slice != PC_SLICE_TYPE_EXT2FS)
+       && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_EXT2FS))
        && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER)))
       || part_length < (SBLOCK + (sizeof (struct ext2_super_block) / 
DEV_BSIZE))
       || !devread (SBLOCK, 0, sizeof (struct ext2_super_block),
diff -ru grub.old/stage2/pc_slice.h grub/stage2/pc_slice.h
--- grub.old/stage2/pc_slice.h  Sun Sep 10 18:45:15 2000
+++ grub/stage2/pc_slice.h      Sun Dec 17 14:54:00 2000
@@ -237,6 +237,10 @@
 #define        FS_HPFS         11      /* OS/2 high-performance file system */
 #define        FS_ISO9660      12      /* ISO 9660, normally CD-ROM */
 #define        FS_BOOT         13      /* partition contains bootstrap */
+#define        FS_ADOS         14      /* AmigaDOS fast file system */
+#define        FS_HFS          15      /* Macintosh HFS */
+#define        FS_FILECORE     16      /* Acorn Filecore Filing System */
+#define        FS_EXT2FS       17      /* Linux Extended 2 file system */
 
 
 #endif /* _PC_SLICE_H */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]