Harald Hoyer 460d2c
From 3a2beb037c822e1567f86b63ac24194bffeea991 Mon Sep 17 00:00:00 2001
Harald Hoyer 460d2c
From: Kairui Song <kasong@redhat.com>
Harald Hoyer 460d2c
Date: Mon, 8 Jun 2020 15:31:56 +0800
Harald Hoyer 460d2c
Subject: [PATCH] 99squash: Don't hardcode the squash sub directories
Harald Hoyer 460d2c
Harald Hoyer 460d2c
Signed-off-by: Kairui Song <kasong@redhat.com>
Harald Hoyer 460d2c
---
Harald Hoyer 460d2c
 modules.d/99squash/setup-squash.sh | 4 ++--
Harald Hoyer 460d2c
 1 file changed, 2 insertions(+), 2 deletions(-)
Harald Hoyer 460d2c
Harald Hoyer 460d2c
diff --git a/modules.d/99squash/setup-squash.sh b/modules.d/99squash/setup-squash.sh
Harald Hoyer 460d2c
index d2740e7c..d0000b6f 100755
Harald Hoyer 460d2c
--- a/modules.d/99squash/setup-squash.sh
Harald Hoyer 460d2c
+++ b/modules.d/99squash/setup-squash.sh
Harald Hoyer 460d2c
@@ -4,7 +4,6 @@ PATH=/bin:/sbin
Harald Hoyer 460d2c
 SQUASH_IMG=/squash/root.img
Harald Hoyer 460d2c
 SQUASH_MNT=/squash/root
Harald Hoyer 460d2c
 SQUASH_MNT_REC=/squash/mounts
Harald Hoyer 460d2c
-SQUASHED_MNT="usr etc"
Harald Hoyer 460d2c
 
Harald Hoyer 460d2c
 echo $SQUASH_MNT > $SQUASH_MNT_REC
Harald Hoyer 460d2c
 
Harald Hoyer 460d2c
@@ -45,7 +44,8 @@ if [ $? != 0 ]; then
Harald Hoyer 460d2c
     echo "Unable to mount squashed initramfs image"
Harald Hoyer 460d2c
 fi
Harald Hoyer 460d2c
 
Harald Hoyer 460d2c
-for file in $SQUASHED_MNT; do
Harald Hoyer 460d2c
+for file in $SQUASH_MNT/*; do
Harald Hoyer 460d2c
+	file=${file#$SQUASH_MNT/}
Harald Hoyer 460d2c
 	lowerdir=$SQUASH_MNT/$file
Harald Hoyer 460d2c
 	workdir=/squash/overlay-work/$file
Harald Hoyer 460d2c
 	upperdir=/$file
Harald Hoyer 460d2c