summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core')
-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\""