From 32aa2827d8de16879bb4e92c1235ef5b10f23e2c Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 24 May 2015 03:30:41 -0400 Subject: cmd/build: Accept block device as root --- diff --git a/lib/cmd/build.sh b/lib/cmd/build.sh index 32dca26..d22fa1e 100644 --- a/lib/cmd/build.sh +++ b/lib/cmd/build.sh @@ -18,6 +18,7 @@ # along with the ProteanOS Development Kit. If not, see # . +use block use profile use session use rand @@ -31,6 +32,7 @@ cmd_build_build_deps= cmd_build_main() { local root= + local dev= local opkbuild_optstring= local arch= local plat= @@ -43,9 +45,16 @@ cmd_build_main() fi root="${1}" - cmd_build_root="${root}" shift 1 + dev='' + if is_block "${root}"; then + dev="${root}" + root="$(block_mount "${dev}")" + fi + + cmd_build_root="${root}" + opkbuild_optstring="$(cat "${root}/usr/share/opkbuild/optstring")" arch="$(cat "${root}/etc/proteanos_arch")" plat="$(cat "${root}/etc/proteanos_plat")" @@ -91,6 +100,10 @@ cmd_build_main() cmd_build_fini session_end + + if [ "x${dev}" != 'x' ]; then + block_umount "${root}" + fi } cmd_build_make_deps_pkg() diff --git a/man/prokit-build.8in b/man/prokit-build.8in index 77ed078..5dc25de 100644 --- a/man/prokit-build.8in +++ b/man/prokit-build.8in @@ -5,12 +5,15 @@ prokit-build \- Build a package .SH SYNOPSIS -\fBprokit build\fP \fIroot-dir\fP [\fIoption\fP ...] \fIpkg-dir\fP +\fBprokit build\fP \fIroot\fP [\fIoption\fP ...] \fIpkg-dir\fP .SH DESCRIPTION \fBprokit build\fP runs \fBopkbuild\fP to build a package in an isolated file system environment, temporarily installing any missing build dependencies. .P +If \fIroot\fP is a block device node, the block device is mounted and +\fBopkbuild\fP is run in its file system. +.P \fIoption\fPs are \fBopkbuild\fP options. Run \fIprokit build -h .\fP for more information. .P -- cgit v0.9.1