[PATCH 3/4] mdadm/tests: ddf template fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If it's a device mapper device, bd is null. So use the result from
/proc/mounts directly.

For example:
grep ' / ' /proc/mounts | awk '{print }' ->
/dev/mapper/rhel_storageqe--104-root
lsblk -no PKNAME /dev/mapper/rhel_storageqe--104-root -> null

Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 tests/env-ddf-template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/env-ddf-template b/tests/env-ddf-template
index 4f4ad0f32c0c..ebc0ebf3ab1e 100644
--- a/tests/env-ddf-template
+++ b/tests/env-ddf-template
@@ -3,8 +3,7 @@ sha1_sum() {
 }
 
 get_rootdev() {
-    local part=$(grep ' / ' /proc/mounts | awk '{print $1}')
-    local bd=/dev/$(lsblk -no PKNAME $part)
+    local bd=$(grep ' / ' /proc/mounts | awk '{print $1}')
     [ -b $bd ] || exit 1
     echo $bd
 }
-- 
2.32.0 (Apple Git-132)





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux