Skip to content

Commit 35e6fbe

Browse files
author
CKI KWF Bot
committed
Merge: Backport upstream commit "fs: Add 'initramfs_options' to set initramfs mount options
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1672 JIRA: https://issues.redhat.com/browse/RHEL-116977 Upstream commit 278033a ("fs: Add 'initramfs_options' to set initramfs mount options") allows for passing of options to the initial root file system so that there is more control over allocation of memory for this memory based file system. In the target case the memory requirement of kdump can be significantly reduced so that we will have less OOM issues with kdump. Signed-off-by: Ian Kent <ikent@redhat.com> Approved-by: Miklos Szeredi <mszeredi@redhat.com> Approved-by: Brian Foster <bfoster@redhat.com> Approved-by: Andrey Albershteyn <aalbersh@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 78ac74d + fbf7a73 commit 35e6fbe

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5962,6 +5962,9 @@
59625962

59635963
rootflags= [KNL] Set root filesystem mount option string
59645964

5965+
initramfs_options= [KNL]
5966+
Specify mount options for for the initramfs mount.
5967+
59655968
rootfstype= [KNL] Set root filesystem type
59665969

59675970
rootwait [KNL] Wait (indefinitely) for root device to show up.

fs/namespace.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ static int __init set_mphash_entries(char *str)
6666
}
6767
__setup("mphash_entries=", set_mphash_entries);
6868

69+
static char * __initdata initramfs_options;
70+
static int __init initramfs_options_setup(char *str)
71+
{
72+
initramfs_options = str;
73+
return 1;
74+
}
75+
76+
__setup("initramfs_options=", initramfs_options_setup);
77+
6978
static u64 event;
7079
static DEFINE_IDA(mnt_id_ida);
7180
static DEFINE_IDA(mnt_group_ida);
@@ -5521,7 +5530,7 @@ static void __init init_mount_tree(void)
55215530
struct mnt_namespace *ns;
55225531
struct path root;
55235532

5524-
mnt = vfs_kern_mount(&rootfs_fs_type, 0, "rootfs", NULL);
5533+
mnt = vfs_kern_mount(&rootfs_fs_type, 0, "rootfs", initramfs_options);
55255534
if (IS_ERR(mnt))
55265535
panic("Can't create rootfs");
55275536

0 commit comments

Comments
 (0)