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