[oe-commits] org.oe.dev SlugOS 5.0: enable mdraid support
mwester commit
oe at amethyst.openembedded.net
Mon Sep 1 18:32:42 UTC 2008
SlugOS 5.0: enable mdraid support
Author: mwester at openembedded.org
Branch: org.openembedded.dev
Revision: cdd9d1c543126b02dd14925c940ec6a31e071be8
ViewMTN: http://monotone.openembedded.org/revision/info/cdd9d1c543126b02dd14925c940ec6a31e071be8
Files:
1
packages/slugos-init/files/boot/disk
packages/slugos-init/files/turnup
packages/slugos-init/slugos-init_5.0.bb
Diffs:
#
# mt diff -red7957694af0bb71fe8fed5d58f80f1442a53d03 -rcdd9d1c543126b02dd14925c940ec6a31e071be8
#
#
#
# patch "packages/slugos-init/files/boot/disk"
# from [2812a8e183761c88f764ab143d6e65cf1bfc8290]
# to [0200f93a1bfe7463dd853dc483839fa8d9e82468]
#
# patch "packages/slugos-init/files/turnup"
# from [d94a8247eae67fe247bce151f90da0b92e8c9617]
# to [6e17652b7fc5d80ed745149b022f480d3e06c35c]
#
# patch "packages/slugos-init/slugos-init_5.0.bb"
# from [9a455a4cc8bd81f72ac4bedd0d75467081204750]
# to [f1d83bb6efd47859e2fa618a8f46c7956a5305a5]
#
============================================================
--- packages/slugos-init/files/boot/disk 2812a8e183761c88f764ab143d6e65cf1bfc8290
+++ packages/slugos-init/files/boot/disk 0200f93a1bfe7463dd853dc483839fa8d9e82468
@@ -24,9 +24,21 @@ then
# waiting for disk
if test "$sleep" -gt 0
then
- echo "Waiting $sleep seconds for disk"
+ echo "boot: waiting $sleep seconds for disk"
sleep "$sleep"
fi
+ # Attempt to assemble the RAID if necessary
+ if (echo $device | grep -q "^/dev/md")
+ then
+ if test -n "$MDUUID"
+ then
+ echo "boot: assembling RAID array (UUID)"
+ mdadm -Acpartitions --auto=md --uuid="$MDUUID" $device
+ else
+ echo "boot: assembling RAID array (config file)"
+ mdadm -As --auto=md $device
+ fi
+ fi
#
# fire the boot
echo "boot: rootfs: mount $* $device [$UUID]"
============================================================
--- packages/slugos-init/files/turnup d94a8247eae67fe247bce151f90da0b92e8c9617
+++ packages/slugos-init/files/turnup 6e17652b7fc5d80ed745149b022f480d3e06c35c
@@ -274,7 +274,13 @@ setup_dev() {
# /dev/null
# syslog, and maybe other things, only work if fd 1 is valid, therefore
# we must create these devices here...
- makedevs --root="$1" --devtable="$2"
+ # (if makedevs is a symlink, it's the busybox version, different syntax)
+ if [ -h /sbin/makedevs ]
+ then
+ makedevs -d "$2" "$1"
+ else
+ makedevs --root="$1" --devtable="$2"
+ fi
:>"$1"/dev/.noram
return 0
}
@@ -290,7 +296,13 @@ setup_bootdev() {
}
# NOTE: this fails silently with 0 return code(!) when a directory
# does not exist yet things are created within it.
- makedevs -r "$1" -D "$2"
+ # (if makedevs is a symlink, it's the busybox version, different syntax)
+ if [ -h /sbin/makedevs ]
+ then
+ makedevs -d "$2" "$1"
+ else
+ makedevs -r "$1" -D "$2"
+ fi
}
#
@@ -432,6 +444,7 @@ boot_rootfs() {
sleep="$3"
device="$4"
uuid=
+ mduuid=
# test this first as the test does not depend on the correctness
# of the other arguments
@@ -452,6 +465,11 @@ boot_rootfs() {
return 1
}
uuid="$3"
+ if (echo "$device" | grep -q '^/dev/md')
+ then
+ # FIXME: should use awk to do the below extraction
+ mduuid=`mdadm --detail --brief "$device" | sed 's/^.*UUID=//'`
+ fi
shift 3;;
nfs) shift 2;;
flash) ;;
@@ -493,6 +511,7 @@ boot_rootfs() {
echo 'leds beep'
test "$sleep" -gt 0 && echo -n "sleep='$sleep' "
test -n "$uuid" && echo -n "UUID='$uuid' "
+ test -n "$mduuid" && echo -n "MDUUID='$mduuid' "
echo -n "exec '/boot/$type' '$device'"
for opt in "$@"
do
============================================================
--- packages/slugos-init/slugos-init_5.0.bb 9a455a4cc8bd81f72ac4bedd0d75467081204750
+++ packages/slugos-init/slugos-init_5.0.bb f1d83bb6efd47859e2fa618a8f46c7956a5305a5
@@ -4,7 +4,7 @@ RDEPENDS = "busybox devio"
LICENSE = "GPL"
DEPENDS = "base-files devio"
RDEPENDS = "busybox devio"
-PR = "r1.2"
+PR = "r2"
SRC_URI = "file://boot/flash \
file://boot/disk \
More information about the Openembedded-commits
mailing list