summaryrefslogtreecommitdiffstats
path: root/lib/session.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/session.sh')
-rw-r--r--lib/session.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/session.sh b/lib/session.sh
index 0d66eeb..e189277 100644
--- a/lib/session.sh
+++ b/lib/session.sh
@@ -31,18 +31,21 @@ session_id=
session_root=
session_arch=
session_plat=
+session_mountdir=
session_atexit=
session_begin()
{
local root="${1}"
- local atexit="${2}"
+ local mountdir="${2}"
+ local atexit="${3}"
rand
session_id=${rand_x}
session_root="${root}"
session_arch="$(cat "${root}/etc/proteanos_arch")"
session_plat="$(cat "${root}/etc/proteanos_plat")"
+ session_mountdir="${mountdir}"
session_atexit="${atexit}"
if ! mutex_lock_timeout "${session_root}/prokit/sessions.lock" 5; then
@@ -68,6 +71,9 @@ session_begin()
# Register the session.
mkdir "${session_root}/prokit/sessions/${session_id}"
+ profile_bind_mount "${session_arch}" "${session_plat}" \
+ "${session_mountdir}" \
+ "${session_root}/prokit/sessions/${session_id}"
mutex_unlock "${session_root}/prokit/sessions.lock"
}
@@ -75,6 +81,9 @@ session_begin()
session_end()
{
# Unregister the session.
+ profile_bind_umount "${session_arch}" "${session_plat}" \
+ "${session_mountdir}" \
+ "${session_root}/prokit/sessions/${session_id}"
rmdir "${session_root}/prokit/sessions/${session_id}"
if ! mutex_lock_timeout "${session_root}/prokit/sessions.lock" 5; then