summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-05-24 03:30:41 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-05-24 03:31:37 (EDT)
commit32aa2827d8de16879bb4e92c1235ef5b10f23e2c (patch)
treeaa35416933a383ceac81b8267bda5f79af50b19c /lib
parentfb23c0bd36f8ffae7ab14b23ce0a2e7985b8c858 (diff)
cmd/build: Accept block device as root
Diffstat (limited to 'lib')
-rw-r--r--lib/cmd/build.sh15
1 files changed, 14 insertions, 1 deletions
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
# <http://www.gnu.org/licenses/>.
+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()