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 |
| 2 | index 62be89f039..689fbea5bf 100644 |
| 3 | --- a/obmc-init.sh |
| 4 | +++ b/obmc-init.sh |
| 5 | @@ -275,6 +275,14 @@ then |
| 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." |
| 20 | @@ -399,6 +407,9 @@ HERE |
| 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 | + |
| 27 | rm -rf $work |
| 28 | mkdir -p $upper $work |
| 29 | |