summaryrefslogtreecommitdiffstats
path: root/lib/cmd
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-05-24 02:17:14 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-05-24 02:17:14 (EDT)
commit09b53de79834fefcb6d9e83c86c0fdf729088292 (patch)
tree6a7b819141eb13ef5aaa64c46c981c6422973768 /lib/cmd
parentc5dc1d55493b567ff1d962f2bb7a7ac81da94108 (diff)
cmd/install: Accept block device as root
Diffstat (limited to 'lib/cmd')
-rw-r--r--lib/cmd/install.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index ac817e0..614f800 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -41,6 +41,7 @@ cmd_install_main()
local profile=
local mirror=
local foreign=
+ local dev=
if ! get_options "${@}"; then
print_cmd_usage 'install' >&2
@@ -97,6 +98,11 @@ cmd_install_main()
foreign=false
fi
+ 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 +125,10 @@ cmd_install_main()
fi
rm "${chroot}/prokit/installing"
+
+ if [ "x${dev}" != 'x' ]; then
+ block_umount "${chroot}"
+ fi
}
cmd_install_find_pkgs()