Brandon Kim | bafdac1 | 2021-06-15 15:29:31 -0700 | [diff] [blame] | 1 | diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh |
Heyi Guo | 2168adb | 2022-01-26 14:10:33 +0800 | [diff] [blame] | 2 | index 2a32d26ffc..a8cc76d440 100644 |
Brandon Kim | bafdac1 | 2021-06-15 15:29:31 -0700 | [diff] [blame] | 3 | --- a/obmc-init.sh |
| 4 | +++ b/obmc-init.sh |
Heyi Guo | 2168adb | 2022-01-26 14:10:33 +0800 | [diff] [blame] | 5 | @@ -287,6 +287,14 @@ then |
Brandon Kim | bafdac1 | 2021-06-15 15:29:31 -0700 | [diff] [blame] | 6 | fi |
| 7 | fi |
| 8 | |
| 9 | +# Ensure that we clean our rwfs on version change |
| 10 | +if mount $rwdev $rwdir -t $rwfst -o $rwopts; then |
| 11 | + if ! cmp "$rwdir"/os-release /etc/os-release 2>/dev/null; then |
| 12 | + echo "RWFS from older BMC version, cleaning" |
| 13 | + touch $trigger |
| 14 | + fi |
| 15 | + umount "$rwdir" |
| 16 | +fi |
| 17 | if grep -w clean-rwfs-filesystem $optfile |
| 18 | then |
| 19 | echo "Cleaning of read-write overlay filesystem requested." |
Heyi Guo | 2168adb | 2022-01-26 14:10:33 +0800 | [diff] [blame] | 20 | @@ -411,6 +419,9 @@ HERE |
Brandon Kim | bafdac1 | 2021-06-15 15:29:31 -0700 | [diff] [blame] | 21 | debug_takeover "$msg" |
| 22 | fi |
| 23 | |
| 24 | +# Keep track of the last version to use this rwfs |
| 25 | +cp /etc/os-release "$rwdir"/os-release |
| 26 | + |
Heyi Guo | 2168adb | 2022-01-26 14:10:33 +0800 | [diff] [blame] | 27 | # Empty workdir; do not remove workdir itself for it will fail to recreate it if |
| 28 | # RWFS is full |
| 29 | if [ -d $work ] |