diff options
author | Danct12 <danct12@disroot.org> | 2021-06-09 03:59:07 +0700 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-06-10 07:01:41 +0000 |
commit | 3696cb0079025d1e8458b8056372b53449ebc6a2 (patch) | |
tree | 41a3a56e665999646bdca9670fe92366eff67f91 | |
parent | 4912f35331109b40e3f442ce1426fc5d4971a9be (diff) |
main/lxc: skip rootfs pinning for read-only rootfs
Without this patch, read-only rootfs containers fails to start.
-rw-r--r-- | main/lxc/APKBUILD | 10 | ||||
-rw-r--r-- | main/lxc/skip-rootfs-pinning-for-ro-fs.patch | 28 |
2 files changed, 35 insertions, 3 deletions
diff --git a/main/lxc/APKBUILD b/main/lxc/APKBUILD index a6378e514cb..56121cf6172 100644 --- a/main/lxc/APKBUILD +++ b/main/lxc/APKBUILD @@ -4,7 +4,7 @@ pkgname=lxc pkgver=4.0.9 _pkgver=${pkgver/_rc/.rc} -pkgrel=0 +pkgrel=1 pkgdesc="Userspace interface for the Linux kernel containment features" url="https://linuxcontainers.org/lxc/" arch="all" @@ -44,6 +44,7 @@ subpackages=" source="https://linuxcontainers.org/downloads/lxc/lxc-$_pkgver.tar.gz lxc.initd lxc.confd + skip-rootfs-pinning-for-ro-fs.patch " # secfixes: @@ -167,6 +168,9 @@ bashcomp() { rmdir "$pkgdir"/etc/bash_completion.d } -sha512sums="4ef9d9efdd4118fdffde8b49c6ae71cf5eb060be51daaa4f4ceb804c743fbf3278e6518e6a694faefc720f2834f98ac48d67842d589a2120b8f7ec4c3b61fa84 lxc-4.0.9.tar.gz +sha512sums=" +4ef9d9efdd4118fdffde8b49c6ae71cf5eb060be51daaa4f4ceb804c743fbf3278e6518e6a694faefc720f2834f98ac48d67842d589a2120b8f7ec4c3b61fa84 lxc-4.0.9.tar.gz b74ffe7c3e8f193265a90ffeb6e5743b1212bc1416b898e5a7e59ddd7f06fc77dc34e2dcbb3614038ac6222a95e2b9beb9f03ab734c991837203ab626b1b091f lxc.initd -91de43db5369a9e10102933514d674e9c875218a1ff2910dd882e5b9c308f9e430deacb13d1d7e0b2ed1ef682d0bb035aa6f8a6738f54fa2ca3a05acce04e467 lxc.confd" +91de43db5369a9e10102933514d674e9c875218a1ff2910dd882e5b9c308f9e430deacb13d1d7e0b2ed1ef682d0bb035aa6f8a6738f54fa2ca3a05acce04e467 lxc.confd +c2fdfe838ea2b41737d096209c62fb7fdd1c27e1012c88a76a3221ee1180eb0a62fc607c9957723163362d3648cf0b47e95159bec5396de7cdd60cc12c0607d6 skip-rootfs-pinning-for-ro-fs.patch +" diff --git a/main/lxc/skip-rootfs-pinning-for-ro-fs.patch b/main/lxc/skip-rootfs-pinning-for-ro-fs.patch new file mode 100644 index 00000000000..2242eb5c427 --- /dev/null +++ b/main/lxc/skip-rootfs-pinning-for-ro-fs.patch @@ -0,0 +1,28 @@ +From e859a5ee2cdee5111185a6a629f891aa40b2ffd6 Mon Sep 17 00:00:00 2001 +From: Wei Mingzhi <weimingzhi@baidu.com> +Date: Tue, 18 May 2021 20:37:52 +0800 +Subject: [PATCH] Skip rootfs pinning for read-only file system. + +Signed-off-by: Wei Mingzhi <weimingzhi@baidu.com> +--- + src/lxc/conf.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +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); + |