Skip to content

Commit e866d3e

Browse files
groeckpalmer-dabbelt
authored andcommitted
riscv: Do not overwrite initrd_start and initrd_end
setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size is larger than 0, which is always true even if there is no embedded initramfs. This prevents booting qemu with "-initrd" parameter. Overwriting initrd_start and initrd_end is not necessary since __initramfs_start and __initramfs_size are used directly in populate_rootfs() to load the built-in initramfs, so just drop that code. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 5736184 commit e866d3e

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

arch/riscv/kernel/setup.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,8 @@ atomic_t hart_lottery;
8585
#ifdef CONFIG_BLK_DEV_INITRD
8686
static void __init setup_initrd(void)
8787
{
88-
extern char __initramfs_start[];
89-
extern unsigned long __initramfs_size;
9088
unsigned long size;
9189

92-
if (__initramfs_size > 0) {
93-
initrd_start = (unsigned long)(&__initramfs_start);
94-
initrd_end = initrd_start + __initramfs_size;
95-
}
96-
9790
if (initrd_start >= initrd_end) {
9891
printk(KERN_INFO "initrd not found or empty");
9992
goto disable;

0 commit comments

Comments
 (0)