Merge pull request #733 from morphis/enable-debug-per-snap-config

Add snap configure hook to allow enable debug mode
This commit is contained in:
Simon Fels 2018-05-30 10:30:18 +02:00 committed by GitHub
commit 3d5ea7fbdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

1
.gitignore vendored
View file

@ -2,7 +2,6 @@ build*/
parts/
stage/
prime/
snap/
android-images/
*.snap
CMakeLists.txt.user

View file

@ -43,6 +43,10 @@ start() {
$SNAP/sbin/apparmor_parser -r $SNAP/apparmor/anbox-container.aa
fi
if [ -e "$SNAP_COMMON"/.enable_debug ]; then
export ANBOX_LOG_LEVEL=debug
fi
exec $AA_EXEC $SNAP/bin/anbox-wrapper.sh container-manager \
--data-path=$DATA_PATH \
--android-image=$ANDROID_IMG \

View file

@ -29,4 +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
export ANBOX_LOG_LEVEL=debug
fi
exec $SNAP/usr/bin/anbox $@

9
snap/hooks/configure vendored Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
if [ "$(snapctl get debug.enable)" = true ]; then
touch "$SNAP_COMMON"/.enable_debug
else
rm -f "$SNAP_COMMON"/.enable_debug
fi
exit 0