On Wednesday, 31 July 2019 23:31:20 BST Jack wrote: > I just built a new PC, and I'm having a problem getting it to boot with > a custom configured kernel (gentoo-sources-5.2.4.) If I start with a > blank config and work through "make xconfig" the resulting kernel and > initramfs (genkernel) doesn't boot (just hangs after loading > initramfs.) Does it spit out any errors on the console? > So, starting with the config from the running kernel from > the live install medium, running make oldconfig then genkernel, it > boots fine. I assume my problem is removing something important while > trying to remove all the unnecessary options for supporting hardware > I'll never use. > > However, if I start with the .config which workd, and "make xconfig" > and select "Supported processor types" under "Processor type and > features" and then unselect "Support Intel Pprocessors" (I have a > Ryzen) and save the config, it decreases the size of .config from 169K > to under 13K, losing almost every setting in the file. Hmm ... this sound too light for a desktop kernel. I have done the same, stripping out anything not relevant or wanted on my laptop's AMD kernel and this is what I get: $ ls -la /usr/src/linux/.config -rw-r--r-- 1 root root 106014 Jul 31 17:13 /usr/src/linux/.config However, I use menuconfig almost exclusively, but this should not make any difference. Did you diff the old and new .config files? [1] > Even stranger, if I look at "Local version - append to kernel release:" > it still shows the value I had previously set - but that setting > CONFIG_LOCALVERSION is NOT in .config. If I close the tool and start > it again, that setting is now missing and it looks like all settings > have been reset to the clean starting defaults (i.e., many say "(NEW)" > > Am I missing something here, or might this really be a bug in "make > xconfig" ? Have you checked the /usr/src/linux symlink is pointing to the correct kernel sources directory? What you describing is akin to you working on the wrong .config file. > Can anyone else replicate this? While I don't think it's related to my > problem getting a non-booting kernel, it certainly has me confused. > > Thanks for helping me confirm what's left of my sanity. > > Jack I don't have time to replicate it this morning, but in case you're missing some simple step in your procedure, try this: cd /usr/src ls -la check the linux symlink is pointing to the desired kernel sources directory. If not remove it and re-set it either manually, or by using 'eselect kernel'. Then copy the running config to the symlinked linux directory, overwriting the sources' config file with its default settings. zcat /proc/config.gz > /usr/src/linux/.config Now you can go into the linux directory and modify its config: cd linux make xconfig When you're done tweaking things make sure you save your changes before you make clean && make && make modules_install && make install The last bit copies over the kernel for you to /boot if you don't want to do this manually or use your own naming convention. For more details have a look here: https://wiki.gentoo.org/wiki/Kernel/Configuration HTH. -- Regards, Mick