[Fwd: PATCH - enables software RAID on Linux]
Benjamin Herrenschmidt
benh at kernel.crashing.org
Mon May 9 09:09:08 EST 2005
-------- Forwarded Message --------
From: Dustin Kirkland <dustin.kirkland at us.ibm.com>
Reply-To: dustin.kirkland at us.ibm.com
To: yaboot-devel at lists.penguinppc.org
Cc: dustin.kirkland at us.ibm.com
Subject: PATCH - enables software RAID on Linux
Date: Fri, 06 May 2005 10:17:42 -0400
Hi-
I've made a few minor changes to yaboot that provides support for
software RAID on Linux. Many thanks to Paul Nasrat who provided key
assistance.
The basic changes that were needed in yaboot:
1) the ability to read partitions marked "Linux RAID" (0xfd) in addition
to regular "Linux" filesystem partitions when looking
for /etc/yaboot.conf
2) the additional protection to prevent of_open() from reading Linux
RAID partitions (such as RAID swap space)
3) new functionality in ybin to automatically write yaboot to multiple
available PReP partitions (so that you can boot from multiple discs)
--
#1 is accomplished by adding a LINUX_RAID macro in include/fdisk-part.h
and allowing such partitions to be added to the partition_t list in
partition_fdisk_lookup().
#2 means that the partition_t structure needs a new integer field
(sys_ind) to hold the partition type, and the add_new_partition()
function needs to pass this information when called. Then, the of_open
() simply needs to test against part->sys_ind against the LINUX_RAID
value before allowing an ok return.
#3 is solved via recursion. ybin is augmented such that it will look
for any PReP partitions available on the system and will recursively
call itself targeting each individual PReP partition. The user will be
prompted for each partition in the default interactive mode, and yaboot
will be written to all PReP partitions in --force mode. As I've coded
it here, it depends on fdisk/awk/xargs. I found uses of grep elsewhere
in the script so I figured this should be legit.
Please see the attached patch and consider for inclusion in subsequent
yaboot releases.
--
Benjamin Herrenschmidt <benh at kernel.crashing.org>
More information about the Linuxppc64-dev
mailing list