From 78c27ecb0c274b0e292c4ac92a9a541e60d26dfe Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sun, 27 Sep 2020 11:17:09 +0800 Subject: [PATCH] init: Introduce config ROCKCHIP_ONE_INITRD This feature is conflict with Android 11 which has the generic ramdisk and the vendor ramdisk. Fixes: c44194873aab ("HACK: get ramdisk correct size with rk bootloader") Change-Id: I4d158862398973f3ca205fbbbaa48022c2903936 Signed-off-by: Tao Huang --- init/Kconfig | 8 ++++++++ init/initramfs.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig index a3d14d501b91..30e9ada9dfd1 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1231,6 +1231,14 @@ config INITRD_ASYNC help Init ramdisk async, can reduce kernel init time. +config ROCKCHIP_ONE_INITRD + bool "Detect only one initrd" + depends on ARCH_ROCKCHIP + default ARCH_ROCKCHIP + help + RK bootloader does not put a correct size to cmdline. + Directly return when we get a good initrd. + endif config INITCALL_ASYNC diff --git a/init/initramfs.c b/init/initramfs.c index e36a911e4dd2..4afd1987aeea 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -495,7 +495,7 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) error("junk in compressed archive"); if (state != Reset) error("junk in compressed archive"); - #ifdef CONFIG_ARCH_ROCKCHIP + #ifdef CONFIG_ROCKCHIP_ONE_INITRD else break; #endif