From e99b62981af0ff395e519108652e633953f2ba57 Mon Sep 17 00:00:00 2001 From: Micah Abbott Date: Fri, 9 Aug 2024 16:49:02 -0400 Subject: [PATCH] tier-1/gropwart: bail early on devicemapper targets If the growpart script detects a DM target, exit early. Signed-off-by: Micah Abbott --- tier-1/bootc-generic-growpart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tier-1/bootc-generic-growpart b/tier-1/bootc-generic-growpart index c2277ba..cc62051 100755 --- a/tier-1/bootc-generic-growpart +++ b/tier-1/bootc-generic-growpart @@ -3,15 +3,18 @@ set -eu backing_device=$(findmnt -vno SOURCE /sysroot) echo "Backing device: ${backing_device}" + +# Handling devicemapper targets is a whole other thing +case $backing_device in + /dev/mapper/*) echo "Not growing $backing_device"; exit 0 ;; +esac + syspath=/sys/class/block/$(basename "${backing_device}") if ! test -d "${syspath}"; then echo "failed to find backing device ${syspath}"; exit 1 fi -# Handling devicemapper targets is a whole other thing -case $backing_device in - /dev/mapper/*) "Not growing $backing_device"; exit 0 ;; -esac + # Note that we expect that the rootfs is on a partition partition=$(cat "${syspath}"/partition)