View previous topic :: View next topic |
Author |
Message |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 3:43 pm Post subject: First Kernel Config isn't booting |
|
|
Hey there!
I have been using Gentoo for a bit now, and finally wanted to try my hand at configuring my own kernel.
I took @Pietinger's great 'Installation Guide for Paranoid Dummies' as a reference, as it is the most detailed guide I could find.
This is the second iteration of my first kernel config, as the first already wasn't able to boot, but after double checking everything, I still couldn't get it working :(
If anyone here would be so kind and tell me the relvevant locations of logs or the kernel's config in a human-readable format, I'll gladly post them as a reply here, because just me saying 'my machine won't boot' isn't really helping much. :)
P.S: I'm trying it in a VM, so that I can make save states and what not.
Thanks so much in advance! :D |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
Posted: Sun May 28, 2023 4:02 pm Post subject: |
|
|
If you try booting a kernel in a VM then you must take care to enable all virtual kernel modules which are necessary. So please check which (virtual) hardware your VM provides !
Do you have any output (errors) from this kernel ? (If not then it is possibly a problem with graphics modules)
(If you are able to boot another live distribution in your VM then do a "lspci -k" (first important) and a lsmod (2nd important) to check which modules are needed)
If your boot is reaching the point where it creates a systemlog, then you can look into /var/log/messages (but its unlikely).
(Booting a kernel IN a VM can be different than booting it on bare metal, because it is possible you need different modules)
(P.S. Thanks a lot for your compliment ) |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Sun May 28, 2023 4:57 pm Post subject: |
|
|
4761,
Booting you first hand made kernel is hard. That it doesn't work is not a surprise.
Practising in a VM adds a layer of complexity and gives you a kernel that probably won't work on the real hardware too.
Virtualisation solutions can work in two ways.
They will all expose virtual hardware, which is not related to your real hardware at all.
Tryon the host and the guest. Any similarities are purely coincidence.
Some virtualisation solutions offer paravirtualisation. The requires support from both the host and guest.
It gives you devices that have no real hardware likeness with the advantage of being faster.
Anyway, since practising in a VM will help you learn the method but not give you a kernel that will run on your real hardware, I suggest you don't do that.
It's painless, other than won't boot, to practice on the real hardware. You must practice in a kernel with a different version to your working everyday kernel.
This way your kernel files are kept separate in /boot and the modules are installed in different directories under /lib/modules/ named for the kernel versions.
You can have several kernel installed at the same time and choose at boot time, if you want your everyday working kernel, or your maybe broken testing kernel.
Your boot media is not required.
Pick a kernel that has a different kernel version to your working kernel to play with.
Everyone builds a dud kernel from time to time too, so you always want several kernels to choose from.
There are rarely any logs from kernel boot fails as the root filesystem must be mounted read/write before there is anywhere to save logs.
It helps if you understand the PC Boot Process too. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 5:10 pm Post subject: |
|
|
Thank you! I didn't actually look into lsmod (must have overread that :P).
It might actually be a graphics issue then, because I after grub I get Gentoo-6.1.28 ... and the screen just turns black.
I do have some logs in /var/log/messages, but I am not sure whether these are related to this boot or the initial chroot.
Thank you for pointing that out, NeddySeaGoon! I was trying to do everything from scratch as my laptop isn't currently running Gentoo, but I'm planning to. Are there things that weren't covered in @pietinger's guide regarding notebook compatibility?
Also, I probably need WIFI and bluetooth to work, is not removing them from the USE-Flags enough for them to work without much hassle? :)
@Pietinger, in your guide you mention to activate Intel's IOMMU support for Intel CPUs. I cannot find that option within the current kernel's config, did it get removed?
Thanks to both of you! I will keep this in mind, but since I already spent a couple of hours tinkering with this VM, I want to at least get it to boot properly. :P
I am going to depart from some of the things pietinger recommends in his guide, while hoping that it doesn't break anything. :D |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 5:26 pm Post subject: |
|
|
There actually are loads of messages in the /var/log/messages after all!
Should I just paste them here, or is something like pastebin more appropriate here?
The last error that is being shown is this:
Code: | May 28 19:11:42 gent kernel: EXT4-fs (sda2): re-mounted. Quota mode: none.
May 28 19:11:43 gent last message buffered 1 times
May 28 19:11:44 gent kernel: FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. |
Is this enough for you to help me diagnose some of the issues? Otherwise I'll put the entire logs here! :)
Thanks a lot for helping me out! :D |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Sun May 28, 2023 5:35 pm Post subject: |
|
|
4761,
WiFi is not straight forward. Bluetooth is a bit easier.
They are both in several parts. The kernel part, the firmware, the user space tools and the configuration. All the parts need to come together in the right order.
There is a wiki page for Wifi. I'll let you find it.
I don't use Bluetooth.
Grub prints something like before it exits and passes control to the kernel.
Some notebook vendors have a kernel option. You will need that if your notebook vendor is listed.
Don't worry too much about WiFI. There is always Sneakernet to get the distfiles you need.
Since that post was made in 2006, /usr/portage/distfiles has moved to /var/cache/distfiles
Make your Gentoo work first then add bits to what you know works.
If you mean Installation Guide for Paranoid Dummies, I can't read it as its in German. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
Posted: Sun May 28, 2023 5:52 pm Post subject: |
|
|
4761,
Configuring your own kernel needs some experience ... the first I would recommend is: Read always the help ... not only the text ... moreover the last section ... where you can find something like "Selects", and/or "Selected by" and/or "Depends on:"
The second recommendation is the use of /
Search with / (in "make menuconfig") for the text: "INTEL_IOMMU"
Here you will get the same output as you would get with <Help> WITHOUT help-text, BUT you will get the important last section where you can see:
Quote: | Depends on: IOMMU_SUPPORT [=y] && PCI_MSI [=y] && ACPI [=y] && (X86 [=y] || IA64) |
I guess you are missing PCI_MSI ... (maybe) ... search again for PCI_MSI and you will get the information:
Code: | Location:
-> Device Drivers
-> PCI support (PCI [=y])
-> Message Signaled Interrupts (MSI and MSI-X) (PCI_MSI [=y]) |
Just enable it
I think your main problem is with framebuffer, because you see last grubs action and then a black screen (we had many threads with this thema ).
Here I would need the output of "lspci -k" (from VM) and your kernel .config-file (please use wgetpaste for this.)
The next problem could be with your first partition ... I asume it is your ESP-/boot-partition (because formatted with FAT32) ... just do a fschk for it.
WIFI and blutoot and Sound we can do later (you will need some kernel modules for it AND Use-flags; so please dont disable any Use-flags or kernel options meanwhile). We have great Wiki-articles for this (I can lead you the way if you want). |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Sun May 28, 2023 6:07 pm Post subject: |
|
|
4761,
You can't put the entire log here. It's far too big. The forums silently truncate long posts at 64k.
Install wgetpaste and put big things onto a pastebin site.
It can be used for both files and command output.
Helpers know to quote the interesting bits.
The entire log would be good to see as it probably contains error messages.
While we are guessing though, I'm with pietinger on missing/broken framebuffer support. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 6:17 pm Post subject: |
|
|
pietinger wrote: | 4761,
Configuring your own kernel needs some experience ... the first I would recommend is: Read always the help ... not only the text ... moreover the last section ... where you can find something like "Selects", and/or "Selected by" and/or "Depends on:"
The second recommendation is the use of /
Search with / (in "make menuconfig") for the text: "INTEL_IOMMU"
Here you will get the same output as you would get with <Help> WITHOUT help-text, BUT you will get the important last section where you can see:
Quote: | Depends on: IOMMU_SUPPORT [=y] && PCI_MSI [=y] && ACPI [=y] && (X86 [=y] || IA64) |
I guess you are missing PCI_MSI ... (maybe) ... search again for PCI_MSI and you will get the information:
Code: | Location:
-> Device Drivers
-> PCI support (PCI [=y])
-> Message Signaled Interrupts (MSI and MSI-X) (PCI_MSI [=y]) |
Just enable it
I think your main problem is with framebuffer, because you see last grubs action and then a black screen (we had many threads with this thema ).
Here I would need the output of "lspci -k" (from VM) and your kernel .config-file (please use wgetpaste for this.)
The next problem could be with your first partition ... I asume it is your ESP-/boot-partition (because formatted with FAT32) ... just do a fschk for it.
WIFI and blutoot and Sound we can do later (you will need some kernel modules for it AND Use-flags; so please dont disable any Use-flags or kernel options meanwhile). We have great Wiki-articles for this (I can lead you the way if you want). |
Thank you! I'll give that a try.
Here are the two outputs you have requested, thanks again to the both of you, for taking your time to help me out.
lscpi -k
.config
[Moderator edit: I have disabled the Disable of BBCode - so it is enabled -- pietinger] |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Sun May 28, 2023 6:20 pm Post subject: |
|
|
4761,
What virtualisation solution are you using?
Is it configured to offer BIOS or UEFI to the guest?
It rooks like whatever it is, it matches Grub as grub starts.
It can matter for framebuffer support.
Only UEFI can use EFI_Framebuffer.
Only BIOS can use VESA or VGA16. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 6:24 pm Post subject: |
|
|
I am currently using VirtualBox, it is configured to use UEFI. :) |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
Posted: Sun May 28, 2023 6:42 pm Post subject: |
|
|
Surely you have found yourself that you have not enabled even one framebuffer module ... Just do it
These both are needed only in your VM:
Code: | 00:02.0 VGA compatible controller: VMware SVGA II Adapter
Subsystem: VMware SVGA II Adapter
Kernel driver in use: vmwgfx
Kernel modules: vmwgfx
[...]
00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
Kernel driver in use: vboxguest
Kernel modules: vboxguest |
If you want change later to a kernel booting your bare machine you have to change it again ...
... AND ... I think you will not have a (very old) native IDE interface when using your bare machine:
Code: | 00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
Kernel driver in use: ata_piix
Kernel modules: pata_acpi, ata_generic |
So, please dont forget to change all this if you use your kernel not in a VM.
BTW:
Code: | CONFIG_EXTRA_FIRMWARE="intel-ucode/06-97-00 intel-ucode/06-97-01 intel-ucode/06-97-02 intel-ucode/06-97-04"] |
You will need only ONE of them (not all). Just look into your system log with "dmesg | grep Intel" and see what is the output. Mine is:
Code: | [ 4.362825] smpboot: CPU0: 13th Gen Intel(R) Core(TM) i9-13900K (family: 0x6, model: 0xb7, stepping: 0x1) |
(look at "stepping") |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 6:43 pm Post subject: |
|
|
Okay, so I did add the options that @pietinger recommended, and I can login now!!
Thanks a lot, I'm going to play around with it now and come back here if some things aren't going as expected.
This is a nice feeling to have a custom kernel (somewhat?) running for the first time.  |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Sun May 28, 2023 6:46 pm Post subject: |
|
|
4761,
In that case it will use EFI Framebuffer.
You will want which is the driver for the fake graphics card provided by Virtual Box.
Strictly speaking, it will only be required for a GUI.
will be your console driver.
is required as all console drivers, even legacy 80x25 text are framebuffer implementations now.
Code: | FRAMEBUFFER_CONSOLE | is required for any framebuffer console at all. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
Posted: Sun May 28, 2023 6:51 pm Post subject: |
|
|
4761 wrote: | This is a nice feeling to have a custom kernel (somewhat?) running for the first time.  |
YES ... I know this feeling
4761 wrote: | Thanks a lot, I'm going to play around with it now and come back here if some things aren't going as expected. |
You are very welcome !
Have fun with Gentoo !  |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 6:52 pm Post subject: |
|
|
NeddySeagoon wrote: | 4761,
In that case it will use EFI Framebuffer.
You will want which is the driver for the fake graphics card provided by Virtual Box.
Strictly speaking, it will only be required for a GUI.
will be your console driver.
is required as all console drivers, even legacy 80x25 text are framebuffer implementations now.
Code: | FRAMEBUFFER_CONSOLE | is required for any framebuffer console at all. |
Thank you, I now have a booting system.
There appears to be one more issue, I am using NetworkManager (I am a University student and configuring eduroam without it is quite annoying.).
It appears to start, but seems to be inactive.
tells me that the Network is unreachable. I am now going to look into the Wiki on why this may be happening.
Thanks for all the help and I'm sure you'll hear from me again once I inevitably run into more issues  |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
Posted: Sun May 28, 2023 7:23 pm Post subject: |
|
|
4761,
before a month I have got my new machine ... and - as always - I have logged all my actions.
Because you know my german guide you maybe interested in my steps. I have copied it here:
https://wiki.gentoo.org/wiki/User:Pietinger/temp/delete_me |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Sun May 28, 2023 8:17 pm Post subject: |
|
|
thank you very much I'll give this a read through  |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Sun May 28, 2023 8:30 pm Post subject: |
|
|
4761,
How have you set up the Virtualbox network. (In Virtualbox).
In the Network settings for your VM, there is a dropdown Attached to:
Choose Bridged adapter if you want the guest to be like any other system on your network.
This is the most useful but it requires another IP address. You may not be allowed that on eduroam.
Choose NAT Network to hide the guest behind the VirtualBox provided NAT.
This works for connections initiated by the guest.
It shares the hosts IP address.
To reach the guest from the host, or anywhere outside of the host, you will need to set up port forwarding in VirtualBox.
The other options are mostly not useful. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Mon May 29, 2023 3:54 pm Post subject: |
|
|
NeddySeagoon wrote: | 4761,
How have you set up the Virtualbox network. (In Virtualbox).
In the Network settings for your VM, there is a dropdown Attached to:
Choose Bridged adapter if you want the guest to be like any other system on your network.
This is the most useful but it requires another IP address. You may not be allowed that on eduroam.
Choose NAT Network to hide the guest behind the VirtualBox provided NAT.
This works for connections initiated by the guest.
It shares the hosts IP address.
To reach the guest from the host, or anywhere outside of the host, you will need to set up port forwarding in VirtualBox.
The other options are mostly not useful. |
Sorry, there seems to be a misunderstanding.
I am not planning to use this VM for anything meaningful, I'm rather using it as a 'playground' for me to play around with at the moment.
Once I feel comfortable enough, I will configure the Kernel on my actual hardware and will then need the NetworkManager WiFi capabilities. Sorry for the confusion. |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Mon May 29, 2023 3:56 pm Post subject: |
|
|
I do have one more question, you seems to always be using
why is that? Doesn't the -p stand for pretend? Whenever I run it, either as root or a normal user, it only shows me what would happen, and doesn't actually do anything.
Do you emerge again, after using -pv so that it's only being used to check what is being installed?  |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5428 Location: Bavaria
|
Posted: Mon May 29, 2023 4:08 pm Post subject: |
|
|
4761 wrote: | I do have one more question, you seems to always be using
why is that? Doesn't the -p stand for pretend? Whenever I run it, either as root or a normal user, it only shows me what would happen, and doesn't actually do anything. |
Yes, this is correct. I have this in my notices because I do it always before I run the same command without "p" to see what would happen and moreover which Use-flags are set.
... and it is for safety not to do something what is not liked.
4761 wrote: | Do you emerge again, after using -pv so that it's only being used to check what is being installed?  |
Yes ... I do the same as in most articles in Wiki with one difference: They use an "--ask" instead "-p" ... I am using "pretend" because it was the first option at that time ("--ask" was introduced later; and I am an old man with old habbits  |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54920 Location: 56N 3W
|
Posted: Mon May 29, 2023 4:26 pm Post subject: |
|
|
4761,
The VM has no networking of its own. The host has to provide it.
As well as the two ways I described, there is a third way. If the host supports it, the host can "pass through" real hardware to the guest.
The downside of that is that the host cannot use that hardware, so "pass through" is often not useful.
You can practice NetworkManager in the VM. The underlying transport is almost irrelevant.
To practice setting up real hardware, the real hardware needs to be available. That's often not possible in a VM. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
4761 n00b

Joined: 08 Mar 2023 Posts: 54
|
Posted: Mon May 29, 2023 8:52 pm Post subject: |
|
|
I do have another question.
I'm not at the point where I'll be installing the DE (in my case KDE). It tells me that there are circular dependencies and how to fix them.
The question that I now have is:
Should I install this single dependency with the
option?
I've read that it causes the package not to be added to the world file, but I'm unsure whether or not it is warranted in scenarios such as this one.
The Wiki does show examples where is being used, but it doesn't elaborate whether or not it is really necessary for circular dependencies  |
|
Back to top |
|
 |
|