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