summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch12
-rw-r--r--meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh8
2 files changed, 13 insertions, 7 deletions
diff --git a/meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch b/meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
index 7631c85ce3..8760ccfecc 100644
--- a/meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
+++ b/meta-google/recipes-phosphor/initrdscripts/obmc-phosphor-initfs/rwfs-clean-dev.patch
@@ -1,8 +1,8 @@
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh
-index 62be89f039..689fbea5bf 100644
+index 2a32d26ffc..a8cc76d440 100644
--- a/obmc-init.sh
+++ b/obmc-init.sh
-@@ -275,6 +275,14 @@ then
+@@ -287,6 +287,14 @@ then
fi
fi
@@ -17,13 +17,13 @@ index 62be89f039..689fbea5bf 100644
if grep -w clean-rwfs-filesystem $optfile
then
echo "Cleaning of read-write overlay filesystem requested."
-@@ -399,6 +407,9 @@ HERE
+@@ -411,6 +419,9 @@ HERE
debug_takeover "$msg"
fi
+# Keep track of the last version to use this rwfs
+cp /etc/os-release "$rwdir"/os-release
+
- rm -rf $work
- mkdir -p $upper $work
-
+ # Empty workdir; do not remove workdir itself for it will fail to recreate it if
+ # RWFS is full
+ if [ -d $work ]
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh
index e61ede9111..2a32d26ffc 100644
--- a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh
@@ -411,7 +411,13 @@ HERE
debug_takeover "$msg"
fi
-rm -rf $work
+# Empty workdir; do not remove workdir itself for it will fail to recreate it if
+# RWFS is full
+if [ -d $work ]
+then
+ find $work -maxdepth 1 -mindepth 1 -exec rm -rf '{}' +
+fi
+
mkdir -p $upper $work
mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root