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 $SNAP/sbin/apparmor_parser -r $SNAP/apparmor/anbox-container.aa
fi 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 ANBOX_LOG_LEVEL=debug
export LD_DEBUG=libs
fi fi
EXTRA_ARGS= EXTRA_ARGS=
@ -71,8 +73,8 @@ start() {
EXTRA_ARGS="$EXTRA_ARGS --use-rootfs-overlay" EXTRA_ARGS="$EXTRA_ARGS --use-rootfs-overlay"
fi fi
privileged_container="$(snapctl get container.privileged)" enable_privileged_container="$(snapctl get container.privileged)"
if [ "$privileged_container" = true ]; then if [ "$enable_privileged_container" = true ]; then
EXTRA_ARGS="$EXTRA_ARGS --privileged" EXTRA_ARGS="$EXTRA_ARGS --privileged"
fi fi

View file

@ -29,7 +29,8 @@ export XDG_DATA_HOME="$SNAP_USER_COMMON/app-data"
# configured but the actual EGL implementation is missing. # configured but the actual EGL implementation is missing.
export __EGL_VENDOR_LIBRARY_DIRS="$SNAP/glvnd" 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 export ANBOX_LOG_LEVEL=debug
fi fi

View file

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