diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-04-06 00:14:18 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-04-06 00:14:18 +0800 |
commit | d1317ea4ef22e0f2699f307b435ab067875c7819 (patch) | |
tree | 874307f697b548444f42e501527057de024d6c76 /buildlive | |
parent | 0f07b1003835bdcd87c56396db7c7ec38b927809 (diff) | |
download | liveusb-builder-d1317ea4ef22e0f2699f307b435ab067875c7819.tar.xz |
add an option to clean the live USB
Diffstat (limited to 'buildlive')
-rwxr-xr-x | buildlive | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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" |