diff --git a/dmraid.changes b/dmraid.changes index 4ecfd42..f454d30 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 23 15:27:07 CEST 2008 - hare@suse.de + +- Include mkinitrd scriptlets. + ------------------------------------------------------------------- Wed Mar 12 16:24:06 CET 2008 - mkoenig@suse.de diff --git a/dmraid.spec b/dmraid.spec index 5f6a8a9..c375909 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -20,11 +20,13 @@ Group: System/Base AutoReqProv: on Summary: A Device-Mapper Software RAID Support Tool Version: 1.0.0.rc14 -Release: 48 +Release: 69 Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2 Source1: sysconfig.dmraid Source2: boot.dmraid Source3: README.SuSE +Source4: mkinitrd-setup.sh +Source5: mkinitrd-boot.sh Patch0: dmraid_fixup_paths3.diff Patch1: dmraid-add_uuid.patch Patch2: dmraid_fixup_nvidia.diff @@ -101,6 +103,9 @@ mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates install -m644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dmraid mkdir -p $RPM_BUILD_ROOT/etc/init.d install -m744 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/boot.dmraid +install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts +install -m 755 %{S:4} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-dmraid.sh +install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-dmraid.sh %post %{fillup_only} @@ -120,8 +125,14 @@ install -m744 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/boot.dmraid %doc LICENSE LICENSE_GPL LICENSE_LGPL README README.SuSE TODO doc/* /var/adm/fillup-templates/sysconfig.dmraid /etc/init.d/boot.dmraid +%dir /lib/mkinitrd +%dir /lib/mkinitrd/scripts +/lib/mkinitrd/scripts/setup-dmraid.sh +/lib/mkinitrd/scripts/boot-dmraid.sh %changelog +* Wed Jul 23 2008 hare@suse.de +- Include mkinitrd scriptlets. * Wed Mar 12 2008 mkoenig@suse.de - add hack to avoid segfault with DDF1 metadata and explicit indication of the raid set [#367686] diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh new file mode 100644 index 0000000..4a1318b --- /dev/null +++ b/mkinitrd-boot.sh @@ -0,0 +1,21 @@ +#!/bin/bash +#%stage: block +#%depends: dm +#%provides: dmroot +#%programs: /sbin/dmraid +#%if: -n "$root_dmraid" +# +##### Device Mapper Raid +## +## If the root device uses a software raid based on device mapper, +## this initializes and waits for the device to appear. +## +## Command line parameters +## ----------------------- +## +## root_dmraid=1 use device mapper raid +## + +/sbin/dmraid -a y -p +wait_for_events + diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh new file mode 100644 index 0000000..7932b6c --- /dev/null +++ b/mkinitrd-setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +#%stage: devicemapper +#%provides: dmroot +# + +if [ -x /sbin/dmraid -a -x /sbin/dmsetup ] ; then + newbd= + for bd in $blockdev ; do + update_blockdev $bd + if [ $blockdriver = device-mapper ]; then + dm_uuid=$(dmsetup info -c --noheadings -o uuid -j $blockmajor -m $blockminor) + dm_creator=${dm_uuid%-*} + if [ "$dm_creator" = "dmraid" ]; then + tmp_root_dm=1 # dmraid needs dm + root_dmraid=1 + newbd="$newbd $(echo $bd | sed 's/\([a-z]\)[0-9]*$/\1/')" + else + newbd="$newbd $bd" + fi + else + newbd="$newbd $bd" + fi + done + blockdev="$newbd" +fi + +save_var root_dmraid