mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 14:59:34 +00:00
add NetBSD and OpenBSD partition slices support
This commit is contained in:
1 parent
d52edd8638
commit
0f4f88a9d9
8 files changed
+47
-15
No files matched your search
+7
-4
@@ -346,8 +346,11 @@ check_BSD_parts (int flags)
|
||||
{
|
||||
/* FIXME: should do BAD144 sector remapping setup here */
|
||||
|
||||
/* XXX We cannot determine which variant of BSD owns
|
||||
this slice, so set it to FreeBSD paritition type.
|
||||
That should work fine for now. */
|
||||
current_slice = ((BSD_PART_TYPE (label_buf, part_no) << 8)
|
||||
| PC_SLICE_TYPE_BSD);
|
||||
| PC_SLICE_TYPE_FREEBSD);
|
||||
part_start = BSD_PART_START (label_buf, part_no);
|
||||
part_length = BSD_PART_LENGTH (label_buf, part_no);
|
||||
|
||||
@@ -487,7 +490,7 @@ real_open_partition (int flags)
|
||||
{
|
||||
current_partition |= 0xFFFF;
|
||||
printf (" Partition num: %d, ", slice_no);
|
||||
if (current_slice != PC_SLICE_TYPE_BSD)
|
||||
if (! IS_PC_SLICE_TYPE_BSD (current_slice))
|
||||
check_and_print_mount ();
|
||||
else
|
||||
check_BSD_parts (1);
|
||||
@@ -499,11 +502,11 @@ real_open_partition (int flags)
|
||||
*/
|
||||
else if (part_no == slice_no
|
||||
|| (part_no == 0xFF
|
||||
&& current_slice == PC_SLICE_TYPE_BSD))
|
||||
&& IS_PC_SLICE_TYPE_BSD (current_slice)))
|
||||
{
|
||||
if ((current_partition & 0xFF00) != 0xFF00)
|
||||
{
|
||||
if (current_slice == PC_SLICE_TYPE_BSD)
|
||||
if (IS_PC_SLICE_TYPE_BSD (current_slice))
|
||||
check_BSD_parts (0);
|
||||
else
|
||||
errnum = ERR_NO_PART;
|
||||
|
||||
@@ -255,7 +255,7 @@ ext2fs_mount (void)
|
||||
|
||||
if ((((current_drive & 0x80) || (current_slice != 0))
|
||||
&& (current_slice != PC_SLICE_TYPE_EXT2FS)
|
||||
&& (current_slice != (PC_SLICE_TYPE_BSD | (FS_OTHER << 8))))
|
||||
&& (! 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),
|
||||
(char *) SUPERBLOCK)
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ fat_mount (void)
|
||||
&& (current_slice != PC_SLICE_TYPE_FAT12)
|
||||
&& (current_slice != PC_SLICE_TYPE_FAT16_LT32M)
|
||||
&& (current_slice != PC_SLICE_TYPE_FAT16_GT32M)
|
||||
&& (current_slice != (PC_SLICE_TYPE_BSD | (FS_MSDOS << 8))))
|
||||
&& (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS << 8)))
|
||||
|| !devread (0, 0, SECTOR_SIZE, (char *) BPB)
|
||||
|| FAT_BPB_BYTES_PER_SECTOR (BPB) != SECTOR_SIZE
|
||||
|| FAT_BPB_SECT_PER_CLUST (BPB) < 1 || FAT_BPB_SECT_PER_CLUST (BPB) > 64
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ ffs_mount (void)
|
||||
int retval = 1;
|
||||
|
||||
if ((((current_drive & 0x80) || (current_slice != 0))
|
||||
&& current_slice != (PC_SLICE_TYPE_BSD | (FS_BSDFFS << 8)))
|
||||
&& ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS << 8))
|
||||
|| part_length < (SBLOCK + (SBSIZE / DEV_BSIZE))
|
||||
|| !devread (SBLOCK, 0, SBSIZE, (char *) SUPERBLOCK)
|
||||
|| SUPERBLOCK->fs_magic != FS_MAGIC)
|
||||
|
||||
+13
-3
@@ -105,9 +105,19 @@
|
||||
#define PC_SLICE_TYPE_WIN95_EXTENDED 0xf
|
||||
#define PC_SLICE_TYPE_EXT2FS 0x83
|
||||
|
||||
/* this next one is special, as it uses it's own partitioning scheme
|
||||
to subdivide the PC partition from there */
|
||||
#define PC_SLICE_TYPE_BSD 0xa5
|
||||
/* these ones are special, as they use thier own partitioning scheme
|
||||
to subdivide the PC partitions from there. */
|
||||
#define PC_SLICE_TYPE_FREEBSD 0xa5
|
||||
#define PC_SLICE_TYPE_OPENBSD 0xa6
|
||||
#define PC_SLICE_TYPE_NETBSD 0xa9
|
||||
|
||||
/* For convenience. */
|
||||
#define IS_PC_SLICE_TYPE_BSD_WITH_FS(type,fs) \
|
||||
((type) == (PC_SLICE_TYPE_FREEBSD | ((fs) << 8)) \
|
||||
|| (type) == (PC_SLICE_TYPE_OPENBSD | ((fs) << 8)) \
|
||||
|| (type) == (PC_SLICE_TYPE_NETBSD | (fs) << 8))
|
||||
|
||||
#define IS_PC_SLICE_TYPE_BSD(type) IS_PC_SLICE_TYPE_BSD_WITH_FS(type,0)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user