diff options
author | Iru Cai <mytbk920423@gmail.com> | 2022-05-24 22:04:17 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2022-05-24 23:59:05 +0800 |
commit | ec66632ec6601e89f8843231d4fae397cb88b98c (patch) | |
tree | 96e08f0f63a967b9617edbdf30aeb2d590b14319 /buildlive | |
parent | ab499cb975263cf644166f8b4b10eb372c7f27d5 (diff) | |
download | liveusb-builder-ec66632ec6601e89f8843231d4fae397cb88b98c.tar.xz |
support udisks2 mount tool, fall back to system mount/unmount
Diffstat (limited to 'buildlive')
-rwxr-xr-x | buildlive | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -20,15 +20,6 @@ CLEAN_USB=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] ... @@ -52,7 +43,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 +54,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 @@ -263,9 +257,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 |