summaryrefslogtreecommitdiffstats
path: root/lib/cmd/install.sh
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-05-25 20:33:22 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-05-25 20:33:22 (EDT)
commit65489cd1069b6e9cb592508103211984c43d3bbf (patch)
treebc76a67b979f8bf072c580ef90f3663dcb06c3e3 /lib/cmd/install.sh
parentb76ff4956a6a6904d07b9b89e5d75decbd488675 (diff)
parent2f95b9bef0fdcd737fbd58cdb5acc405a6b58da4 (diff)
Merge branch 'feature/block-device-mounting'
Diffstat (limited to 'lib/cmd/install.sh')
-rw-r--r--lib/cmd/install.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index ac817e0..a02a77c 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -21,6 +21,7 @@
use getopt
use feed
use profile
+use block
use dir
use fd
use pkg
@@ -41,6 +42,7 @@ cmd_install_main()
local profile=
local mirror=
local foreign=
+ local dev=
if ! get_options "${@}"; then
print_cmd_usage 'install' >&2
@@ -97,6 +99,12 @@ cmd_install_main()
foreign=false
fi
+ dev=''
+ if is_block "${chroot}"; then
+ dev="${chroot}"
+ chroot="$(block_mount "${dev}")"
+ fi
+
info "$(get_msg 'cmd_install_setting_up_chroot')"
if [ -d "${chroot}" ] && ! dir_is_empty "${chroot}" 'lost+found'; then
error 2 "$(get_msg 'cmd_install_chroot_dir_exists')" "${chroot}"
@@ -119,6 +127,10 @@ cmd_install_main()
fi
rm "${chroot}/prokit/installing"
+
+ if [ "x${dev}" != 'x' ]; then
+ block_umount "${chroot}"
+ fi
}
cmd_install_find_pkgs()