0

I've been using Gentoo for over 15 years now and decided to replace one of my machines with a brand new AMD Ryzen machine. But: I can't get it to boot with a custom kernel, whilst the standard genkernel kernel ("genkernel all") boots up just fine.

Here's what I did: I set up gentoo on a new machine with two NVMe storage devices according to the gentoo handbook. My / is an ext4 formatted fs on a LV, whose VG/PV is residing on a raid1. To get things booting up fast, I decided to go with the "allmighty kernel" by doing a genkernel all (which is the gentoo-way of building a very generic kernel like it is used on live-media). I installed grub2 onto an ESP on the first NVMe device (after failing with RAID1 for the ESP).

Reboot, machine comes up. Now I took the kernel config from the genkernel build and menuconfig-ed it. I unticked a whole lot of device drivers and other options, bearing in mind that (from experience) I'd still have to fine-tune the kernel config later.

However, I ended up with a kernel that does not boot at all. When I select the custom built kernel via grub, the machine is stuck at the following:

  Booting a command list

Loading Linux 5.4.38-gentoo-x86_64 ...
Loading initial ramdisk ...

It doesn't matter whether i choose the initramfs from the initial "almighty-genkernel-build" or the initramfs built from my custom kernel. As soon as I try to boot my custom kernel, the machine completely locks up after it says "Loading initial ramdisk ...".

What I tried to fix it:

  • I completely wiped the ESP and reinstalled the kernels and GRUB2 onto it
  • I ran GRUB2 with "set debug=all", but it essentially only told me about loading stuff from the ESPs FAT filesystem
  • I checked against https://wiki.gentoo.org/wiki/Ryzen and corrected some config values, with no success
  • I did quite some research on the web and fiddled with stuff like random.trust_cpu=on/off

Here's my hardware specs:

  • AMD Ryzen 5 3600
  • ASUS B450M-A
  • 4x8GB Kingston HyperX DDR4-2666
  • Kingston KC2000 256GB NVMe PCIe SSD

For me it drills down to these questions:

  • Is my assumption correct that there is an issue with my custom built kernel? Why would the system immediately lock up when I try to boot it and leave everything else untouched?
  • Which kernel config could be the culprit here? I already invested quite some hours and can't see menuconfig clearly anymore ;)

Thanks for any advice!

UPDATE for more info:

  • The kernel sources for the genkernel build and the custom build are exactly the same. Meaning that both were built from the package sys-kernel/gentoo-sources 5.4.38. No un-/install of the sources was done between the builds.
  • I got both versions of the kernel and initramfs image on my boot partition. So I could and did test also with exactly the same grub.cfg by interactively editing the kernel file name before boot.
1
  • "I unticked a whole lot of device drivers and other options, ... I ended up with a kernel that does not boot at all." -- Is this not the obvious cause and effect? Since you have a bootable system, you could analyze what drivers are required, and then verify that they are built in the custom version. In order debug kernel booting, you need a system console that is displaying the kernel messages, e.g. a serial port that can be captured to a file. Compare the successful boot log versus the failing one (e.g. with sdiff).
    – sawdust
    Commented Jun 14, 2020 at 20:23

2 Answers 2

1

Here's the answer:

Enabling CONFIG_FB_NVIDIA for me totally locks up the system at boot. The nasty thing about that is, that it locks up before the kernel prints anything to the console (presumably during initialization of graphics/console). That said, it seems like there's an incompatibility or bug when running on a system with a Zotac GT710 PCIe x1 graphics card.

Disable that option and the kernel boots.

0

A few things to probe off the top of my head;

Did you also try the new kernel with the exact-(as possible) same config, only menuconfiging the minimum differences? Could be an unexpected module dependency for some new hardware tech

Have you tried doing a second mkinitcpio -P linux and grub-mkconfig after building?

Are the kernel-sources the same for your genkernel and custom build?

Do you have any more luck with something like Debian-sources? Could be patched support differences between distro kernels

8
  • ty for the pointers! I edited some more information in my initial question. I like your idea of doing a custom kernel build with very genkernel-style config. Will try that next.
    – binary_jam
    Commented Jun 14, 2020 at 17:06
  • so this works: i took the genkernel config, deselected a few device drivers i will never need. this kernel works just fine. i could now trim the config down in iterations, but i already invested like two hours on my config which is missing perhaps only a single essential config parameter... :/
    – binary_jam
    Commented Jun 14, 2020 at 17:55
  • Lol I feel that pain, menuconfig can be torture sometimes Commented Jun 14, 2020 at 17:57
  • One drastically under-sold option is taking the working and non-working config files, diffing them and playing around with it in an actual text editor Commented Jun 14, 2020 at 17:59
  • 1
    yeah, i already looked into the diff. but the problem is, that the genkernel config really has EVERYTHING selected there is. but now that we're talking about: the missing flag actually can't be one that's selected to be built as module. this narrows it down A LOT, since genkernel builds mostly modules...
    – binary_jam
    Commented Jun 14, 2020 at 18:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .