diff options
author | Rom Lemarchand <romlem@android.com> | 2015-07-06 16:50:33 -0700 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2016-02-16 13:54:10 -0800 |
commit | 05f5cf60a4696fe63510581f530c8e8f74c9327b (patch) | |
tree | d16640467e21de3e9c03ea0b7c40abbbb21c37d6 /init/initramfs.c | |
parent | 558c05dbb5aa0ed678462f78b0e1d0e966d2281f (diff) |
initramfs: Add skip_initramfs command line option
Add a skip_initramfs option to allow choosing whether to boot using
the initramfs or not at runtime.
Change-Id: If30428fa748c1d4d3d7b9d97c1f781de5e4558c3
Signed-off-by: Rom Lemarchand <romlem@google.com>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r-- | init/initramfs.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index b32ad7d97ac9..f8ce812ba43e 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -18,6 +18,7 @@ #include <linux/dirent.h> #include <linux/syscalls.h> #include <linux/utime.h> +#include <linux/initramfs.h> static ssize_t __init xwrite(int fd, const char *p, size_t count) { @@ -605,9 +606,25 @@ static void __init clean_rootfs(void) } #endif +static int __initdata do_skip_initramfs; + +static int __init skip_initramfs_param(char *str) +{ + if (*str) + return 0; + do_skip_initramfs = 1; + return 1; +} +__setup("skip_initramfs", skip_initramfs_param); + static int __init populate_rootfs(void) { - char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); + char *err; + + if (do_skip_initramfs) + return default_rootfs(); + + err = unpack_to_rootfs(__initramfs_start, __initramfs_size); if (err) panic("%s", err); /* Failed to decompress INTERNAL initramfs */ if (initrd_start) { |