diff --git a/dmraid.changes b/dmraid.changes index d50df9f..f8552b8 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 13 17:08:35 UTC 2014 - trenn@suse.de + +- Use rpm macros to only trigger one initrd rebuild per install/update + ------------------------------------------------------------------- Wed May 21 09:40:42 UTC 2014 - jsegitz@novell.com diff --git a/dmraid.spec b/dmraid.spec index 82f811d..51b7a47 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -21,8 +21,10 @@ BuildRequires: autoconf BuildRequires: automake BuildRequires: device-mapper-devel BuildRequires: libselinux-devel +BuildRequires: suse-module-tools BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel + Requires: aaa_base Requires: kpartx Url: http://people.redhat.com/~heinzm/sw/dmraid/src/ @@ -34,8 +36,6 @@ Release: 0 Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2 Source1: sysconfig.dmraid Source3: README.SuSE -Source4: mkinitrd-setup.sh -Source5: mkinitrd-boot.sh Source6: dmraid-activation.service Patch1: dmraid-1.0.0.rc16-cvs-2010-02-02.patch Patch2: dmraid-1.0.0.rc13-geometry.patch @@ -108,9 +108,6 @@ rm $RPM_BUILD_ROOT/%_lib/libdmraid.so 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 -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 install -D -m 0644 %{S:6} %{buildroot}%{_unitdir}/dmraid-activation.service install -d %{buildroot}%{_tmpfilesdir} echo 'd /run/lock/dmraid 0700 root root -' > %{buildroot}%{_tmpfilesdir}/dmraid.conf @@ -124,13 +121,17 @@ echo 'd /run/lock/dmraid 0700 root root -' > %{buildroot}%{_tmpfilesdir}/dmraid. %post /sbin/ldconfig %service_add_post dmraid-activation.service -[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup +%{?regenerate_initrd_post} + +%posttrans +%{?regenerate_initrd_posttrans} + %{fillup_only} %postun /sbin/ldconfig %service_del_postun dmraid-activation.service -[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup + %{insserv_cleanup} %files @@ -140,10 +141,6 @@ echo 'd /run/lock/dmraid 0700 root root -' > %{buildroot}%{_tmpfilesdir}/dmraid. %{_mandir}/man8/* %doc LICENSE LICENSE_GPL LICENSE_LGPL README README.SuSE TODO doc/* /var/adm/fillup-templates/sysconfig.dmraid -%dir /lib/mkinitrd -%dir /lib/mkinitrd/scripts -/lib/mkinitrd/scripts/setup-dmraid.sh -/lib/mkinitrd/scripts/boot-dmraid.sh /%{_lib}/libdmraid-events-isw.so /%{_lib}/libdmraid.so.1.0.0.rc16-3 %{_tmpfilesdir}/dmraid.conf diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh deleted file mode 100644 index abc9b7f..0000000 --- a/mkinitrd-boot.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -#%stage: block -#%depends: dm -#%provides: dmroot -#%programs: dmraid -#%programs: mkdir -#%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 -## - -[ -d /run/lock ] || mkdir -p /run/lock >/dev/null 2>&1 -dmraid -a y -p -wait_for_events - diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh deleted file mode 100644 index 117ae3d..0000000 --- a/mkinitrd-setup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -#%stage: devicemapper -#%provides: dmroot -# - -if [ -x "$(type -p 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