Trying to build 5.17.0-rc8 for Gentoo

Hey

I am trying to build my own 5.17.0-rc8 kernel, using a modified version of the sys-kernel/vanilla-kernel ebuild on Gentoo. The goal is to publish the ebuild to make it easier for Gentoo users to build their own kernel…

This differs from the Debian based kernel in the sysimage V3 in that is uses Fedora’s kernel configuration as the base configuration. Other than that, I think what I’m doing is very similar to what the Debian build process does. However, I am unable to boot my system. The kernel loads and it then loads the initramfs, but then the initramfs gets stuck.

When building the kernel, here is what I do:

  • Download the source from kernel .org
  • Download the Fedora arm64 kernel configuration
  • Combine that with the minimal sysimage v3 kernel configuration
  • Apply the patches from sysimage v3
  • I replace the dts file contained in the mainline kernel with that from mnt

Then I build an initramfs using dracut. Finally I try to boot the system. It then gets stuck in the initramfs. I am not sure if the problem is my kernel or the initramfs to be honest. Maybe it’ just a module I’m missing…

You can find the kernel configuration, dracut configuration and the serial output of the boot process here: Unable to boot Linux kernel 5.17.0-rc8 on my mnt reform 2, configuration and debug information. ($1206) · Snippets · Niklaus Hofer / pastebin · GitLab

Please let me know if you can see what’s wrong. I have been unable to figure it out so far.

I have since cleaned up and posted an ebuild for building the kernel on Gentoo: sys-kernel/mnt-reform2-kernel/mnt-reform2-kernel-5.17.0.ebuild · master · Niklaus Hofer / mnt-reform2-overlay · GitLab

The ebuild works in that it compiles the kernel, but it still suffers from the same problem as explained above :frowning:

Since I come from Debian land and know nothing about Fedora or Gentoo I cannot offer much but I had a look at the bits you posted and as far as I can see, the important kernel options are set and the necessary modules are loaded. Maybe something you can do to debug this is to open a shell from within your initramfs and then have a look around to see whether some important things like device nodes are missing? Since it gets stuck with the initramfs I think you should try to see if you can further debug what gets executed and thus figure out where it gets “stuck”.

1 Like

Thank you for checking on the Kernel configuration and the loaded modules. This helps as now I can focus my efforts on debugging the initrd.

Unfortunately I am running into a spot of trouble with that. While I have no problem getting output from the serial port, I cannot manage to send back any input. I double-checked my wiring and I think it should be OK, but nothing happens :frowning: Not in u-boot and not in the initrd. And since my kernel / initrd seem unable to turn on the laptop screen, I cannot use tty1 for debugging…

Meanwhile, booting the box so many times, trying different things, I have noticed one error message that comes up almost every time. Maybe it’s meaningless, but it looks suspicious:

[drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@30800000/mipi-dsi@30a00000 to encoder None-31: -517

Maybe you have the opposite problem of the one I had. I had an FTDI232 set to 3.3V connected to S1/J18 of the Reform like this: https://mister-muffin.de/p/M8dC.jpg https://mister-muffin.de/p/t7No.jpg but got no output at all. It turns out, the RX pin of S1 on my Reform is broken (TX and GND work). I can send input but I receive nothing. Maybe you have the opposite problem and your TX is broken and that’s why you see the output but cannot type anything? Since you are not debugging u-boot but your initrd, maybe it helps to adjust your kernel cmdline to use S2 instead of S1. Just replace console=ttymxc0,115200 with console=ttymxc1,115200 and you will get output on S2 instead of S1 and hopefully your TX on S2 works. :slight_smile:

Lukas said once on IRC that this message is just noise: 2022-01-24.log

Indeed the hardest problem for me to solve was to get the display to turn on because when I built too much stuff as modules it just wouldn’t happen. That’s what the module list is for that has to be loaded via the initramfs. If your initramfs is not doing the right thing maybe this results in the modules not getting loaded as expected and that’s why your display remains off?

My hero! That works as described. Nice.

I will let you know what I find.

@minute seems like I’m not the only one with a broken S1 connection.

Oh, that`s not really a fair assessment. I own a beta unit and I was fully aware of what I was getting myself into when I purchased it. Additionally I might very well have broken that port at some point, maybe by connecting it incorrectly to a wonky adapter or something of that sort…