From 4fd574316f51dca2f0ed430b756070f881f0e365 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Mon, 23 Jul 2018 18:21:55 +0200 Subject: [PATCH 1/2] scripts: generate a zip instead of a tarball for our log archive Github doesn't allow uploading a tarball but a zip archive. --- scripts/collect-bug-info.sh | 8 ++++---- snap/.snapcraft/state | 4 ++++ snap/snapcraft.yaml | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 snap/.snapcraft/state diff --git a/scripts/collect-bug-info.sh b/scripts/collect-bug-info.sh index 3c42cd4..8cb89b7 100755 --- a/scripts/collect-bug-info.sh +++ b/scripts/collect-bug-info.sh @@ -48,12 +48,12 @@ fi echo "Generating archive with all log files in $PWD ..." CURDIR=$PWD -(cd $TMPDIR; tar cJf $CURDIR/anbox-system-diagnostics-$(date --rfc-3339=date --utc).tar.xz *) +(cd $TMPDIR; zip -r $CURDIR/anbox-system-diagnostics-$(date --rfc-3339=date --utc).zip *) rm -rf $TMPDIR echo "DONE!" echo -echo "Now please take the tarball generate in your current directory and" -echo "attach it to your bug report. Please don't hesitate to have a look" -echo "into the tarball before you do so to verify you don't leak any" +echo "Now please take the ZIP archive generated in your current directory" +echo "and attach it to your bug report. Please don't hesitate to have a" +echo "look into the archive before you do so to verify you don't leak any" echo "information you don't want!" diff --git a/snap/.snapcraft/state b/snap/.snapcraft/state new file mode 100644 index 0000000..0278549 --- /dev/null +++ b/snap/.snapcraft/state @@ -0,0 +1,4 @@ +!GlobalState +assets: + build-packages: [] + build-snaps: [] diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 11459d3..0332464 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -144,6 +144,13 @@ parts: stage-packages: - apparmor + zip: + plugin: nil + stage-packages: + - zip + prime: + - usr/bin/zip + lxc: source: https://github.com/lxc/lxc source-type: git From 0178e4855c02ab6b0d69b2594357afdb791d2936 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Mon, 23 Jul 2018 18:43:53 +0200 Subject: [PATCH 2/2] scripts: prevent collect-bug-info execution as root --- scripts/collect-bug-info.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/collect-bug-info.sh b/scripts/collect-bug-info.sh index 8cb89b7..afc04e9 100755 --- a/scripts/collect-bug-info.sh +++ b/scripts/collect-bug-info.sh @@ -7,9 +7,7 @@ if [ $(id -u) -ne 0 ] ; then echo " adding a few important file for bug diagnostics to the report." echo " If you want to have a look at the script before giving it root" echo " access, please have a look at $0." - echo - echo "Please press any key to continue" - read -r action + exit 0 fi echo "This script will collect a few interesting things which developers will" @@ -30,7 +28,7 @@ cp /var/snap/anbox/common/logs/console.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 - sudo journalctl --no-pager -u snap.anbox.container-manager.service > $TMPDIR/container-manager.log 2>&1 + sudo journalctl --no-pager -u snap.anbox.container-manager.service > $TMPDIR/container-manager.log 2>&1 || true fi set +x