From 83215524dee96f06a59058bb1784764bfc959452 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 30 May 2018 08:58:03 +0200 Subject: [PATCH 1/4] Add snap configure hook to allow enable debug mode --- .gitignore | 1 - scripts/container-manager.sh | 4 ++++ scripts/snap-wrapper.sh | 4 ++++ snap/hooks/configure | 9 +++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 snap/hooks/configure diff --git a/.gitignore b/.gitignore index a9b4b45..0a290ca 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ build*/ parts/ stage/ prime/ -snap/ android-images/ *.snap CMakeLists.txt.user diff --git a/scripts/container-manager.sh b/scripts/container-manager.sh index a0fec05..7e7fb15 100755 --- a/scripts/container-manager.sh +++ b/scripts/container-manager.sh @@ -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 \ diff --git a/scripts/snap-wrapper.sh b/scripts/snap-wrapper.sh index 60cb85e..7524225 100755 --- a/scripts/snap-wrapper.sh +++ b/scripts/snap-wrapper.sh @@ -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 $@ diff --git a/snap/hooks/configure b/snap/hooks/configure new file mode 100755 index 0000000..89dea03 --- /dev/null +++ b/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 From 7664539ad768156b2f8cec823ebae951797f98e5 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 30 May 2018 10:20:22 +0200 Subject: [PATCH 2/4] Always verify the hash of the Android image during the build --- snap/snapcraft.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 2602396..377455a 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -72,6 +72,7 @@ parts: x86_64) IMAGE_PATH="2018/05/23" IMAGE_NAME="android_amd64.img" + IMAGE_HASH="cbcb8c4740ed38dbc243122df2d8d87511a9c8dcc162781f2eabb5dc1ea079fe" ;; *) echo "ERROR: Unknown architecture $ARCH" @@ -83,6 +84,10 @@ parts: # expects the downloaded file to be an archive it can extract. echo "Downloading image..." wget http://build.anbox.io/android-images/$IMAGE_PATH/$IMAGE_NAME + + echo "$IMAGE_HASH $IMAGE_NAME" > image-hash + sha256sum -c image-hash + mv $IMAGE_NAME $SNAPCRAFT_PART_INSTALL/android.img fi From b318bc15148dfc1db679ed64e04d668eee7cde23 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 30 May 2018 12:35:21 +0200 Subject: [PATCH 3/4] Fetch logs from the right location in SNAP_COMMON --- scripts/collect-bug-info.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/collect-bug-info.sh b/scripts/collect-bug-info.sh index 6526c6d..199058d 100755 --- a/scripts/collect-bug-info.sh +++ b/scripts/collect-bug-info.sh @@ -24,8 +24,8 @@ echo "Collecting anbox log files ... " set -x # Collect several things which are of interest for bug reports cp /var/snap/anbox/common/data/system.log $TMPDIR || true -cp /var/snap/anbox/containers/lxc-monitord.log $TMPDIR || true -cp /var/snap/anbox/logs/container.log $TMPDIR || true +cp /var/snap/anbox/common/containers/lxc-monitord.log $TMPDIR || true +cp /var/snap/anbox/common/logs/container.log $TMPDIR || true $SNAP/command-anbox.wrapper system-info > $TMPDIR/system-info.log 2>&1 || true if [ -e /etc/systemd/system/snap.anbox.container-manager.service ]; then From 4c60e2c6041de068e2be5061a10ea767736e327a Mon Sep 17 00:00:00 2001 From: Yechiel Levi Date: Wed, 30 May 2018 18:21:58 +0300 Subject: [PATCH 4/4] Updating Issue template --- .github/ISSUE_TEMPLATE.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 1881bb6..f16a1a8 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,12 @@ -Make sure you are running the latest version of Anbox before reporting an issue. +1. Please check that no similar bug is already reported. Have a look on the list of open bugs at https://github.com/anbox/anbox/issues +2. Make sure you are running the latest version of Anbox before reporting an issue. Update snap to latest: `snap refresh --devmode --edge anbox` +3. Make sure you have debug logs enabled: +`sudo snap set anbox debug.enable=true` +4. Reproduce the error while debug logs enabled. +5. Run the anbox logs collection utility and attach the tar file. +`sudo /snap/bin/anbox.collect-bug-info ` -Please also check that no similar bug is already reported. Have a look on the list of open bugs at https://github.com/anbox/anbox/issues - -** Please paste the result of `anbox system-info` below:** +6. ** Please paste the result of `anbox system-info` below:** ``` [please paste printout of `anbox system-info` here] ``` @@ -14,3 +18,4 @@ Please also check that no similar bug is already reported. Have a look on the li **Additional info:** +