summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-04-06 00:14:18 +0800
committerIru Cai <mytbk920423@gmail.com>2019-04-06 00:14:18 +0800
commitd1317ea4ef22e0f2699f307b435ab067875c7819 (patch)
tree874307f697b548444f42e501527057de024d6c76
parent0f07b1003835bdcd87c56396db7c7ec38b927809 (diff)
downloadliveusb-builder-d1317ea4ef22e0f2699f307b435ab067875c7819.tar.xz
add an option to clean the live USB
-rwxr-xr-xbuildlive10
1 files changed, 10 insertions, 0 deletions
diff --git a/buildlive b/buildlive
index cebe132..30ac729 100755
--- a/buildlive
+++ b/buildlive
@@ -16,6 +16,7 @@ GRUBCFG_ONLY=0
DOWNLOAD_ONLY=0
UMOUNT_BOOT=0
UMOUNT_ROOT=0
+CLEAN_USB=0
. functions.sh
@@ -37,6 +38,7 @@ options:
--root=<path>: set the path to put the live USB data files
--boot <path>
--boot=<path>: set the path to put the kernel and loader files
+ --clean: clean the old live USB files before installing
--no-grub: do not install GRUB loader (still generate grub.cfg)
--grubcfg: do not do real install, only generate grub.cfg file
--downloadonly: only download the ISO files
@@ -98,6 +100,9 @@ do
--downloadonly)
DOWNLOAD_ONLY=1
;;
+ --clean)
+ CLEAN_USB=1
+ ;;
*=*|-*)
usage
exit 1
@@ -162,6 +167,11 @@ if [ ! -z "$DEVNAME" ]; then
msg "Boot sector will be written to $DEVNAME"
fi
+if [[ "$CLEAN_USB" = 1 ]]; then
+ msg "Cleaning old live USB files."
+ rm -rf "$KERNELDIR"/* "$DATADIR"/*
+fi
+
for i in ${DISTROLIST[@]}
do
process_isoinfo "$i"