diff options
author | Kevin Hilman <khilman@linaro.org> | 2015-08-04 12:25:25 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-08-04 12:25:25 -0700 |
commit | 0c9561b6f843fad1954e32ed780842f9b6750938 (patch) | |
tree | 806f7e581c7c6d1e595e8df8c7dbf3c616e84c0d /init | |
parent | bd4e9a26373331ef6f185500c72a8836eb7c82d9 (diff) | |
parent | 7bcb35707461da71ab35d102536810b1876a7762 (diff) |
Merge branch 'android-3.14' of https://android.googlesource.com/kernel/common into linux-linaro-lsk-v3.14-android
* 'android-3.14' of https://android.googlesource.com/kernel/common:
usb: gadget: fix NULL ptr derefer while symlinking PTP func
uid_cputime: Iterates over all the threads instead of processes.
uid_cputime: fix cputime overflow
initramfs: Add skip_initramfs command line option
cpu_power: Avoids race condition when the task exits.
of: add empty of_find_node_by_path() for !OF
uid_cputime: Avoids double accounting of process stime, utime and cpu_power in task exit.
Shrink ashmem directly through shmem_fallocate
cpufreq: Iterate over all the possible cpus to create powerstats.
sched: cpufreq: update power usage only if cpufreq_stat is enabled
Diffstat (limited to 'init')
-rw-r--r-- | init/Makefile | 3 | ||||
-rw-r--r-- | init/initramfs.c | 19 | ||||
-rw-r--r-- | init/noinitramfs.c | 9 |
3 files changed, 26 insertions, 5 deletions
diff --git a/init/Makefile b/init/Makefile index 7bc47ee31c36..692b91f1c1d4 100644 --- a/init/Makefile +++ b/init/Makefile @@ -3,11 +3,8 @@ # obj-y := main.o version.o mounts.o -ifneq ($(CONFIG_BLK_DEV_INITRD),y) obj-y += noinitramfs.o -else obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o -endif obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o ifneq ($(CONFIG_ARCH_INIT_TASK),y) diff --git a/init/initramfs.c b/init/initramfs.c index 93b61396756b..23906ce84634 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 __initdata char *message; static void __init error(char *x) @@ -579,9 +580,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) { diff --git a/init/noinitramfs.c b/init/noinitramfs.c index 267739d85179..bcc8bcb053ee 100644 --- a/init/noinitramfs.c +++ b/init/noinitramfs.c @@ -21,11 +21,16 @@ #include <linux/stat.h> #include <linux/kdev_t.h> #include <linux/syscalls.h> +#include <linux/kconfig.h> +#include <linux/initramfs.h> /* * Create a simple rootfs that is similar to the default initramfs */ -static int __init default_rootfs(void) +#if !IS_BUILTIN(CONFIG_BLK_DEV_INITRD) +static +#endif +int __init default_rootfs(void) { int err; @@ -49,4 +54,6 @@ out: printk(KERN_WARNING "Failed to create a rootfs\n"); return err; } +#if !IS_BUILTIN(CONFIG_BLK_DEV_INITRD) rootfs_initcall(default_rootfs); +#endif |