diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-05-25 20:33:22 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-05-25 20:33:22 (EDT) |
commit | 65489cd1069b6e9cb592508103211984c43d3bbf (patch) | |
tree | bc76a67b979f8bf072c580ef90f3663dcb06c3e3 /lib/cmd/shell.sh | |
parent | b76ff4956a6a6904d07b9b89e5d75decbd488675 (diff) | |
parent | 2f95b9bef0fdcd737fbd58cdb5acc405a6b58da4 (diff) |
Merge branch 'feature/block-device-mounting'
Diffstat (limited to 'lib/cmd/shell.sh')
-rw-r--r-- | lib/cmd/shell.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/cmd/shell.sh b/lib/cmd/shell.sh index dfff07f..b5b6d69 100644 --- a/lib/cmd/shell.sh +++ b/lib/cmd/shell.sh @@ -18,12 +18,14 @@ # along with the ProteanOS Development Kit. If not, see # <http://www.gnu.org/licenses/>. +use block use profile use session cmd_shell_main() { local root= + local dev= if [ ${#} -lt 1 ]; then print_cmd_usage 'shell' >&2 @@ -33,6 +35,12 @@ cmd_shell_main() root="${1}" shift 1 + dev='' + if is_block "${root}"; then + dev="${root}" + root="$(block_mount "${dev}")" + fi + . "${root}/etc/os-release" profile_set "${ID}" @@ -45,4 +53,8 @@ cmd_shell_main() session_exec "${@}" fi session_end + + if [ "x${dev}" != 'x' ]; then + block_umount "${root}" + fi } |