Make profile.d/toolbox.sh available inside the toolbox container

This is a continuation of abb2ac6fd4
This commit is contained in:
Debarshi Ray 2019-04-29 21:03:12 +02:00
parent c7b7fa1867
commit 97f4e072d5

View file

@ -657,6 +657,7 @@ create()
kcm_socket=""
kcm_socket_bind=""
tmpfs_size=$((64 * 1024 * 1024)) # 64 MiB
toolbox_profile_bind=""
working_container_name="toolbox-working-container-$(uuidgen --time)"
# shellcheck disable=SC2153
@ -815,6 +816,10 @@ create()
toolbox_path_bind="--volume $TOOLBOX_PATH:/usr/bin/toolbox:ro"
toolbox_path_set="--env TOOLBOX_PATH=$TOOLBOX_PATH"
if [ -f /etc/profile.d/toolbox.sh ] 2>&3; then
toolbox_profile_bind="--volume /etc/profile.d/toolbox.sh:/etc/profile.d/toolbox.sh:ro"
fi
max_uid_count=65536
max_minus_uid=$((max_uid_count - user_id_real))
uid_plus_one=$((user_id_real + 1))
@ -848,6 +853,7 @@ create()
--uidmap "$uid_plus_one":"$uid_plus_one":"$max_minus_uid" \
$kcm_socket_bind \
$toolbox_path_bind \
$toolbox_profile_bind \
--volume "$HOME":"$HOME":rslave \
--volume "$XDG_RUNTIME_DIR":"$XDG_RUNTIME_DIR" \
--volume "$dbus_system_bus_path":"$dbus_system_bus_path" \