From c5dc1d55493b567ff1d962f2bb7a7ac81da94108 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 24 May 2015 02:10:48 -0400 Subject: cmd/opkg: Accept block device as root --- (limited to 'lib/cmd/opkg.sh') diff --git a/lib/cmd/opkg.sh b/lib/cmd/opkg.sh index 9f0c0de..51b90dc 100644 --- a/lib/cmd/opkg.sh +++ b/lib/cmd/opkg.sh @@ -18,6 +18,7 @@ # along with the ProteanOS Development Kit. If not, see # . +use block use profile use session use rand @@ -27,6 +28,7 @@ cmd_opkg_opks= cmd_opkg_main() { local root= + local dev= local first_arg= local install_cmd= local arg= @@ -40,6 +42,12 @@ cmd_opkg_main() root="${1}" shift 1 + dev='' + if is_block "${root}"; then + dev="${root}" + root="$(block_mount "${dev}")" + fi + first_arg=true install_cmd=false cmd_opkg_opks='' @@ -84,6 +92,10 @@ cmd_opkg_main() cmd_opkg_fini session_end + + if [ "x${dev}" != 'x' ]; then + block_umount "${root}" + fi } cmd_opkg_fini() -- cgit v0.9.1