Merge ~kzapalowicz/snappy-hwe-snaps/+git/pulseaudio:feature/fix-runtime-issues into ~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio:master

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Simon Fels
Approved revision: 0792791574a2772161f8f51082ceef5db7885a12
Merged at revision: c3e5e6edc7f6eb369945d7d8a0837a3dc60f2044
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/pulseaudio:feature/fix-runtime-issues
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/pulseaudio:master
Diff against target: 136 lines (+27/-11)
8 files modified
bin/pactl (+5/-0)
bin/paplay (+5/-0)
bin/parec (+5/-0)
run-tests.sh (+1/-1)
snapcraft.yaml (+3/-3)
tests/image/create-image.sh (+1/-1)
tests/lib/prepare-all.sh (+2/-1)
tests/lib/prepare.sh (+5/-5)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Simon Fels Approve
Matteo Croce (community) Approve
Review via email: mp+313340@code.launchpad.net

Commit message

Fix issues related with running the snap on the target system.

The introduced changes deal with:

1.

SecComp complaining of using send syscall

2.

pactl, parec and paplay commands trying to create the /run/user/[0-9]*
which is forbidden by the AppArmor rules due to security reasons.

Description of the change

Fix issues related with running the snap on the target system.

To post a comment you must log in.
Revision history for this message
Matteo Croce (teknoraver) :
review: Needs Fixing
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) :
review: Needs Fixing
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Matteo Croce (teknoraver) :
review: Approve
Revision history for this message
Simon Fels (morphis) wrote :

LGTM, but we need to wait until the CI is fixed.

Revision history for this message
Simon Fels (morphis) :
review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

The problem the CI sees here

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libudev-dev : Depends: libudev1 (= 229-4ubuntu13) but 229-4ubuntu13+ppa1 is to be installed
E: Unable to correct problems, you have held broken packages.

