summaryrefslogtreecommitdiffstats
path: root/init/do_mounts_initrd.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2018-11-05 23:54:31 +0100
committerRob Herring <robh@kernel.org>2018-11-26 22:50:45 +0100
commit229c55ccb487c0c10721fdb92af874d7b8671cda (patch)
tree106a5cbaa9dcc187afb673f8baad4c9ac295cc65 /init/do_mounts_initrd.c
parentof/fdt: Remove custom __early_init_dt_declare_initrd() implementation (diff)
downloadlinux-229c55ccb487c0c10721fdb92af874d7b8671cda.tar.xz
linux-229c55ccb487c0c10721fdb92af874d7b8671cda.zip
arch: Move initrd= parsing into do_mounts_initrd.c
ARC, ARM, ARM64 and Unicore32 are all capable of parsing the "initrd=" command line parameter to allow specifying the physical address and size of an initrd. Move that parsing into init/do_mounts_initrd.c such that we no longer duplicate that logic. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'init/do_mounts_initrd.c')
-rw-r--r--init/do_mounts_initrd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 45865b72f4ea..732d21f4a637 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -27,6 +27,23 @@ static int __init no_initrd(char *str)
__setup("noinitrd", no_initrd);
+static int __init early_initrd(char *p)
+{
+ phys_addr_t start;
+ unsigned long size;
+ char *endp;
+
+ start = memparse(p, &endp);
+ if (*endp == ',') {
+ size = memparse(endp + 1, NULL);
+
+ phys_initrd_start = start;
+ phys_initrd_size = size;
+ }
+ return 0;
+}
+early_param("initrd", early_initrd);
+
static int init_linuxrc(struct subprocess_info *info, struct cred *new)
{
ksys_unshare(CLONE_FS | CLONE_FILES);