Subject: [alpine-aports] [PATCH] main/openrc: use overlayfs instead of unionfs for modloop

From: Mark White <[email-masked]>
Date: Sun, 21 Feb 2016 00:32:44 +0000

fixes #5144
---
As with unionfs, has no effect unless overlayfs loaded: ie need to
include modules=overlay,... in kernel command line.  Making this the
default would require a patch to alpine-iso too.

 main/openrc/APKBUILD      |    8 ++++----
 main/openrc/modloop.initd |   13 +++++++------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD
index d9dfec0..66cd737 100644
--- a/main/openrc/APKBUILD
+++ b/main/openrc/APKBUILD
@@ -2,7 +2,7 @@
 pkgname=openrc
 pkgver=0.19
 _ver=${pkgver/_git*/}
-pkgrel=3
+pkgrel=4
 pkgdesc="OpenRC manages the services, startup and shutdown of a host"
 url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git"
 arch="all"
@@ -90,7 +90,7 @@ d83df5513f08f09fa9e7353327701bf7  openrc.logrotate
 887eba592d487d6ffe2b42cfcd2813df  hwdrivers.initd
 41974f5408fd2e92892f891b58f2e49f  keymaps.initd
 0ece77eff8f163b36f6f0e7a6d422866  modules.initd
-9e6263773bf3af52e1abf81d8cab9098  modloop.initd
+91439e5e7cbf4bb4c9860e60694da168  modloop.initd
 27c22aa4e5cdba499ac9a0b6b9385f7d  networking.initd
 c1ec888202d868710b5749f7b217d1e3  modloop.confd
 bd51c5353d6dbbb34d929bf59097b232  consolefont.initd
@@ -109,7 +109,7 @@ dda515d7d906cebcf4137746939f3fdccc7f504fe097ef1dbf429e3e6773a013  hostname.initd
 6cb4d9ea3ad562bcf2697f61f5a76a10481d23f5dead570f82eff576eaca5236  hwdrivers.initd
 32562d39ade4092df8163c2e8cf0b31eeec06aa5713d343e1c487bfa6d9f7c84  keymaps.initd
 a145636e84547d76b8a188a94c0a76fcc266cd0f486be6cf24d2d74f03038118  modules.initd
-007034b7107a8c5ce0bd7750f906e2b42ff8d336d65123d1f2ce1c8e23ad21ea  modloop.initd
+e92994dfd5ad6b099eca7627e36dbbe1107c5862b46722c1e1e1b13d10276b60  modloop.initd
 66151b5cc199485ddd188528a0f22f081994721f04c15b33df38f41a5d08ea78  networking.initd
 a5a0316cd59f5401b1d789bb466c98186201277ba6f014017b14965fcc10c254  modloop.confd
 8a3f663e9ac14f62c3aef4121736a71edd676bdc9dd93c1d411f13a0e7ab4ee6  consolefont.initd
@@ -128,7 +128,7 @@ a3c2f419a3d475519cc8f78bd3baa26cae90a492a5fc92308b18931889db10452aa33324cca84890
 b51d95df7b692aaea3e14ed009d99b46b82500d505e2eeecb6a20136cee140aea4a7377a65ccc5c51fff64be7a50666be48616d179888eaeff9d35178a7a772b  hwdrivers.initd
 584ecbbcecb284527d7616790b6e337ace610e4b3cedf2993eca294bfbef54674aeaee3078b6c17d746a0c48b5a64a813c3534136915947e6f62a6fa206cd3ca  keymaps.initd
 7702e2704e4bcfad7c0736eec4cb0e8b20a685851afb5bd9022c5056ea78b8598a9402bae9644ae3268e2ff1c566e147cbb8d00e143491841682e4125fde2a75  modules.initd
-44b9e9ed3357563e33a9416bceeab22b729cee635ec29e8ece2307795b884fa167974d14b763dbfb2d2a7f34d21e7b6db36c2e371301ca03021c0260794745f0  modloop.initd
+c4de2292b5a175f082f4f80de5145746e4d97481fccb1d22f3a637e46c7c986ad4cd363cb1096312a4e338ce19c2bb4928d819a47e21a149fc36dba3b6dc1727  modloop.initd
 9aeba2c5cae539f16185b82c6e6e84c1b044e838749b92e8994172296d86ec3f1c674d62d54db1e08a8191e513ddb0ab3509f50ccae6cb5d7ba5ff5a5b6abb46  networking.initd
 aa702a7da8e6c0e5d8738febaf6b4e4cb021b30ce5c1809b530abf2b36739079446b16fc054740da8d86ed099942cf5deed6597cedb64c058f3def587a8b4689  modloop.confd
 c8d52d69692a00862cd55719174d7a260d5149f4951dd71196f5e9cebce3a75420a8815f0fe8b186d00b4d46739dc54542dae01a941605fcb1435f4385e444b7  consolefont.initd
diff --git a/main/openrc/modloop.initd b/main/openrc/modloop.initd
index f88d0a5..392569a 100644
--- a/main/openrc/modloop.initd
+++ b/main/openrc/modloop.initd
@@ -86,12 +86,13 @@ start() {
 		fi
 	fi
 
-	#use unionfs is available and configured
-	if grep -q -w "unionfs$" /proc/filesystems && [ -n "$unionfs_size" ]; then
-		ebegin "UnionFS detected. Mounting modloop rw"
-		mkdir -p /.modunisonfs/modules /lib/modules
-		mount -t tmpfs -o size="$unionfs_size" tmpfs /.modunisonfs/modules
-		mount -t unionfs -o dirs=/.modunisonfs/modules=rw:/.modloop/modules=ro unionfs /lib/modules
+	#use overlayfs if available and configured
+	if grep -q -w "overlay$" /proc/filesystems && [ -n "$unionfs_size" ]; then
+		ebegin "OverlayFS detected, mounting modloop rw"
+		mkdir -p /.modunisonfs /lib/modules
+		mount -t tmpfs -o size="$unionfs_size" tmpfs /.modunisonfs
+		mkdir -p /.modunisonfs/modules /.modunisonfs/work
+		mount -t overlay -o upperdir=/.modunisonfs/modules,lowerdir=/.modloop/modules,workdir=/.modunisonfs/work overlay /lib/modules
 		eend $? || return 1
 	else
 		rm -rf /lib/modules && ln -sf /.modloop/modules /lib/
-- 
1.7.10.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---