diff options
author | CoprDistGit <infra@openeuler.org> | 2023-09-19 03:22:19 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-09-19 03:22:19 +0000 |
commit | bb2d27c6843d99793e50a67e20e64852c3dd4d85 (patch) | |
tree | 74f3f8647e43cc7f39873fb2ba713cebe9862c1d /backport-revert-lvm-remove-snapshot-feature.patch | |
parent | ff3056a5eddb9b203fdd900eeecc0771d981d138 (diff) |
automatic import of dracutopeneuler20.03
Diffstat (limited to 'backport-revert-lvm-remove-snapshot-feature.patch')
-rw-r--r-- | backport-revert-lvm-remove-snapshot-feature.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/backport-revert-lvm-remove-snapshot-feature.patch b/backport-revert-lvm-remove-snapshot-feature.patch new file mode 100644 index 0000000..bba82e5 --- /dev/null +++ b/backport-revert-lvm-remove-snapshot-feature.patch @@ -0,0 +1,79 @@ +From 1549d5e89818603e1aa6dd8a40981222f59f1548 Mon Sep 17 00:00:00 2001 +From: David Teigland <teigland@redhat.com> +Date: Wed, 8 Dec 2021 14:04:25 -0600 +Subject: [PATCH] revert(lvm): remove snapshot feature + +The feature of managing lvm snapshots has no known +recent usage. It is unknown if it works. The lvm +developers do not wish to maintain or support it. +--- + modules.d/90lvm/lvm_scan.sh | 39 ++++----------------------------------- + 1 file changed, 4 insertions(+), 35 deletions(-) + +diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh +index c42f97d..43601ad 100755 +--- a/modules.d/90lvm/lvm_scan.sh ++++ b/modules.d/90lvm/lvm_scan.sh +@@ -7,8 +7,6 @@ type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh + + VGS=$(getargs rd.lvm.vg -d rd_LVM_VG=) + LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=) +-SNAPSHOT=$(getargs rd.lvm.snapshot -d rd_LVM_SNAPSHOT=) +-SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=) + + # shellcheck disable=SC2174 + [ -d /etc/lvm ] || mkdir -m 0755 -p /etc/lvm +@@ -31,17 +29,10 @@ if [ ! -e /etc/lvm/lvm.conf ]; then + echo '}' + + # establish LVM locking +- if [ -n "$SNAPSHOT" ]; then +- echo 'global {' +- echo ' locking_type = 1' +- echo ' use_lvmetad = 0' +- echo '}' +- else +- echo 'global {' +- echo ' locking_type = 4' +- echo ' use_lvmetad = 0' +- echo '}' +- fi ++ echo 'global {' ++ echo ' locking_type = 4' ++ echo ' use_lvmetad = 0' ++ echo '}' + } > /etc/lvm/lvm.conf + lvmwritten=1 + fi +@@ -90,28 +81,6 @@ unset extraargs + + export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 + +-if [ -n "$SNAPSHOT" ]; then +- # HACK - this should probably be done elsewhere or turned into a function +- # Enable read-write LVM locking +- sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' /etc/lvm/lvm.conf +- +- # Expected SNAPSHOT format "<orig lv name>:<snap lv name>" +- ORIG_LV=${SNAPSHOT%%:*} +- SNAP_LV=${SNAPSHOT##*:} +- +- info "Removing existing LVM snapshot $SNAP_LV" +- lvm lvremove --force "$SNAP_LV" 2>&1 | vinfo +- +- # Determine snapshot size +- if [ -z "$SNAPSIZE" ]; then +- SNAPSIZE=$(lvm lvs --noheadings --units m --options lv_size "$ORIG_LV") +- info "No LVM snapshot size provided, using size of $ORIG_LV ($SNAPSIZE)" +- fi +- +- info "Creating LVM snapshot $SNAP_LV ($SNAPSIZE)" +- lvm lvcreate -s -n "$SNAP_LV" -L "$SNAPSIZE" "$ORIG_LV" 2>&1 | vinfo +-fi +- + if [ -n "$LVS" ]; then + info "Scanning devices $lvmdevs for LVM logical volumes $LVS" + lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo +-- +1.8.3.1 + |