summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-09-23 11:29:50 +0800
committerIru Cai <mytbk920423@gmail.com>2016-09-23 11:29:50 +0800
commit80210c3f303cb2f9523f49dcf370f7de76c3cbfb (patch)
tree6346b2937c0911e2e98f15bf707ce8bbe2e1b740
parent4591a540a777712d11ce4901fe9e9a771a7f4c1a (diff)
downloadliveusb-builder-80210c3f303cb2f9523f49dcf370f7de76c3cbfb.tar.xz
add --downloadonly option
-rwxr-xr-xbuildlive22
1 files changed, 19 insertions, 3 deletions
diff --git a/buildlive b/buildlive
index e75f2e9..caf03ac 100755
--- a/buildlive
+++ b/buildlive
@@ -10,6 +10,7 @@ KERNELDIR=
DATADIR=
INSTALL_GRUB=1
GRUBCFG_ONLY=0
+DOWNLOAD_ONLY=0
. functions.sh
@@ -24,11 +25,12 @@ fatalerror() {
usage() {
>&2 cat << EOF
-$0 --root=<rootpath> [options] [distro 1] [distro 2] ...
+$0 [--root=<rootpath>] [options] [distro 1] [distro 2] ...
use $0 -L to list available distros
options:
--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
--dev=<diskdev>: write boot sector to <diskdev> (default <diskdev> is autodetected from <rootpath>)
EOF
}
@@ -59,6 +61,9 @@ do
--grubcfg)
GRUBCFG_ONLY=1
;;
+ --downloadonly)
+ DOWNLOAD_ONLY=1
+ ;;
*=*|-*)
usage
exit 1
@@ -75,12 +80,19 @@ do
shift
done
-if [[ "${#DISTROLIST[@]}" == 0 || -z "$ROOTPATH" ]]; then
+if [[ -z "$ROOTPATH" && "$DOWNLOAD_ONLY" == 0 ]]; then
+ usage
+ exit 1
+fi
+
+if [[ "${#DISTROLIST[@]}" == 0 ]]; then
usage
exit 1
fi
-msg "Boot sector will be written to $DEVNAME"
+if [ ! -z "$DEVNAME" ]; then
+ msg "Boot sector will be written to $DEVNAME"
+fi
for i in ${DISTROLIST[@]}
do
@@ -95,6 +107,10 @@ do
fi
done
+if [[ "$DOWNLOAD_ONLY" == 1 ]]; then
+ exit 0
+fi
+
install -d "$ROOTPATH/grub"
echo '# The live USB grub.cfg file' > "$GRUBCFG"