Accepting request 230307 from home:trenn:branches:Base:System
- 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 OBS-URL: https://build.opensuse.org/request/show/230307 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=89
This commit is contained in:
parent
87bb6a4a81
commit
54458a550b
16
cmirrord_remove_date_time_from_compilation.patch
Normal file
16
cmirrord_remove_date_time_from_compilation.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
cmirrord: Do not compile in Data and Time to avoid build retriggering in obs
|
||||||
|
|
||||||
|
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
||||||
|
|
||||||
|
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) {
|
14
lvm2.changes
14
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
|
Tue Apr 8 08:47:51 UTC 2014 - lwang@suse.com
|
||||||
|
|
||||||
|
26
lvm2.spec
26
lvm2.spec
@ -25,11 +25,11 @@ BuildRequires: libdlm-devel
|
|||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
BuildRequires: libudev-devel
|
BuildRequires: libudev-devel
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
|
BuildRequires: suse-module-tools
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: pkgconfig(udev)
|
BuildRequires: pkgconfig(udev)
|
||||||
Requires: device-mapper >= 1.02.25
|
Requires: device-mapper >= 1.02.25
|
||||||
Provides: lvm
|
Provides: lvm
|
||||||
PreReq: /sbin/mkinitrd
|
|
||||||
Version: 2.02.98
|
Version: 2.02.98
|
||||||
Release: 0.<RELEASE11>
|
Release: 0.<RELEASE11>
|
||||||
Summary: Logical Volume Manager Tools
|
Summary: Logical Volume Manager Tools
|
||||||
@ -38,8 +38,6 @@ Group: System/Base
|
|||||||
Source: ftp://sources.redhat.com/pub/%{name}/LVM2.%{version}.tgz
|
Source: ftp://sources.redhat.com/pub/%{name}/LVM2.%{version}.tgz
|
||||||
Source42: ftp://sources.redhat.com/pub/%{name}/LVM2.%{version}.tgz.asc
|
Source42: ftp://sources.redhat.com/pub/%{name}/LVM2.%{version}.tgz.asc
|
||||||
Source1: lvm.conf
|
Source1: lvm.conf
|
||||||
Source4: mkinitrd-lvm2-setup.sh
|
|
||||||
Source5: mkinitrd-lvm2-boot.sh
|
|
||||||
Source8: clvmd.ocf
|
Source8: clvmd.ocf
|
||||||
Source10: cmirrord.ocf
|
Source10: cmirrord.ocf
|
||||||
Source14: baselibs.conf
|
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
|
Patch88: clvmd-Avoid-a-3-way-deadlock-in-dead-client-cleanup.patch
|
||||||
Patch89: 0001-clvmd-avoid-logging-in-signal-handler.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
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
# Not a real replacement but we drop evms
|
# Not a real replacement but we drop evms
|
||||||
Provides: evms = 2.5.5
|
Provides: evms = 2.5.5
|
||||||
@ -153,6 +153,7 @@ Volume Manager.
|
|||||||
%patch87 -p1
|
%patch87 -p1
|
||||||
%patch88 -p1
|
%patch88 -p1
|
||||||
%patch89 -p1
|
%patch89 -p1
|
||||||
|
%patch90 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
#set path so that thin_check can be found
|
#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 -d -m 755 $RPM_BUILD_ROOT/etc/lvm/metadata
|
||||||
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/lvm
|
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/lvm
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
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: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
|
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
|
mkdir -p $RPM_BUILD_ROOT/usr/share
|
||||||
rm $RPM_BUILD_ROOT/etc/lvm/cache/.cache
|
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
|
#remove device-mapper man page
|
||||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/dm*
|
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/dm*
|
||||||
#remove device-mapper systemd events
|
#remove device-mapper systemd events
|
||||||
@ -249,16 +241,18 @@ popd
|
|||||||
|
|
||||||
%post
|
%post
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
[ -x /sbin/mkinitrd ] && /sbin/mkinitrd
|
%{?regenerate_initrd_post}
|
||||||
%service_add_post blk-availability.service lvm2-monitor.service
|
%service_add_post blk-availability.service lvm2-monitor.service
|
||||||
%service_add_post lvm2-lvmetad.socket
|
%service_add_post lvm2-lvmetad.socket
|
||||||
|
|
||||||
|
%posttrans
|
||||||
|
%{?regenerate_initrd_posttrans}
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%service_del_preun blk-availability.service lvm2-monitor.service lvm2-lvmetad.service lvm2-lvmetad.socket
|
%service_del_preun blk-availability.service lvm2-monitor.service lvm2-lvmetad.service lvm2-lvmetad.socket
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
[ -x /sbin/mkinitrd ] && /sbin/mkinitrd
|
|
||||||
%service_del_postun lvm2-lvmetad.service
|
%service_del_postun lvm2-lvmetad.service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -268,8 +262,6 @@ popd
|
|||||||
%dir /etc/lvm/backup
|
%dir /etc/lvm/backup
|
||||||
%dir /etc/lvm/archive
|
%dir /etc/lvm/archive
|
||||||
%dir /etc/lvm/metadata
|
%dir /etc/lvm/metadata
|
||||||
%dir /lib/mkinitrd
|
|
||||||
%dir /lib/mkinitrd/scripts
|
|
||||||
%{_udevdir}/rules.d/11-dm-lvm.rules
|
%{_udevdir}/rules.d/11-dm-lvm.rules
|
||||||
%{_udevdir}/rules.d/69-dm-lvm-metad.rules
|
%{_udevdir}/rules.d/69-dm-lvm-metad.rules
|
||||||
%{_unitdir}/blk-availability.service
|
%{_unitdir}/blk-availability.service
|
||||||
@ -278,8 +270,6 @@ popd
|
|||||||
%{_unitdir}/lvm2-lvmetad.service
|
%{_unitdir}/lvm2-lvmetad.service
|
||||||
%{_tmpfilesdir}/lvm2.conf
|
%{_tmpfilesdir}/lvm2.conf
|
||||||
%config /etc/lvm/lvm.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
|
/usr/lib/systemd/system-generators/lvm2-activation-generator
|
||||||
/sbin/blkdeactivate
|
/sbin/blkdeactivate
|
||||||
/sbin/fsadm
|
/sbin/fsadm
|
||||||
|
@ -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
|
|
@ -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
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user