From 09b53de79834fefcb6d9e83c86c0fdf729088292 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 24 May 2015 02:17:14 -0400 Subject: cmd/install: Accept block device as root --- 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() diff --git a/man/prokit-install.8in b/man/prokit-install.8in index ef5f68d..4f10d34 100644 --- a/man/prokit-install.8in +++ b/man/prokit-install.8in @@ -6,10 +6,13 @@ prokit-install \- Install a system into a directory .SH SYNOPSIS \fBprokit install\fP [\fB-a\fP \fIarch\fP] [\fB-p\fP \fIplat\fP] -[\fB-m\fP \fImirror\fP] [\fB-F\fP] \fIsuite\fP \fIroot-dir\fP +[\fB-m\fP \fImirror\fP] [\fB-F\fP] \fIsuite\fP \fIroot\fP .SH DESCRIPTION -\fBprokit install\fP installs a basic system of \fIsuite\fP into \fIroot-dir\fP. +\fBprokit install\fP installs a basic system of \fIsuite\fP into \fIroot\fP. +.P +If \fIroot\fP is a block device node, the block device is mounted and a system +is installed into its file system. .P \fIsuite\fP can be a distribution like \fItrunk\fP; a channel and distribution like \fIdev/trunk\fP; a profile and distribution like \fIproteanos:trunk\fP; or -- cgit v0.9.1