summaryrefslogtreecommitdiff
path: root/recipes-core/initscripts
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-09-20 11:12:53 -0500
committerJohn Klug <john.klug@multitech.com>2017-09-20 11:12:53 -0500
commit6c74a95857591bf1d17e2ead6f5cd973d2809e12 (patch)
tree04b900071ebd72568a8d27b874d19ade6ab00540 /recipes-core/initscripts
parentf7f4dcabf18bb6eba31300b24d1288f13251ee44 (diff)
downloadmeta-mlinux-6c74a95857591bf1d17e2ead6f5cd973d2809e12.tar.gz
meta-mlinux-6c74a95857591bf1d17e2ead6f5cd973d2809e12.tar.bz2
meta-mlinux-6c74a95857591bf1d17e2ead6f5cd973d2809e12.zip
Clean up /var/volatile before upgrade
Diffstat (limited to 'recipes-core/initscripts')
-rw-r--r--recipes-core/initscripts/initscripts-1.0/umountfs11
1 files changed, 11 insertions, 0 deletions
diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs
index c782dc7..300de4f 100644
--- a/recipes-core/initscripts/initscripts-1.0/umountfs
+++ b/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -215,6 +215,17 @@ flash_upgrade() {
fi
blink_leds
+
+ if [[ ${flash_root} == /var/volatile ]] ; then
+ oldIFS="${IFS}"
+ IFS=$'\n' rmlist=($(find ${flash_root} -xdev -maxdepth 1 -print | egrep -v "^${flash_root}$|^${flash_dir}$|^${flash_dir}/"))
+ IFS="${oldIFS}"
+ ((i=0))
+ while((i < ${#rmlist[@]})) ; do
+ rm -rf "${rmlist[$i]}"
+ ((i++))
+ done
+ fi
if ! cp ${reboot_cmd} ${flash_dir}/upgrade-reboot ; then
echo "Aborting upgrade. Failed \"cp ${reboot_cmd} ${flash_dir}/upgrade-reboot\""