ClangBuiltLinux / boot-utils

Collection of files for booting Linux kernels
26 stars 7 forks source link

mipsel failing to load initrd #13

Closed nickdesaulniers closed 1 year ago

nickdesaulniers commented 4 years ago

boot testing the patch in https://github.com/ClangBuiltLinux/linux/issues/786 via

$ ./boot-qemu.sh -a mipsel -k /android0/linux-next
...
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0100            4096 ram0 
 (driver?)

looks like

imeout 3m unbuffer qemu-system-mipsel -cpu 24Kf -machine malta -display none -initrd /android1/boot-utils/images/mipsel/rootfs.cpio -kernel /android0/linux-next/vmlinux -m 512m -nodefaults -serial mon:stdio

was what was run, which looks correct.

nathanchance commented 4 years ago

This is not a problem with the script. malta_defconfig does not enable CONFIG_BLK_DEV_INITRD, which we need to boot with initrd=. Our CI enables it as part of the extra configs: https://github.com/ClangBuiltLinux/continuous-integration/commit/c8a4bd0b0c5b3b0cd35274b761ccdfc7565790ee#diff-e51cef7f0a92ae0b41f56758c13f303cR38

I know we needed to test malta_defconfig but that’s part of the reason I wanted to switch us over to malta_kvm_guest_defconfig because it works as is.

nathanchance commented 2 years ago

Not an issue with the script, closing.

nickdesaulniers commented 2 years ago

Can the script provide a helpful warning that if we're booting mips, warn that the above config needs to be enabled? Otherwise I will forget, again.

nathanchance commented 2 years ago

I would rather not emit a warning unconditionally, as that is just noisy, and I am not sure of a way to check that the configuration is enabled through vmlinux. There is scripts/ikconfig, which requires CONFIG_IKCONFIG to be enabled, which is not in this particular config's case. Maybe running strings on the binary would work?

Alternatively, we could just try to use an ext4 image for MIPS, which may work with malta_defconfig as is.

I guess I'll reopen this and think of ways to improve this situation.

kees commented 2 years ago

Maybe send a patch for malta_defconfig to include CONFIG_BLK_DEV_INITRD? It doesn't seem unreasonable. :)

nathanchance commented 2 years ago

Maybe send a patch for malta_defconfig to include CONFIG_BLK_DEV_INITRD? It doesn't seem unreasonable. :)

Hmm, good point :)

Submitted: https://lore.kernel.org/r/20220208191726.1304731-1-nathan@kernel.org/

nathanchance commented 2 years ago

Patch accepted: https://git.kernel.org/mips/c/c47c7ab9b53635860c6b48736efdd22822d726d7

nathanchance commented 1 year ago

That patch is now in mainline, so I think we can consider this resolved for now. I can plumb a warning into the script if so desired but I would have to do some refactoring.

https://git.kernel.org/linus/c47c7ab9b53635860c6b48736efdd22822d726d7