diff --git a/cmirrord_remove_date_time_from_compilation.patch b/cmirrord_remove_date_time_from_compilation.patch new file mode 100644 index 0000000..b4c1614 --- /dev/null +++ b/cmirrord_remove_date_time_from_compilation.patch @@ -0,0 +1,16 @@ +cmirrord: Do not compile in Data and Time to avoid build retriggering in obs + +Signed-off-by: Thomas Renninger + +Index: LVM2.2.02.98/daemons/cmirrord/clogd.c +=================================================================== +--- LVM2.2.02.98.orig/daemons/cmirrord/clogd.c ++++ LVM2.2.02.98/daemons/cmirrord/clogd.c +@@ -42,7 +42,6 @@ int main(int argc __attribute__((unused) + kill(getppid(), SIGTERM); + + LOG_PRINT("Starting cmirrord:"); +- LOG_PRINT(" Built: "__DATE__" "__TIME__"\n"); + LOG_DBG(" Compiled with debugging."); + + while (!exit_now) { diff --git a/lvm2.changes b/lvm2.changes index 5a38a31..cf77a26 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed Apr 16 09:11:32 UTC 2014 - trenn@suse.de + +- Switch from mkinitrd to dracut + - Dracut already has a lvm module and takes care that the right stuff is + include into initrd, therefore remove: + - mkinitrd-lvm2-boot.sh + - mkinitrd-lvm2-setup.sh + mkinitrd scripts from sources + - Add dracut macros in %post and %posttrans to ensure initrd recreation +- Remove unneeded comments in .spec file +- Do not compile in DATE and TIME to avoid build unneeded retriggering in obs + Add: cmirrord_remove_date_time_from_compilation.patch + ------------------------------------------------------------------- Tue Apr 8 08:47:51 UTC 2014 - lwang@suse.com diff --git a/lvm2.spec b/lvm2.spec index 281108e..bdf284a 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -25,11 +25,11 @@ BuildRequires: libdlm-devel BuildRequires: libselinux-devel BuildRequires: libudev-devel BuildRequires: readline-devel +BuildRequires: suse-module-tools BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(udev) Requires: device-mapper >= 1.02.25 Provides: lvm -PreReq: /sbin/mkinitrd Version: 2.02.98 Release: 0. Summary: Logical Volume Manager Tools @@ -38,8 +38,6 @@ Group: System/Base Source: ftp://sources.redhat.com/pub/%{name}/LVM2.%{version}.tgz Source42: ftp://sources.redhat.com/pub/%{name}/LVM2.%{version}.tgz.asc Source1: lvm.conf -Source4: mkinitrd-lvm2-setup.sh -Source5: mkinitrd-lvm2-boot.sh Source8: clvmd.ocf Source10: cmirrord.ocf Source14: baselibs.conf @@ -100,6 +98,8 @@ Patch87: clvmd-Fix-node-up-down-handing-in-corosync-module.patch Patch88: clvmd-Avoid-a-3-way-deadlock-in-dead-client-cleanup.patch Patch89: 0001-clvmd-avoid-logging-in-signal-handler.patch +# Never upstream +Patch90: cmirrord_remove_date_time_from_compilation.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Not a real replacement but we drop evms Provides: evms = 2.5.5 @@ -153,6 +153,7 @@ Volume Manager. %patch87 -p1 %patch88 -p1 %patch89 -p1 +%patch90 -p1 %build #set path so that thin_check can be found @@ -193,10 +194,6 @@ install -d -m 755 $RPM_BUILD_ROOT/etc/lvm/archive install -d -m 755 $RPM_BUILD_ROOT/etc/lvm/metadata install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/lvm mkdir -p $RPM_BUILD_ROOT/etc/init.d -#install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d -install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts -install -m 755 %{SOURCE4} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-lvm2.sh -install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-lvm2.sh install -m755 -D %{S:8} $RPM_BUILD_ROOT/usr/lib/ocf/resource.d/lvm2/clvmd install -m755 -D %{S:10} $RPM_BUILD_ROOT/usr/lib/ocf/resource.d/lvm2/cmirrord @@ -227,11 +224,6 @@ mv $RPM_BUILD_ROOT/sbin/cmirrord $RPM_BUILD_ROOT/usr/sbin/cmirrord mkdir -p $RPM_BUILD_ROOT/usr/share rm $RPM_BUILD_ROOT/etc/lvm/cache/.cache -# these files are put into their own devel package -##remove lvm-devel parts -#rm -f $RPM_BUILD_ROOT/usr/include/lvm2cmd.h -#rm -f $RPM_BUILD_ROOT/usr/include/lvm2app.h -#rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/lvm2app.pc #remove device-mapper man page rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/dm* #remove device-mapper systemd events @@ -249,16 +241,18 @@ popd %post /sbin/ldconfig -[ -x /sbin/mkinitrd ] && /sbin/mkinitrd +%{?regenerate_initrd_post} %service_add_post blk-availability.service lvm2-monitor.service %service_add_post lvm2-lvmetad.socket +%posttrans +%{?regenerate_initrd_posttrans} + %preun %service_del_preun blk-availability.service lvm2-monitor.service lvm2-lvmetad.service lvm2-lvmetad.socket %postun /sbin/ldconfig -[ -x /sbin/mkinitrd ] && /sbin/mkinitrd %service_del_postun lvm2-lvmetad.service %files @@ -268,8 +262,6 @@ popd %dir /etc/lvm/backup %dir /etc/lvm/archive %dir /etc/lvm/metadata -%dir /lib/mkinitrd -%dir /lib/mkinitrd/scripts %{_udevdir}/rules.d/11-dm-lvm.rules %{_udevdir}/rules.d/69-dm-lvm-metad.rules %{_unitdir}/blk-availability.service @@ -278,8 +270,6 @@ popd %{_unitdir}/lvm2-lvmetad.service %{_tmpfilesdir}/lvm2.conf %config /etc/lvm/lvm.conf -/lib/mkinitrd/scripts/setup-lvm2.sh -/lib/mkinitrd/scripts/boot-lvm2.sh /usr/lib/systemd/system-generators/lvm2-activation-generator /sbin/blkdeactivate /sbin/fsadm diff --git a/mkinitrd-lvm2-boot.sh b/mkinitrd-lvm2-boot.sh deleted file mode 100644 index c1e11ef..0000000 --- a/mkinitrd-lvm2-boot.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -#%stage: volumemanager -#%depends: evms -#%programs: vgscan vgchange lvm -#%programs: sed -#%modules: linear -#%if: -n "$root_lvm2" -# -##### LVM (Logical Volume Management) -## -## This activates and waits for an LVM. -## -## Command line parameters -## ----------------------- -## -## root_lvm2=1 use LVM -## root=/dev/mapper/... use this device as Volume Group -## vg_roots use this group as Volume Group -## - -lvm2_get_vg() { - local param=$1 - local vg_root vg_name - local sysdev - - case $param in - /dev/disk/by-*/*) - vg_root= - ;; - /dev/mapper/*) - vg_name=${o##root=/dev/mapper/} - vg_root=${vg_name%%-*} - ;; - /dev/*) - set -- $(IFS=/ ; echo $param) - if [ "$#" = "3" ] ; then - # Check sysfs. If there are subdirectories - # matching this name it's a block device - for d in /sys/block/$2\!* ; do - if [ -d $d ] ; then - sysdev=$d - fi - done - # Not found in sysfs, looks like a VG then - if [ -z "$sysdev" ] ; then - vg_root=$2 - fi - fi - ;; - esac - - echo $vg_root -} - -# load the necessary module before we initialize the raid system -load_modules - -if [ -n "$root_lvm2" ] ; then - o=$(get_param root) - # Fallback if 'root=' is not specified - [ -z "$o" ] && o=$rootdev - vg_root=$(lvm2_get_vg $o) - if [ "$vg_root" ] ; then - # We are waiting for a device-mapper device - root_major=$(sed -n 's/\(.*\) device-mapper/\1/p' /proc/devices) - fi - o=$(get_param resume) - vg_resume=$(lvm2_get_vg $o) - if [ "$vg_resume" ] ; then - resume_major=$(sed -n 's/\(.*\) device-mapper/\1/p' /proc/devices) - fi -fi - -# initialize remebered and parameterized devices -for vgr in $vg_root $vg_resume $vg_roots; do - vgchange -a y $vgr -done - -unset lvm2_get_vg diff --git a/mkinitrd-lvm2-setup.sh b/mkinitrd-lvm2-setup.sh deleted file mode 100644 index 9df4880..0000000 --- a/mkinitrd-lvm2-setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -#%stage: volumemanager -#%depends: evms -# -# get information about the current blockdev -update_blockdev - -# Check whether we are using LVM2 (only available when not using EVMS) -if [ -z "$root_evms" ] && [ -x "$(type -p lvdisplay)" ] ; then - lvm_blockdev= - - for bd in $blockdev; do - update_blockdev $bd - - vg_name=$(lvdisplay -c 2> /dev/null | sed -n "/:${blockmajor}:${blockminor}$/p") - vg_dev=${vg_name%%:*} - vg_name=${vg_name#*:} - vg_root=${vg_name%%:*} - if [ "$vg_root" ] ; then - local vg_blockdev - root_lvm2=1 - realrootdev=${vg_dev## } - vg_blockdev=$(vgs --noheadings --options pv_name $vg_root 2> /dev/null | sed "s@,@\n@g" | sed "s@([0-9]*)@@g;s@ @@g" | sort | uniq) - lvm_blockdev="$lvm_blockdev $vg_blockdev" - [ $? -eq 0 ] || return 1 - vg_roots="$vg_roots $vg_root" - else - lvm_blockdev="$lvm_blockdev $bd" - fi - done - blockdev="$lvm_blockdev" -fi - -if use_script lvm2; then - tmp_root_dm=1 # lvm needs dm - mkdir -p $tmp_mnt/etc/lvm - mkdir -p $tmp_mnt/var/lock/lvm - cp -a /etc/lvm/lvm.conf $tmp_mnt/etc/lvm/ -# udev rule for lvm2 - mkdir -p $tmp_mnt/usr/lib/udev/rules.d - cp /usr/lib/udev/rules.d/11-dm-lvm.rules $tmp_mnt/usr/lib/udev/rules.d/ -fi - -save_var root_lvm2 -save_var vg_roots -