diff options
Diffstat (limited to 'buildlive')
-rwxr-xr-x | buildlive | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -17,18 +17,10 @@ DOWNLOAD_ONLY=0 UMOUNT_BOOT=0 UMOUNT_ROOT=0 CLEAN_USB=0 +BOOTLOADER_ONLY=0 . functions.sh -msg() { - echo -e "$1" >&2 -} - -fatalerror() { - msg "\x1b[1;31m$1\x1b[0m" - exit 1 -} - usage() { >&2 cat << EOF $0 [--root <path>] [options] [--distro=<metadist> <isofile>] [distro] ... @@ -39,6 +31,7 @@ options: --boot <path> --boot=<path>: set the path to put the kernel and loader files --clean: clean the old live USB files before installing + --bootloader-only: only install the boot loader --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 @@ -52,7 +45,7 @@ try_mount() { then if ! findmnt "$1" > /dev/null then - udevil mount "$1" > /dev/null + mount_block "$1" > /dev/null mnt=$(findmnt -n -o TARGET "$1") else mnt=$(findmnt -n -o TARGET "$1") @@ -63,6 +56,9 @@ try_mount() { echo "$mnt" } +detect_block_mount_tool 2>/dev/null +detect_iso_mount_tool 2>/dev/null + unset ISOPATH CFGFILE="$HOME/.liveusb-builder" test -f "$CFGFILE" && source "$CFGFILE" || true @@ -91,6 +87,9 @@ do --dev=*) DEVNAME=${1/--dev=} ;; + --bootloader-only) + BOOTLOADER_ONLY=1 + ;; --no-grub) INSTALL_GRUB=0 ;; @@ -172,7 +171,7 @@ if [[ "$DOWNLOAD_ONLY" == 0 ]]; then msg "Files will be copy to $ROOTPATH" fi -if [[ "${#DISTROLIST[@]}" == 0 ]]; then +if [[ "$BOOTLOADER_ONLY" == 0 && "${#DISTROLIST[@]}" == 0 ]]; then usage exit 1 fi @@ -263,9 +262,9 @@ fi if [ "$UMOUNT_BOOT" == 1 ]; then msg 'Trying to umount the boot mountpoint, you may need to wait for sync() to complete.' - udevil umount "$BOOTPATH" + unmount_block "$BOOTPATH" fi if [ "$UMOUNT_ROOT" == 1 -a "$ROOTPATH" != "$BOOTPATH" ]; then msg 'Trying to umount the root mountpoint, you may need to wait for sync() to complete.' - udevil umount "$ROOTPATH" + unmount_block "$ROOTPATH" fi |