From 5c8bcef1ac2a87fbd0dbcfca438a92f39732880a Mon Sep 17 00:00:00 2001 From: sihuihan88 Date: Fri, 31 Mar 2017 23:51:59 -0700 Subject: [PATCH] [boot0]:remove no need files before extract image (#460) * [Aboot]:remove no need files before extract image Signed-off-by: Sihui Han * use and remove boot0 in the check Signed-off-by: Sihui Han * change the comments accordingly Signed-off-by: Sihui Han --- files/Aboot/boot0.j2 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index d30a44e520..0905faad4c 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -41,11 +41,13 @@ parse_environment_config() { } extract_image() { - ## Clean old directory for read-write layer - rm -rf "$target_path/rw" - - ## Clean docker directory - rm -rf "$target_path/{{ DOCKERFS_DIR }}" + ## Remove all the other unnecssary files except swi file, boot-config + for f in $(ls -A $target_path); do + if [ $f != "${swipath##*/}" ] && [ $f != "boot-config" ]; then + rm -rf "$target_path/$f" + fi + done + ## Unzip the image unzip -oq "$swipath" -x boot0 -d "$target_path"