summaryrefslogtreecommitdiff
diff options
authorMichael Vogt <michael.vogt@gmail.com>2016-07-15 14:42:59 +0200
committerGitHub <noreply@github.com>2016-07-15 14:42:59 +0200
commit680b7bc9d7708fa0b57c666a025249defc66d6f2 (patch)
tree54ece00a2f3b25315eae7ab59a6fb43ad6dec915
parent9e3545edad541ca69e95fac84ddc7acfa4f05132 (diff)
parent977b2d160764d2e381f8e20a3fbe81591dfe217b (diff)
Merge pull request #85 from snapcore/mount-lib-modules
Bind mount /lib/modules on classic
-rw-r--r--debian/usr.bin.snap-confine1
-rw-r--r--spread-tests/regression/lp-1597839/task.yaml15
-rw-r--r--src/mount-support.c1
3 files changed, 17 insertions, 0 deletions
diff --git a/debian/usr.bin.snap-confine b/debian/usr.bin.snap-confine
index 33e6cf03be..b635b327d9 100644
--- a/debian/usr.bin.snap-confine
+++ b/debian/usr.bin.snap-confine
@@ -106,6 +106,7 @@
mount options=(rw rbind) /var/tmp/ -> /tmp/snap.rootfs_*/var/tmp/,
mount options=(rw rbind) /run/ -> /tmp/snap.rootfs_*/run/,
mount options=(rw rbind) /media/ -> /tmp/snap.rootfs_*/media/,
+ mount options=(rw rbind) /lib/modules/ -> /tmp/snap.rootfs_*/lib/modules/,
mount options=(rw bind) /snap/ubuntu-core/*/etc/alternatives/ -> /tmp/snap.rootfs_*/etc/alternatives/,
# Allow to mkdir /var/lib/snapd/hostfs
diff --git a/spread-tests/regression/lp-1597839/task.yaml b/spread-tests/regression/lp-1597839/task.yaml
new file mode 100644
index 0000000000..587229e061
--- /dev/null
+++ b/spread-tests/regression/lp-1597839/task.yaml
@@ -0,0 +1,15 @@
+summary: Regression check for https://bugs.launchpad.net/snap-confine/+bug/1597839
+# This is blacklisted on debian because debian doesn't use apparmor yet
+systems: [-debian-8]
+details: |
+ The snappy execution environment should contain the /lib/modules directory
+ from the host filesystem when running on a classic distribution
+prepare: |
+ echo "Having installed the snapd-hacker-toolbelt snap"
+ snap install snapd-hacker-toolbelt
+execute: |
+ cd /
+ echo "We can ensure that the /lib/modules/$(uname -r) directory exists"
+ /snap/bin/snapd-hacker-toolbelt.busybox test -d /lib/modules/$(uname -r)
+restore: |
+ snap remove snapd-hacker-toolbelt
diff --git a/src/mount-support.c b/src/mount-support.c
index cdc4e85e69..72b6b62bda 100644
--- a/src/mount-support.c
+++ b/src/mount-support.c
@@ -205,6 +205,7 @@ void setup_snappy_os_mounts()
"/var/tmp", // to get access to the other temporary directory
"/run", // to get /run with sockets and what not
"/media", // access to the users removable devices
+ "/lib/modules", // access to the modules of the running kernel
};
for (int i = 0; i < sizeof(source_mounts) / sizeof *source_mounts; i++) {
const char *src = source_mounts[i];