summaryrefslogtreecommitdiffstats
path: root/lib/cmd/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmd/build.sh')
-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()