Skip to content

Commit

Permalink
riscv: Do not overwrite initrd_start and initrd_end
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
groeck authored and palmer-dabbelt committed Sep 5, 2018
1 parent 5736184 commit e866d3e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions arch/riscv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,8 @@ atomic_t hart_lottery;
#ifdef CONFIG_BLK_DEV_INITRD
static void __init setup_initrd(void)
{
extern char __initramfs_start[];
extern unsigned long __initramfs_size;
unsigned long size;

if (__initramfs_size > 0) {
initrd_start = (unsigned long)(&__initramfs_start);
initrd_end = initrd_start + __initramfs_size;
}

if (initrd_start >= initrd_end) {
printk(KERN_INFO "initrd not found or empty");
goto disable;
Expand Down

0 comments on commit e866d3e

Please sign in to comment.