From e219f69baa69bf2eb5ca22280076f2ba7a604880 Mon Sep 17 00:00:00 2001 From: Danny Rawlins Date: Tue, 29 Apr 2008 11:03:11 +1000 Subject: [PATCH] lvm2: update patch to rc files (thanks denis yantarev) add readme and patch auto add/remove renamed and updated patch rc.diff -> rc.diff --- lvm2/README | 27 +++++++++++++++++++++++++++ lvm2/lvm2-rc.patch | 29 +++++++++++++++++++++++++++++ lvm2/post-install | 11 +++++++++++ lvm2/pre-remove | 11 +++++++++++ lvm2/rc.diff | 26 -------------------------- 5 files changed, 78 insertions(+), 26 deletions(-) create mode 100644 lvm2/README create mode 100644 lvm2/lvm2-rc.patch create mode 100755 lvm2/post-install create mode 100755 lvm2/pre-remove delete mode 100644 lvm2/rc.diff diff --git a/lvm2/README b/lvm2/README new file mode 100644 index 000000000..af3276914 --- /dev/null +++ b/lvm2/README @@ -0,0 +1,27 @@ +REQUIREMENTS: + + Patched core/rc package. + +PRECAUTION: + + Don't forget to run install scripts or patch rc manually + with: + + # patch -p 1 lvm2-rc.patch + +PRE-INSTALL: + +POST-INSTALL: + + This patches rc scripts for LVM2 support. + +PRE-REMOVE: + + This reverses the LVM2 rc scripts patch. + +POST-REMOVE: + +NOTES: + + post-install and pre-remove will only patch if there is + no errors on a patch dry run. diff --git a/lvm2/lvm2-rc.patch b/lvm2/lvm2-rc.patch new file mode 100644 index 000000000..267bb3703 --- /dev/null +++ b/lvm2/lvm2-rc.patch @@ -0,0 +1,29 @@ +diff -pruN pkg.orig/etc/rc pkg/etc/rc +--- pkg.orig/etc/rc 2008-04-29 10:01:50.996260068 +1000 ++++ pkg/etc/rc 2008-04-29 10:02:17.184261912 +1000 +@@ -13,6 +13,13 @@ echo "The system is coming up. Please w + /bin/mount -n -t sysfs none /sys + /sbin/start_udev + ++# Create device-mapper device nodes ++/sbin/dmsetup mknodes ++ ++# Scan for LVM volume groups ++/sbin/vgscan --ignorelockingfailure ++/sbin/vgchange --ignorelockingfailure -a y ++ + # Mount root read-only + /bin/mount -n -o remount,ro / + +diff -pruN pkg.orig/etc/rc.shutdown pkg/etc/rc.shutdown +--- pkg.orig/etc/rc.shutdown 2008-04-29 10:01:50.996260068 +1000 ++++ pkg/etc/rc.shutdown 2008-04-29 10:02:37.018264223 +1000 +@@ -43,6 +43,8 @@ fi + /sbin/swapoff -a + + # Unmount file systems ++/bin/umount -a -r -t nosysfs,noproc ++/sbin/vgchange --ignorelockingfailure -a n + /bin/umount -a -r + + # Remount root filesystem read-only diff --git a/lvm2/post-install b/lvm2/post-install new file mode 100755 index 000000000..0e4d20738 --- /dev/null +++ b/lvm2/post-install @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +# dry run test +/usr/bin/patch --dry-run -f -p 1 -i lvm2-rc.patch > /dev/null + +# patch if no errors +if [ $? = 0 ]; then + /usr/bin/patch -p 1 -i lvm2-rc.patch +fi + +# End of file diff --git a/lvm2/pre-remove b/lvm2/pre-remove new file mode 100755 index 000000000..c250c98b0 --- /dev/null +++ b/lvm2/pre-remove @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +# dry run test +/usr/bin/patch --dry-run -f -R -p 1 -i lvm2-rc.patch > /dev/null + +# reverse patch if no errors +if [ $? = 0 ]; then + /usr/bin/patch -R -p 1 -i lvm2-rc.patch +fi + +# End of file diff --git a/lvm2/rc.diff b/lvm2/rc.diff deleted file mode 100644 index ad2424b24..000000000 --- a/lvm2/rc.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- /etc/rc.orig -+++ /etc/rc -@@ -13,6 +13,13 @@ - /bin/mount -n -t sysfs none /sys - /sbin/start_udev - -+# Create device-mapper device nodes -+/sbin/dmsetup mknodes -+ -+# Scan for LVM volume groups -+/sbin/vgscan --ignorelockingfailure -+/sbin/vgchange --ignorelockingfailure -a y -+ - # Mount root read-only - /bin/mount -n -o remount,ro / - ---- /etc/rc.shutdown.orig -+++ /etc/rc.shutdown -@@ -44,6 +44,7 @@ - - # Unmount file systems - /bin/umount -a -r -+/sbin/vgchange -a n - - # Remount root filesystem read-only - /bin/mount -n -o remount,ro /