scripts: enable linker debugging when running in debug mode

This commit is contained in:
Simon Fels 2018-07-05 09:18:41 +02:00
commit 7b10faf47a
3 changed files with 10 additions and 9 deletions

View file

@ -61,8 +61,10 @@ start() {
$SNAP/sbin/apparmor_parser -r $SNAP/apparmor/anbox-container.aa
fi
if [ -e "$SNAP_COMMON"/.enable_debug ]; then
enable_debug="$(snapctl get debug.enable)"
if [ "$enable_debug" = true ]; then
export ANBOX_LOG_LEVEL=debug
export LD_DEBUG=libs
fi
EXTRA_ARGS=
@ -71,8 +73,8 @@ start() {
EXTRA_ARGS="$EXTRA_ARGS --use-rootfs-overlay"
fi
privileged_container="$(snapctl get container.privileged)"
if [ "$privileged_container" = true ]; then
enable_privileged_container="$(snapctl get container.privileged)"
if [ "$enable_privileged_container" = true ]; then
EXTRA_ARGS="$EXTRA_ARGS --privileged"
fi

View file

@ -29,7 +29,8 @@ export XDG_DATA_HOME="$SNAP_USER_COMMON/app-data"
# configured but the actual EGL implementation is missing.
export __EGL_VENDOR_LIBRARY_DIRS="$SNAP/glvnd"
if [ -e "$SNAP_COMMON"/.enable_debug ]; then
enable_debug="$(snapctl get debug.enable)"
if [ "$enable_debug" = true ]; then
export ANBOX_LOG_LEVEL=debug
fi

View file

@ -1,9 +1,7 @@
#!/bin/sh
if [ "$(snapctl get debug.enable)" = true ]; then
touch "$SNAP_COMMON"/.enable_debug
else
rm -f "$SNAP_COMMON"/.enable_debug
fi
# We need to have something for snapd in place in order to
# allow configuration options for our snap even if the items
# are read via snapctl elsewhere in the code.
exit 0