diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2015-12-09 20:54:41 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2015-12-09 20:54:41 +0530 |
commit | df86aeb236c68b66939da25e27ba2d76c810de89 (patch) | |
tree | 1435e8a9197feae2572ac192ef74b2fe813a7129 /init | |
parent | 6844488aaa6b23d45106c9c3c3ba2f2ee4a612f9 (diff) | |
parent | b8f1ef571f89e753d861f87150feb75f5be61bc4 (diff) |
Merge branch 'android-4.1' of https://android.googlesource.com/kernel/common
* android-4.1: (481 commits)
net: pppopns: pppolac: fix sendmsg function calls
UPSTREAM: HID: hid-input: allow input_configured callback return errors
Revert "HID: Add input_register callback."
mmc: Extend wakelock if bus is dead
Revert "mmc: mmcblk: Add support for deferred SD bus resume"
Revert "mmc: block: Remove call to mmc_blk_set_blksize"
fiq_debugger: Build fixes for 4.1
trace: cpufreq: Add tracing for min/max cpufreq
tracing/sched: Add trace events to track cpu hotplug.
of: Fix build warnings
android: configs: base: enable configfs gadget functions
android: add CONFIG_DEBUG_RODATA to recommended config
android: configs: remove CONFIG_BATTERY_ANDROID=y
android: configs: base: enable IPV6
android: configs: Enable SELinux and its dependencies.
android: base-cfg: disable ALARM_DEV
android: base-cfg: turn off /dev/mem and /dev/kmem
android: base-cfg: enable ARMV8_DEPRECATED and subfeatures
android: base-cfg: enforce the needed XFRM_MODE_TUNNEL (for VPN)
android: base-cfg: disable LOGGER
...
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 ad1bd7787bbb..d39079e690fa 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) { 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 |