Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Add snap configure hook to allow enable debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
morphis committed May 30, 2018
1 parent a88faed commit 8321552
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -2,7 +2,6 @@ build*/
parts/
stage/
prime/
snap/
android-images/
*.snap
CMakeLists.txt.user
Expand Down
4 changes: 4 additions & 0 deletions scripts/container-manager.sh
Expand Up @@ -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 \
Expand Down
4 changes: 4 additions & 0 deletions scripts/snap-wrapper.sh
Expand Up @@ -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 changes: 9 additions & 0 deletions snap/hooks/configure
@@ -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

0 comments on commit 8321552

Please sign in to comment.