Added patch to skip rootfs pinning for read-only filesystem
which fixes below issue:

lxc-start[1559]: Error: oap: conf - conf.c:lxc_rootfs_init:581
- Read-only file system - Failed to pin rootfs
lxc-start[1744]: Error: node1: conf - conf.c:lxc_rootfs_init:581
- Read-only file system - Failed to pin rootfs
lxc-start[1745]: Error: ivi: conf - conf.c:lxc_rootfs_init:581
- Read-only file system - Failed to pin rootfs

Signed-off-by: Sana Kazi <[email protected]>
Signed-off-by: Sana Kazi <[email protected]>
---
 ...tfs_pinning_for_read_only_filesystem.patch | 30 +++++++++++++++++++
 recipes-containers/lxc/lxc_4.0.9.bb           |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 
recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch

diff --git 
a/recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch
 
b/recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch
new file mode 100644
index 0000000..c29d996
--- /dev/null
+++ 
b/recipes-containers/lxc/files/skip_rootfs_pinning_for_read_only_filesystem.patch
@@ -0,0 +1,30 @@
+From e859a5ee2cdee5111185a6a629f891aa40b2ffd6 Mon Sep 17 00:00:00 2001
+From: Wei Mingzhi <[email protected]>
+Date: Tue, 18 May 2021 20:37:52 +0800
+Subject: [PATCH] Skip rootfs pinning for read-only file system.
+
+Signed-off-by: Wei Mingzhi <[email protected]>
+---
+ src/lxc/conf.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+Upstream-Status: Backport 
[https://github.com/lxc/lxc/commit/966dad2494dda4948f1508bcd0e444f1d65b2df8.patch]
+Comment: No change in any hunk
+
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index 7a248c2685..4b427c08d2 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -573,8 +573,12 @@ int lxc_rootfs_init(struct lxc_conf *conf, bool userns)
+                        PROTECT_OPEN | O_CREAT,
+                        PROTECT_LOOKUP_BENEATH,
+                        S_IWUSR | S_IRUSR);
+-      if (fd_pin < 0)
++      if (fd_pin < 0) {
++              if (errno == EROFS) {
++                      return log_trace_errno(0, EROFS, "Not pinning on 
read-only filesystem");
++              }
+               return syserror("Failed to pin rootfs");
++      }
+ 
+       TRACE("Pinned rootfs %d(.lxc_keep)", fd_pin);
diff --git a/recipes-containers/lxc/lxc_4.0.9.bb 
b/recipes-containers/lxc/lxc_4.0.9.bb
index 6720733..ad2416f 100644
--- a/recipes-containers/lxc/lxc_4.0.9.bb
+++ b/recipes-containers/lxc/lxc_4.0.9.bb
@@ -50,6 +50,7 @@ SRC_URI = 
"http://linuxcontainers.org/downloads/${BPN}/${BPN}-${PV}.tar.gz \
        file://dnsmasq.conf \
        file://lxc-net \
         file://enable_seccomp_profile_when_compiled_libseccomp.patch \
+        file://skip_rootfs_pinning_for_read_only_filesystem.patch \
        "
 
 SRC_URI[md5sum] = "365fcca985038910e19a1e0fff15ed07"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6772): 
https://lists.yoctoproject.org/g/meta-virtualization/message/6772
Mute This Topic: https://lists.yoctoproject.org/mt/85624255/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to