aboutsummaryrefslogtreecommitdiffstats
path: root/main/mkinitfs
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-02-07 22:23:57 +0200
committerTimo Teräs <timo.teras@iki.fi>2015-02-07 22:25:15 +0200
commite962f2315811c61fe8170cf015da2a17347c37f8 (patch)
tree2e6caff26cd71278dc97b8a75bcb5c3db000982e /main/mkinitfs
parent955a9c8c8b71e85240363109bbae904e97715b47 (diff)
downloadaports-e962f2315811c61fe8170cf015da2a17347c37f8.tar.bz2
aports-e962f2315811c61fe8170cf015da2a17347c37f8.tar.xz
main/mkinitfs: overlaytmpfs support
requires 3.18+ kernel
Diffstat (limited to 'main/mkinitfs')
-rw-r--r--main/mkinitfs/0002-support-for-tmpfs-overlay-over-root.patch55
-rw-r--r--main/mkinitfs/APKBUILD3
2 files changed, 57 insertions, 1 deletions
diff --git a/main/mkinitfs/0002-support-for-tmpfs-overlay-over-root.patch b/main/mkinitfs/0002-support-for-tmpfs-overlay-over-root.patch
new file mode 100644
index 0000000000..cbeeef99e6
--- /dev/null
+++ b/main/mkinitfs/0002-support-for-tmpfs-overlay-over-root.patch
@@ -0,0 +1,55 @@
+From af4168c70ec5fc1982c83dc22d75de2ba6aa30d8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Sat, 7 Feb 2015 22:21:32 +0200
+Subject: [PATCH] support for tmpfs overlay over root
+
+useful if wanting to optimize boot time, and do device updates
+via read-only system image. package management is not too useful
+in these situations.
+---
+ features.d/base.modules | 1 +
+ initramfs-init.in | 14 ++++++++++++--
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/features.d/base.modules b/features.d/base.modules
+index 038335d..f8f271d 100644
+--- a/features.d/base.modules
++++ b/features.d/base.modules
+@@ -1 +1,2 @@
+ kernel/drivers/block/loop.ko
++kernel/fs/overlayfs
+diff --git a/initramfs-init.in b/initramfs-init.in
+index 6357965..fd3e510 100755
+--- a/initramfs-init.in
++++ b/initramfs-init.in
+@@ -387,7 +387,8 @@ eval set -- `cat /proc/cmdline`
+
+ myopts="alpine_dev autodetect autoraid chart cryptroot cryptdm debug_init
+ dma init_args keep_apk_new modules ovl_dev pkgs quiet root_size root
+- usbdelay ip alpine_repo apkovl alpine_start splash blacklist"
++ usbdelay ip alpine_repo apkovl alpine_start splash blacklist
++ overlaytmpfs"
+
+ for opt; do
+ case "$opt" in
+@@ -544,7 +545,16 @@ if [ -n "$KOPT_root" ]; then
+ start_$i
+ done
+ ebegin "Mounting root"
+- retry_mount -o ro $KOPT_root $sysroot 2>/dev/null
++ if [ "$KOPT_overlaytmpfs" = "yes" ]; then
++ mkdir -p /media/root-ro /media/root-rw $sysroot/media/root-ro $sysroot/media/root-rw
++ retry_mount -o ro $KOPT_root /media/root-ro 2>/dev/null
++ mount -t tmpfs root-tmpfs /media/root-rw
++ mkdir -p /media/root-rw/work /media/root-rw/root
++ mount -t overlay -o lowerdir=/media/root-ro,upperdir=/media/root-rw/root,workdir=/media/root-rw/work overlayfs $sysroot
++ else
++ retry_mount -o ro $KOPT_root $sysroot 2>/dev/null
++ fi
++
+ eend $?
+ cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
+ if [ "$DIR" != "/" -a "$DIR" != "$sysroot" -a -d "$DIR" ]; then
+--
+2.2.2
+
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD
index efbdc4da89..e09b40233e 100644
--- a/main/mkinitfs/APKBUILD
+++ b/main/mkinitfs/APKBUILD
@@ -2,7 +2,7 @@
pkgname=mkinitfs
pkgver=2.7.1
_ver=${pkgver%_git*}
-pkgrel=2
+pkgrel=3
pkgdesc="Tool to generate initramfs images for Alpine"
url=http://git.alpinelinux.org/cgit/mkinitfs
depends="busybox apk-tools>=2.0 lddtree>=1.25"
@@ -10,6 +10,7 @@ install="$pkgname.pre-upgrade"
triggers="$pkgname.trigger=/usr/share/kernel/*"
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$_ver.tar.xz
0001-init-fix-splash-fifo-and-make-config-file-optional.patch
+ 0002-support-for-tmpfs-overlay-over-root.patch
"
arch="noarch"
license="GPL-2"