Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
First Kernel Config isn't booting
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 3:43 pm    Post subject: First Kernel Config isn't booting Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun May 28, 2023 4:02 pm    Post subject: Reply with quote

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 :D )
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun May 28, 2023 4:57 pm    Post subject: Reply with quote

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.
Try
Code:
lspci -nnk
on 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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 5:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 5:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun May 28, 2023 5:35 pm    Post subject: Reply with quote

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
Quote:
Gentoo-6.1.28
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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun May 28, 2023 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun May 28, 2023 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun May 28, 2023 6:11 pm    Post subject: Reply with quote

In the meantime you might check if you have all settings from here:
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_Configuring_Kernel_Version_6.1#Part_3_-_Must_Haves

... and if this gives you no output enable additionally these both:
Code:
[ ]   VGA 16-color graphics support
[ ]   Simple framebuffer support
Back to top
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 6:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun May 28, 2023 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 6:24 pm    Post subject: Reply with quote

I am currently using VirtualBox, it is configured to use UEFI. :)
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun May 28, 2023 6:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 6:43 pm    Post subject: Reply with quote

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. :D
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun May 28, 2023 6:46 pm    Post subject: Reply with quote

4761,

In that case it will use EFI Framebuffer.

You will want
Code:
DRM_VBOXVIDEO
which is the driver for the fake graphics card provided by Virtual Box.
Strictly speaking, it will only be required for a GUI.

Code:
FB_EFI
will be your console driver.
Code:
VGA_CONSOLE
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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun May 28, 2023 6:51 pm    Post subject: Reply with quote

4761 wrote:
This is a nice feeling to have a custom kernel (somewhat?) running for the first time. :D


YES ... I know this feeling :lol:

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 ! :D

Have fun with Gentoo ! 8)
Back to top
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 6:52 pm    Post subject: Reply with quote

NeddySeagoon wrote:
4761,

In that case it will use EFI Framebuffer.

You will want
Code:
DRM_VBOXVIDEO
which is the driver for the fake graphics card provided by Virtual Box.
Strictly speaking, it will only be required for a GUI.

Code:
FB_EFI
will be your console driver.
Code:
VGA_CONSOLE
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.
Code:
ping 1.1.1.1

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 :wink:
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun May 28, 2023 7:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Sun May 28, 2023 8:17 pm    Post subject: Reply with quote

pietinger wrote:
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


thank you very much I'll give this a read through :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sun May 28, 2023 8:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Mon May 29, 2023 3:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Mon May 29, 2023 3:56 pm    Post subject: Reply with quote

pietinger wrote:
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


I do have one more question, you seems to always be using
Code:
 emerge -pv

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Mon May 29, 2023 4:08 pm    Post subject: Reply with quote

4761 wrote:
I do have one more question, you seems to always be using
Code:
 emerge -pv

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Mon May 29, 2023 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
4761
n00b
n00b


Joined: 08 Mar 2023
Posts: 54

PostPosted: Mon May 29, 2023 8:52 pm    Post subject: Reply with quote

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
Code:
emerge --oneshot
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
Code:
--oneshot
is being used, but it doesn't elaborate whether or not it is really necessary for circular dependencies :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum