summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch
diff options
context:
space:
mode:
authorBogdan Purcareata <bogdan.purcareata@nxp.com>2016-02-29 15:27:59 +0000
committerBruce Ashfield <bruce.ashfield@windriver.com>2016-03-09 00:11:35 -0500
commita4aa3e7852e40870f49f830f74c77366eb5a32f3 (patch)
tree9271d4e09dc9f9e84158fb80e1f92adeeb13f192 /recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch
parent2e752968eaa349310843cc2434fdc2c1fb6194c9 (diff)
downloadmeta-virtualization-a4aa3e7852e40870f49f830f74c77366eb5a32f3.tar.gz
lxc: upstream fixes for lxc-execute
These patches address some warnings that LXC throws when running an application container. They are currently applied in the official repository. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch')
-rw-r--r--recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch b/recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch
new file mode 100644
index 00000000..751a7ac6
--- /dev/null
+++ b/recipes-containers/lxc/files/lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch
@@ -0,0 +1,39 @@
1From 81e3c9cf8b2f230d761738da28e9dc69fb90ec46 Mon Sep 17 00:00:00 2001
2From: Bogdan Purcareata <bogdan.purcareata@nxp.com>
3Date: Fri, 8 Jan 2016 15:38:44 +0000
4Subject: [PATCH] lxc_setup_fs: Create /dev/shm folder if it doesn't exist
5
6When running application containers with lxc-execute, /dev is
7populated only with device entries. Since /dev is a tmpfs mount in
8the container environment, the /dev/shm folder not being present is not
9a sufficient reason for the /dev/shm mount to fail.
10
11Create the /dev/shm directory if not present.
12
13Upstream-status: Accepted
14[https://github.com/lxc/lxc/commit/81e3c9cf8b2f230d761738da28e9dc69fb90ec46]
15
16Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
17Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
18---
19 src/lxc/initutils.c | 4 ++++
20 1 file changed, 4 insertions(+)
21
22diff --git a/src/lxc/initutils.c b/src/lxc/initutils.c
23index 45df60f..8d9016c 100644
24--- a/src/lxc/initutils.c
25+++ b/src/lxc/initutils.c
26@@ -47,6 +47,10 @@ extern void lxc_setup_fs(void)
27 if (mount_fs("proc", "/proc", "proc"))
28 INFO("failed to remount proc");
29
30+ /* if /dev has been populated by us, /dev/shm does not exist */
31+ if (access("/dev/shm", F_OK) && mkdir("/dev/shm", 0777))
32+ INFO("failed to create /dev/shm");
33+
34 /* if we can't mount /dev/shm, continue anyway */
35 if (mount_fs("shmfs", "/dev/shm", "tmpfs"))
36 INFO("failed to mount /dev/shm");
37--
381.9.1
39