is caused by the ubuntu-image ppa (https://launchpad.net/~snappy-dev/+archive/ubuntu/image/+packages) which has a different version of systemd. 229-4ubuntu13 (xenial-updates) vs. 229-4ubuntu13+ppa1 (ubuntu-image ppa). As 229-4ubuntu13+ppa1 sorts lower than 229-4ubuntu13 but is installed in the rootfs the classic snaps creates this leads to the error seen above.

As we can safely update from 229-4ubuntu13+ppa1 to 229-4ubuntu13 (both include the same fix) and additional

$ apt upgrade --yes --force-yes

in the script should solve this problem.

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/pactl b/bin/pactl
2index ad5e799..97e23b2 100755
3--- a/bin/pactl
4+++ b/bin/pactl
5@@ -14,6 +14,11 @@
6 # You should have received a copy of the GNU General Public License
7 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8
9+if [ $(id -u) -ne 0 ]; then
10+ echo "This script must be run as root" 1>&2
11+ exit 1
12+fi
13+
14 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/
15 export PULSE_CLIENTCONFIG=$SNAP/etc/pulse/client.conf
16 export HOME=$SNAP_DATA/home
17diff --git a/bin/paplay b/bin/paplay
18index 4f83d77..a132d51 100755
19--- a/bin/paplay
20+++ b/bin/paplay
21@@ -14,6 +14,11 @@
22 # You should have received a copy of the GNU General Public License
23 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24
25+if [ $(id -u) -ne 0 ]; then
26+ echo "This script must be run as root" 1>&2
27+ exit 1
28+fi
29+
30 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/
31 export PULSE_CLIENTCONFIG=$SNAP/etc/pulse/client.conf
32 export HOME=$SNAP_DATA/home
33diff --git a/bin/parec b/bin/parec
34index 0c1cafd..269e0f8 100755
35--- a/bin/parec
36+++ b/bin/parec
37@@ -14,6 +14,11 @@
38 # You should have received a copy of the GNU General Public License
39 # along with this program. If not, see <http://www.gnu.org/licenses/>.
40
41+if [ $(id -u) -ne 0 ]; then
42+ echo "This script must be run as root" 1>&2
43+ exit 1
44+fi
45+
46 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/usr/lib/pulseaudio:$SNAP/usr/lib/pulse-8.0/modules/
47 export PULSE_CLIENTCONFIG=$SNAP/etc/pulse/client.conf
48 export HOME=$SNAP_DATA/home
49diff --git a/run-tests.sh b/run-tests.sh
50index f2e9079..b4ce91b 100755
51--- a/run-tests.sh
52+++ b/run-tests.sh
53@@ -17,7 +17,7 @@
54 set -ex
55
56 image_name=ubuntu-core-16.img
57-channel=candidate
58+channel=stable
59 spread_opts=
60 force_new_image=0
61 test_from_channel=0
62diff --git a/snapcraft.yaml b/snapcraft.yaml
63index abb0b5f..8568c89 100644
64--- a/snapcraft.yaml
65+++ b/snapcraft.yaml
66@@ -18,13 +18,13 @@ apps:
67 slots: [service]
68 pactl:
69 command: bin/pactl
70- plugs: [client]
71+ plugs: [client, network]
72 paplay:
73 command: bin/paplay
74- plugs: [client,home]
75+ plugs: [client, home, network]
76 parec:
77 command: bin/parec
78- plugs: [client]
79+ plugs: [client, home, network]
80 config:
81 command: bin/config
82
83diff --git a/tests/image/create-image.sh b/tests/image/create-image.sh
84index e3c36e0..3aa1d13 100755
85--- a/tests/image/create-image.sh
86+++ b/tests/image/create-image.sh
87@@ -21,7 +21,7 @@ if [ $(id -u) -ne 0 ] ; then
88 exit 1
89 fi
90
91-channel=candidate
92+channel=stable
93 if [ ! -z "$1" ] ; then
94 channel=$1
95 fi
96diff --git a/tests/lib/prepare-all.sh b/tests/lib/prepare-all.sh
97index e3178fd..a65d357 100644
98--- a/tests/lib/prepare-all.sh
99+++ b/tests/lib/prepare-all.sh
100@@ -6,12 +6,13 @@ if [ -n "$SNAP_CHANNEL" ] ; then
101 exit 0
102 fi
103
104-# Setup classic snap and build the network-manager snap in there
105+# Setup classic snap and build the pulseaudio snap in there
106 snap install --devmode --beta classic
107 cat <<-EOF > /home/test/build-snap.sh
108 #!/bin/sh
109 set -ex
110 apt update
111+apt upgrade --yes --force-yes
112 apt install -y --force-yes snapcraft
113 cd /home/pulseaudio
114 snapcraft clean
115diff --git a/tests/lib/prepare.sh b/tests/lib/prepare.sh
116index 4b360b5..60a45e9 100644
117--- a/tests/lib/prepare.sh
118+++ b/tests/lib/prepare.sh
119@@ -31,12 +31,12 @@ if [ -n "$SNAP_CHANNEL" ] ; then
120 echo "USING-CHANNEL"
121 else
122 echo "INSTALLING-PULSEAUDIO-SNAP"
123- # Install prebuilt pulseaudio snap
124+ # Install prebuilt pulseaudio snap but first install if from
125+ # the store to work around the fact that we are not allowed
126+ # anymore to connect pulseaudio slot to a snap installed with
127+ # --dangerous
128+ snap install --beta pulseaudio
129 snap install --dangerous /home/pulseaudio/pulseaudio_*_amd64.snap
130- # As we have a snap which we build locally its unasserted and therefor
131- # we don't have any snap-declarations in place and need to manually
132- # connect all plugs.
133- snap connect pulseaudio:client pulseaudio:service
134 fi
135
136 # Snapshot of the current snapd state for a later restore

Subscribers

People subscribed via source and target branches