From: Ethan Benson Date: Sat, 9 Jul 2005 23:51:20 +0000 (+0000) Subject: handle RAID partitions on x86 partition tables X-Git-Tag: yaboot-1.3.14rc1~8 X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=commitdiff_plain;h=4d075ad792d6f99502a863a71d820658915dfcc1 handle RAID partitions on x86 partition tables * Support reading of type RAID partitions, except from fs_of. This only works on x86 partition tables, Pmac partition tables will need alternate methods. (Patch from Dustin Kirkland). git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-83 --- diff --git a/0arch-timestamps0 b/0arch-timestamps0 index 26a1a54..0a2f69e 100644 --- a/0arch-timestamps0 +++ b/0arch-timestamps0 @@ -1,7 +1,7 @@ -./0arch-timestamps0 1120448039 1120448533 +./0arch-timestamps0 1120448537 1120953071 ./BUGS 1109049412 1000991730 ./COPYING 1109049412 1000991730 -./ChangeLog 1120448453 1120448530 +./ChangeLog 1120952850 1120953067 ./Config 1109049412 1002101497 ./INSTALL 1109049412 1000991730 ./Makefile 1109049412 1089576723 @@ -22,18 +22,18 @@ ./doc/examples/simpleboot.chrp 1109049412 1068017750 ./doc/examples/yaboot.conf.multi-boot 1109049412 1006348765 ./doc/examples/yaboot.conf.rs6000 1109049412 1006348765 -./doc/examples 1120447952 1068017750 +./doc/examples 1120953070 1068017750 ./doc/yaboot-howto.de.sgml 1109049413 1096186109 ./doc/yaboot-howto.sgml 1109049413 1096186082 -./doc 1120447952 1096186109 +./doc 1120953070 1096186109 ./etc/yaboot.conf 1109049413 1006348765 -./etc 1120447952 1007269243 +./etc 1120953070 1007269243 ./first/ofboot 1118285749 1065311880 -./first 1120447952 1071492158 +./first 1120953070 1071492158 ./include/asm/elf.h 1109049413 1000991730 ./include/asm/ppc_asm.tmpl 1109049413 1000991730 ./include/asm/processor.h 1109049413 1000991730 -./include/asm 1120447952 1007269243 +./include/asm 1120953071 1007269243 ./include/bootinfo.h 1109049413 1007200690 ./include/byteorder.h 1109049413 1000991730 ./include/cfg.h 1109049413 1007200690 @@ -42,13 +42,12 @@ ./include/debug.h 1109049413 1007200690 ./include/errors.h 1109049413 1007200690 ./include/et/com_err.h 1109049413 1000991731 -./include/et 1120447952 1007269243 +./include/et 1120953071 1007269243 ./include/ext2fs/bitops.h 1109049413 1003927524 ./include/ext2fs/ext2_err.h 1109049413 1003927524 ./include/ext2fs/ext2_io.h 1109049413 1003927524 ./include/ext2fs/ext2fs.h 1109049413 1003927524 -./include/ext2fs 1120447952 1007269243 -./include/fdisk-part.h 1109049413 1007200690 +./include/ext2fs 1120953071 1007269243 ./include/file.h 1109049413 1007200690 ./include/fs.h 1109049413 1007200690 ./include/linux/elf.h 1109049413 1000991731 @@ -56,13 +55,12 @@ ./include/linux/iso_fs.h 1109049413 1000991731 ./include/linux/stat.h 1109049413 1000991731 ./include/linux/types.h 1109049413 1000991731 -./include/linux 1120447952 1007269243 +./include/linux 1120953071 1007269243 ./include/mac-part.h 1109049413 1007200690 ./include/md5.h 1109049413 1000991730 -./include/partition.h 1109049413 1007200690 ./include/prom.h 1109049413 1007200690 ./include/reiserfs/reiserfs.h 1109049413 1025684115 -./include/reiserfs 1120447952 1025684115 +./include/reiserfs 1120953071 1025684115 ./include/setjm2.h 1109049413 1000991730 ./include/setjmp.h 1109049413 1000991730 ./include/stdlib.h 1109049413 1000991730 @@ -70,10 +68,12 @@ ./include/swab.h 1109049413 1000991730 ./include/types.h 1109049413 1000991730 ./include/xfs/xfs.h 1109049413 1002101334 -./include/xfs 1120447952 1007269244 +./include/xfs 1120953071 1007269244 ./include/yaboot.h 1109049413 1007200690 ./include/amiga-part.h 1116558586 1116558522 -./include 1120447952 1116558522 +./include/fdisk-part.h 1120952841 1120952841 +./include/partition.h 1120952841 1120952841 +./include 1120953071 1120952841 ./lib/ctype.c 1109049413 1000991731 ./lib/libext2fs.a 1109049413 1003927524 ./lib/malloc.c 1109049413 1007200690 @@ -82,7 +82,7 @@ ./lib/strtol.c 1109049413 1000991731 ./lib/vsprintf.c 1109049413 1000991731 ./lib/strstr.c 1119929028 1116476589 -./lib 1120447952 1116476589 +./lib 1120953071 1116476589 ./man/bootstrap.8 1116558691 1000991731 ./man/mkofboot.8 1116558691 1006348765 ./man/ofpath.8 1116558691 1000991731 @@ -90,32 +90,32 @@ ./man/yabootconfig.8 1116558691 1027929577 ./man/ybin.8 1116558691 1006348765 ./man/yaboot.8 1116558691 1090699543 -./man 1120447953 1116476667 +./man 1120953071 1116476667 ./man.patch 1116558699 1006348761 -./second/cache.S 1120447850 1007200690 -./second/cfg.c 1120447850 1007200690 -./second/cmdline.c 1120447850 1032059589 -./second/crt0.S 1120447850 1000991731 -./second/file.c 1120447850 1044868693 -./second/fs.c 1120447850 1032059574 -./second/fs_ext2.c 1120447850 1032059564 -./second/fs_iso.c 1120447850 1007200690 -./second/fs_of.c 1120447850 1089575693 -./second/fs_reiserfs.c 1120447850 1007200690 -./second/fs_xfs.c 1120447850 1032059541 -./second/iso_util.c 1120447850 1003656415 -./second/md5.c 1120447850 1032059532 -./second/prom.c 1120447850 1067937197 -./second/setjmp.S 1120447850 1000991732 -./second/partition.c 1120447850 1116558522 -./second/yaboot.c 1120447850 1032059504 -./second 1120447850 1119139565 +./second/cache.S 1120952570 1007200690 +./second/cfg.c 1120952570 1007200690 +./second/cmdline.c 1120952570 1032059589 +./second/crt0.S 1120952570 1000991731 +./second/file.c 1120952570 1044868693 +./second/fs.c 1120952570 1032059574 +./second/fs_ext2.c 1120952570 1032059564 +./second/fs_iso.c 1120952570 1007200690 +./second/fs_reiserfs.c 1120952570 1007200690 +./second/fs_xfs.c 1120952570 1032059541 +./second/iso_util.c 1120952570 1003656415 +./second/md5.c 1120952570 1032059532 +./second/prom.c 1120952570 1067937197 +./second/setjmp.S 1120952570 1000991732 +./second/yaboot.c 1120952570 1032059504 +./second/fs_of.c 1120952841 1120952841 +./second/partition.c 1120952841 1120952841 +./second 1120953071 1120952841 ./util/elfextract.c 1109049413 1007303237 ./util/addnote.c 1109049413 1107321884 -./util 1120447953 1107321884 -./ybin/mkofboot 1120447944 1073219938 -./ybin/ofpath 1120448416 1120448442 +./util 1120953071 1107321884 +./ybin/mkofboot 1120953071 1073219938 +./ybin/ofpath 1120448537 1120448442 ./ybin/yabootconfig 1117166139 1089576743 ./ybin/ybin 1120448039 1120447943 -./ybin 1120448533 1120448442 -. 1120448533 1120448529 +./ybin 1120953071 1120448442 +. 1120953070 1120953067 diff --git a/ChangeLog b/ChangeLog index 6e1e722..592cbbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,22 @@ # arch-tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3 # +2005-07-09 23:51:20 GMT Ethan Benson patch-83 + + Summary: + handle RAID partitions on x86 partition tables + Revision: + yaboot--devel--1.3--patch-83 + + * Support reading of type RAID partitions, except from fs_of. + This only works on x86 partition tables, Pmac partition tables will + need alternate methods. (Patch from Dustin Kirkland). + + modified files: + 0arch-timestamps0 ChangeLog include/fdisk-part.h + include/partition.h second/fs_of.c second/partition.c + + 2005-07-04 03:42:18 GMT Ethan Benson patch-82 Summary: diff --git a/include/fdisk-part.h b/include/fdisk-part.h index c81b3fa..937ddd7 100644 --- a/include/fdisk-part.h +++ b/include/fdisk-part.h @@ -27,6 +27,7 @@ #define LINUX_SWAP 0x82 #define LINUX_NATIVE 0x83 #define LINUX_EXTENDED 0x85 +#define LINUX_RAID 0xfd struct fdisk_partition { unsigned char boot_ind; /* 0x80 - active */ diff --git a/include/partition.h b/include/partition.h index c772483..23c99ba 100644 --- a/include/partition.h +++ b/include/partition.h @@ -40,6 +40,7 @@ struct partition_t { unsigned long part_start; /* In blocks */ unsigned long part_size; /* In blocks */ unsigned short blocksize; + int sys_ind; /* fs type */ }; extern struct partition_t* partitions_lookup(const char *device); diff --git a/second/fs_of.c b/second/fs_of.c index 0d5e411..7a22117 100644 --- a/second/fs_of.c +++ b/second/fs_of.c @@ -39,6 +39,7 @@ #include "prom.h" #include "string.h" #include "partition.h" +#include "fdisk-part.h" #include "fs.h" #include "errors.h" #include "debug.h" @@ -89,6 +90,13 @@ of_open(struct boot_file_t* file, const char* dev_name, DEBUG_ENTER; DEBUG_OPEN; + if (part->sys_ind == LINUX_RAID) + { + DEBUG_F("skipping because partition is marked LINUX_RAID\n"); + DEBUG_LEAVE(FILE_ERR_BAD_FSYS); + return FILE_ERR_BAD_FSYS; + } + strncpy(buffer, dev_name, 768); strcat(buffer, ":"); if (part) { diff --git a/second/partition.c b/second/partition.c index e3ab4c5..a95a1b2 100644 --- a/second/partition.c +++ b/second/partition.c @@ -67,7 +67,7 @@ static unsigned char block_buffer[MAX_BLOCK_SIZE]; static void add_new_partition(struct partition_t** list, int part_number, const char *part_type, const char *part_name, unsigned long part_start, unsigned long part_size, - unsigned short part_blocksize) + unsigned short part_blocksize, int sys_ind) { struct partition_t* part; part = (struct partition_t*)malloc(sizeof(struct partition_t)); @@ -78,6 +78,7 @@ add_new_partition(struct partition_t** list, int part_number, const char *part_t part->part_start = part_start; part->part_size = part_size; part->blocksize = part_blocksize; + part->sys_ind = sys_ind; /* Tack this entry onto the list */ part->next = *list; @@ -149,7 +150,8 @@ partition_mac_lookup( const char *dev_name, prom_handle disk, part->name, /* name */ part->start_block + part->data_start, /* start */ part->data_count, /* size */ - ptable_block_size ); + ptable_block_size, + 0); } } @@ -170,14 +172,15 @@ partition_fdisk_lookup( const char *dev_name, prom_handle disk, (struct fdisk_partition *) (block_buffer + 0x1be); for (partition=1; partition <= 4 ;partition++, part++) { - if (part->sys_ind == LINUX_NATIVE) { + if (part->sys_ind == LINUX_NATIVE || part->sys_ind == LINUX_RAID) { add_new_partition( list, partition, "Linux", /* type */ '\0', /* name */ swab32(*(unsigned int *)(part->start4)), swab32(*(unsigned int *)(part->size4)), - 512 /*blksize*/ ); + 512 /*blksize*/, + part->sys_ind /* partition type */ ); } } } @@ -316,7 +319,8 @@ partition_amiga_lookup( const char *dev_name, prom_handle disk, '\0', /* name */ blockspercyl * amiga_block[AMIGA_PART_LOWCYL], /* start */ blockspercyl * (amiga_block[AMIGA_PART_HIGHCYL] - amiga_block[AMIGA_PART_LOWCYL] + 1), /* size */ - prom_blksize ); + prom_blksize, + 0 ); } } @@ -365,7 +369,8 @@ partitions_lookup(const char *device) '\0', iso_root_block, 0, - prom_blksize); + prom_blksize, + 0); prom_printf("ISO9660 disk\n"); } else if (_amiga_find_rdb(device, disk, prom_blksize) != -1) { /* amiga partition format */