[boot0]:remove no need files before extract image (#460)

* [Aboot]:remove no need files before extract image

Signed-off-by: Sihui Han <sihan@microsoft.com>

* use  and remove boot0 in the check

Signed-off-by: Sihui Han <sihan@microsoft.com>

* change the comments accordingly

Signed-off-by: Sihui Han <sihan@microsoft.com>
This commit is contained in:
sihuihan88 2017-03-31 23:51:59 -07:00 committed by lguohan
parent 9841f8338b
commit 5c8bcef1ac

View File

@ -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"