summaryrefslogtreecommitdiff
path: root/target/linux/patches/3.14.40/initramfs-nosizelimit.patch
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-02 23:12:07 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-02 23:12:07 +0200
commit231c256c60513e21ccbdf59490ab9ccec1cf4cfc (patch)
tree12c88dc409d9ea9e6188d18b261890ef33388451 /target/linux/patches/3.14.40/initramfs-nosizelimit.patch
parent797d8166b79d3f2dc06922222aa36d0e39aae8f2 (diff)
parenta8428de05cd6ad86dba8444de78a64294d4ddb5e (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'target/linux/patches/3.14.40/initramfs-nosizelimit.patch')
-rw-r--r--target/linux/patches/3.14.40/initramfs-nosizelimit.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/patches/3.14.40/initramfs-nosizelimit.patch b/target/linux/patches/3.14.40/initramfs-nosizelimit.patch
new file mode 100644
index 000000000..40d2f6bd8
--- /dev/null
+++ b/target/linux/patches/3.14.40/initramfs-nosizelimit.patch
@@ -0,0 +1,57 @@
+From 9a18df7a71bfa620b1278777d64783a359d7eb4e Mon Sep 17 00:00:00 2001
+From: Thorsten Glaser <tg@mirbsd.org>
+Date: Sun, 4 May 2014 01:37:54 +0200
+Subject: [PATCH] mount tmpfs-as-rootfs (initramfs) with -o
+ nr_blocks=0,nr_inodes=0
+
+I would have preferred to write this patch to be able to pass
+rootflags=nr_blocks=0,nr_inodes=0 on the kernel command line,
+and then hand these rootflags over to the initramfs (tmpfs)
+mount in the same way the kernel hands them over to the block
+device rootfs mount. But at least the Debian/m68k initrd also
+parses $rootflags from the environment and adds it to the call
+to the user-space mount for the eventual root device, which
+would make the kernel command line rootflags option be used in
+both places (tmpfs and e.g. ext4) which is guaranteed to error
+out in at least one of them.
+
+This change is intended to aid people in a setup where the
+initrd is the final root filesystem, i.e. not mounted over.
+This is especially useful in automated tests running on qemu
+for boards with constrained memory (e.g. 64 MiB on sh4).
+
+Considering that the initramfs is normally emptied out then
+overmounted, this change is probably safe for setups where
+initramfs just hosts early userspace, too, since the tmpfs
+backing it is not accessible any more later on, AFAICT.
+
+Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
+---
+ init/do_mounts.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/init/do_mounts.c b/init/do_mounts.c
+index 82f2288..55a4cfe 100644
+--- a/init/do_mounts.c
++++ b/init/do_mounts.c
+@@ -594,6 +594,7 @@ out:
+ }
+
+ static bool is_tmpfs;
++static char tmpfs_rootflags[] = "nr_blocks=0,nr_inodes=0";
+ static struct dentry *rootfs_mount(struct file_system_type *fs_type,
+ int flags, const char *dev_name, void *data)
+ {
+@@ -606,6 +607,9 @@ static struct dentry *rootfs_mount(struct file_system_type *fs_type,
+ if (IS_ENABLED(CONFIG_TMPFS) && is_tmpfs)
+ fill = shmem_fill_super;
+
++ if (is_tmpfs)
++ data = tmpfs_rootflags;
++
+ return mount_nodev(fs_type, flags, data, fill);
+ }
+
+--
+2.0.0.rc0
+