From a74004abdbfcf3833fb6610c96ab66f85f1eeaf32c2fc0e2d9a857192630e841 Mon Sep 17 00:00:00 2001 From: Gang He Date: Thu, 22 Apr 2021 03:19:47 +0000 Subject: [PATCH] Accepting request 887391 from home:hmzhao:branches:openSUSE:Factory - LVM cannot be disabled on boot (bsc#1184687) + bug-1184687_Add-nolvm-for-kernel-cmdline.patch - Update patch for avoiding apply warning message + bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch OBS-URL: https://build.opensuse.org/request/show/887391 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=295 --- ...al-case-for-md-in-69-dm-lvm-metadata.patch | 2 +- ...1184687_Add-nolvm-for-kernel-cmdline.patch | 47 +++++++++++++++++++ lvm2.changes | 9 ++++ lvm2.spec | 4 +- 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 bug-1184687_Add-nolvm-for-kernel-cmdline.patch diff --git a/bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch b/bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch index 1f6bf19..8f3d13f 100644 --- a/bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch +++ b/bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch @@ -36,7 +36,7 @@ diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in index bd75fc8efcd5..fcbb7f755eba 100644 --- a/udev/69-dm-lvm-metad.rules.in +++ b/udev/69-dm-lvm-metad.rules.in -@@ -51,13 +51,11 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan" +@@ -54,13 +54,11 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan" GOTO="lvm_end" # MD device: diff --git a/bug-1184687_Add-nolvm-for-kernel-cmdline.patch b/bug-1184687_Add-nolvm-for-kernel-cmdline.patch new file mode 100644 index 0000000..70a9e2b --- /dev/null +++ b/bug-1184687_Add-nolvm-for-kernel-cmdline.patch @@ -0,0 +1,47 @@ +From 6ebef9ad80ee156285a61d413b5265de9c0aa2ae Mon Sep 17 00:00:00 2001 +From: Heming Zhao +Date: Wed, 21 Apr 2021 11:17:36 +0800 +Subject: [PATCH] Add "nolvm" for kernel cmdline + +This patch is inspried by multipath patch cd3184e107c8 ("Add +support for "multipath=off" and "nompath" on kernel cmdline") + +This new item for disabling lvm2 startup from kernel command +line. One of usecases is in rescue mode, disabling lvm2 will +allow user to enable lvm2 devices by manual. + +Signed-off-by: Heming Zhao +--- + scripts/lvm2-pvscan.service.in | 1 + + udev/69-dm-lvm-metad.rules.in | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/scripts/lvm2-pvscan.service.in b/scripts/lvm2-pvscan.service.in +index 09753e8c9ef1..1977e4e215fb 100644 +--- a/scripts/lvm2-pvscan.service.in ++++ b/scripts/lvm2-pvscan.service.in +@@ -7,6 +7,7 @@ BindsTo=dev-block-%i.device + After=multipathd.service + Before=shutdown.target + Conflicts=shutdown.target ++ConditionKernelCommandLine=!nolvm + + [Service] + Type=oneshot +diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in +index 78f506520c45..16e8536e8a2a 100644 +--- a/udev/69-dm-lvm-metad.rules.in ++++ b/udev/69-dm-lvm-metad.rules.in +@@ -19,6 +19,9 @@ SUBSYSTEM!="block", GOTO="lvm_end" + + ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end" + ++IMPORT{cmdline}="nolvm" ++ENV{nolvm}=="?*", GOTO="lvm_end" ++ + # If the PV label got lost, inform lvmetad immediately. + # Detect the lost PV label by comparing previous ID_FS_TYPE value with current one. + ENV{.ID_FS_TYPE_NEW}="$env{ID_FS_TYPE}" +-- +1.8.3.1 + diff --git a/lvm2.changes b/lvm2.changes index c18c42d..09c3eec 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Apr 21 03:04:00 UTC 2021 - heming.zhao@suse.com + +- LVM cannot be disabled on boot (bsc#1184687) + + bug-1184687_Add-nolvm-for-kernel-cmdline.patch + +- Update patch for avoiding apply warning message + + bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch + ------------------------------------------------------------------- Mon Apr 19 10:00:30 UTC 2021 - ghe@suse.com diff --git a/lvm2.spec b/lvm2.spec index 95045fd..056431f 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -1,7 +1,7 @@ # # spec file for package lvm2 # -# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -73,6 +73,7 @@ Patch1003: fate-31841_fsadm-add-support-for-btrfs.patch Patch1004: bug-935623_dmeventd-fix-dso-name-wrong-compare.patch Patch1005: bug-998893_make_pvscan_service_after_multipathd.patch Patch1006: bug-1179691_config-set-external_device_info_source-none.patch +Patch1007: bug-1184687_Add-nolvm-for-kernel-cmdline.patch # SUSE patches 2000+ for device mapper, udev rules Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch # SUSE patches 3000+ for test code @@ -131,6 +132,7 @@ Volume Manager. %patch1004 -p1 %patch1005 -p1 %patch1006 -p1 +%patch1007 -p1 %patch2001 -p1 %if !%{with lockd}