diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-05-24 02:10:48 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-05-24 02:10:48 (EDT) |
commit | c5dc1d55493b567ff1d962f2bb7a7ac81da94108 (patch) | |
tree | 996814f336bb8aed390b001164acac827a00f3dc /lib | |
parent | ee3f67f2b0e053b29a142dd6ee8e8cc8f020022d (diff) |
cmd/opkg: Accept block device as root
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmd/opkg.sh | 12 |
1 files changed, 12 insertions, 0 deletions
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 # <http://www.gnu.org/licenses/>. +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() |