From 19a5fe4d94b66d9fb70234f1d684396afa8f0b48 Mon Sep 17 00:00:00 2001 From: Pavel Cahyna Date: Sun, 15 Jan 2023 08:43:51 +0100 Subject: [PATCH] Apply upstream PR #2903 Resolves: rhbz2160749 --- rear-bz2091163.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++ rear.spec | 1 + 2 files changed, 47 insertions(+) create mode 100644 rear-bz2091163.patch diff --git a/rear-bz2091163.patch b/rear-bz2091163.patch new file mode 100644 index 0000000..3a68a34 --- /dev/null +++ b/rear-bz2091163.patch @@ -0,0 +1,46 @@ +diff --git a/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh b/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh +index d3c9ae86..f21845df 100644 +--- a/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh ++++ b/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh +@@ -70,14 +70,20 @@ local lvs_exit_code + # Get physical_device configuration. + # Format: lvmdev [] [] + header_printed="no" +- # Example output of "lvm pvdisplay -c": +- # /dev/sda1:system:41940992:-1:8:8:-1:4096:5119:2:5117:7wwpcO-KmNN-qsTE-7sp7-JBJS-vBdC-Zyt1W7 ++ # Set pvdisplay separator to '|' to prevent issues with a colon in the path under /dev/disk/by-path ++ # that contains a ':' in the SCSI slot name. ++ # Example output of "lvm pvdisplay -C --separator '|' --noheadings --nosuffix --units=b -o pv_name,vg_name,pv_size,pv_uuid" ++ # on a system where LVM is configured to show the /dev/disk/by-path device names instead of the usual ++ # /dev/sda etc. (by using a setting like ++ # filter = [ "r|/dev/disk/by-path/.*-usb-|", "a|/dev/disk/by-path/pci-.*-nvme-|", "a|/dev/disk/by-path/pci-.*-scsi-|", "a|/dev/disk/by-path/pci-.*-ata-|", "a|/dev/disk/by-path/pci-.*-sas-|", "a|loop|", "r|.*|" ] ++ # in /etc/lvm/lvm.conf): ++ # /dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:1:0-part1|system|107340627968|7wwpcO-KmNN-qsTE-7sp7-JBJS-vBdC-Zyt1W7 + # There are two leading blanks in the output (at least on SLES12-SP4 with LVM 2.02.180). +- lvm pvdisplay -c | while read line ; do ++ lvm pvdisplay -C --separator '|' --noheadings --nosuffix --units=b -o pv_name,vg_name,pv_size,pv_uuid | while read line ; do + +- # With the above example pdev=/dev/sda1 ++ # With the above example pdev=/dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:1:0-part1 + # (the "echo $line" makes the leading blanks disappear) +- pdev=$( echo $line | cut -d ":" -f "1" ) ++ pdev=$( echo $line | cut -d "|" -f "1" ) + + # Skip lines that are not describing physical devices + # i.e. lines where pdev does not start with a leading / character: +@@ -91,11 +97,11 @@ local lvs_exit_code + fi + + # With the above example vgrp=system +- vgrp=$( echo $line | cut -d ":" -f "2" ) +- # With the above example size=41940992 +- size=$( echo $line | cut -d ":" -f "3" ) ++ vgrp=$( echo $line | cut -d "|" -f "2" ) ++ # With the above example size=107340627968 ++ size=$( echo $line | cut -d "|" -f "3" ) + # With the above example uuid=7wwpcO-KmNN-qsTE-7sp7-JBJS-vBdC-Zyt1W7 +- uuid=$( echo $line | cut -d ":" -f "12" ) ++ uuid=$( echo $line | cut -d "|" -f "4" ) + + # Translate pdev through diskbyid_mappings file: + pdev=$( get_device_mapping $pdev ) diff --git a/rear.spec b/rear.spec index 9e83a48..6a8dd42 100644 --- a/rear.spec +++ b/rear.spec @@ -40,6 +40,7 @@ Patch49: rsync-output.patch Patch50: rear-bz2119501.patch Patch51: rear-bz2120736.patch Patch52: rear-bz2117937.patch +Patch53: rear-bz2091163.patch # rear contains only bash scripts plus documentation so that on first glance it could be "BuildArch: noarch" # but actually it is not "noarch" because it only works on those architectures that are explicitly supported.