aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2017-03-19 21:01:47 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-03-19 21:01:47 +1100
commit82d5c5c1f33aa0cdf43ae36c5aa89154686f2101 (patch)
treef32158672a8d8e504accd9a5394b0f4430e0b375 /init
parent709a09859398eb3ae251f6c82e098f8c88bf9c6d (diff)
initramfs: provide a way to ignore image provided by bootloader
Many "embedded" architectures provide CMDLINE_FORCE to allow the kernel to override the command line provided by an inflexible bootloader. However there is currrently no way for the kernel to override the initramfs image provided by the bootloader meaning there are still ways for bootloaders to make things difficult for us. Fix this by introducing INITRAMFS_FORCE which can prevent the kernel from loading the bootloader supplied image. We use CMDLINE_FORCE (and its friend CMDLINE_EXTEND) to imply that the system has an inflexible bootloader. This allow us to avoid presenting this config option to users of systems where inflexible bootloaders aren't usually a problem. Link: http://lkml.kernel.org/r/20170217121940.30126-1-daniel.thompson@linaro.org Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/initramfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 981f286c1d16..bf7707b44988 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -611,7 +611,7 @@ static int __init populate_rootfs(void)
char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
if (err)
panic("%s", err); /* Failed to decompress INTERNAL initramfs */
- if (initrd_start) {
+ if (initrd_start && !IS_ENABLED(CONFIG_INITRAMFS_FORCE)) {
#ifdef CONFIG_BLK_DEV_RAM
int fd;
printk(KERN_INFO "Trying to unpack rootfs image as initramfs...\n");