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 --- (limited to 'lib/cmd') 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() -- cgit v0.9.1