Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Initramfs-less System, Kernel Modules = M
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
MajorJalepino
n00b
n00b


Joined: 26 Jul 2022
Posts: 34

PostPosted: Wed Apr 10, 2024 2:37 pm    Post subject: [SOLVED] Initramfs-less System, Kernel Modules = M Reply with quote

Hi all, here's hoping Neddy sees this.

Current stack I'm trying to achieve:

1. Bootload with GRUB
2. Minimal kernel, device drivers = M as per .config below
3. No initramfs
4. systemd

Issue:
I can get grub to begin loading the kernel, but this stack doesn't seem to load the amdgpu driver, and potentially others. I get the grub message "loading kernel 6.6.21-gentoo ..." then the message drops away, my screen stops receiving a signal and the lights on my GPU turn off, boot seems to hang?

Is this even possible? I'm not interested in having an initramfs, but I want granular control of the modules, for no other reason than that this is Gentoo.

I've been working on this install from a linux mint livecd for a couple days now, I can't for the life of me work out how to get a dmesg to try and work out the issue myself. I'm sure I've just got the wrong idea about how the boot process works and what systemd can do. I've tried to ssh into the box from my laptop, but I don't think that's possible since I can't get the correct IP address (do I even need this? I don't know if systemd is loading the sshd in this sequence).

Do I need to start a special service with systemd? Do actually need to add them to load.modules.d? Do I need to build the firmware blobs into the kernel? I have found no resources online to suggest these cases because udev(?) is supposed to detect and load all of this.

Anyways, obligatory dpaste links:

Kernel .config:

http://dpaste.com/6VGK2J68L

lspci -nnk:

http://dpaste.com/AFW593QBF

emerge --info installkernel

http://dpaste.com/GM6FDRCNU

emerge --info gentoo-sources

http://dpaste.com/6U78536LT

emerge --info linux-firmware

http://dpaste.com/BJ4B73BUC

grub.cfg:

http://dpaste.com/BMKH8XBL4

modules in /usr/lib/firmware:

http://dpaste.com/GUE99QQ8J

fstab

http://dpaste.com/HKRRP9FUW


Last edited by MajorJalepino on Wed Apr 10, 2024 4:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1920

PostPosted: Wed Apr 10, 2024 2:52 pm    Post subject: Reply with quote

Code:
# CONFIG_FRAMEBUFFER_CONSOLE is not set

Without this setting enabled in the kernel, nothing will be displayed on a UEFI system.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Wed Apr 10, 2024 2:53 pm    Post subject: Reply with quote

MajorJalepino,

you have two problems: You have an invisible kernel panic !

It is invisible because you miss:
Code:
# CONFIG_FRAMEBUFFER_CONSOLE is not set

( https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_Configuring_Kernel_Version_6.6#Part_3_-_Must_Haves )

and the kernel panics because you build important modules as <M>odule instead statically into the kernel:
Code:
CONFIG_SCSI_MOD=m
CONFIG_SCSI_COMMON=m
CONFIG_SCSI=m
CONFIG_SCSI_DMA=y
CONFIG_BLK_DEV_SD=m
CONFIG_SATA_AHCI=m
CONFIG_CHR_DEV_SG=m
CONFIG_BLK_DEV_BSG=y

(all other modules you need to access the harddisk/ssd are statically; e.g. you XFS root partition file system: CONFIG_XFS_FS=y So, this is good)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
MajorJalepino
n00b
n00b


Joined: 26 Jul 2022
Posts: 34

PostPosted: Wed Apr 10, 2024 3:12 pm    Post subject: Reply with quote

Hey mate,

Thanks for reply, my boot device is a PCIE nvme and I have no SATA devices at all. The xhci and scsi modules will be for my USB devices.

I'll add in the console framebuffer and retry for more output, that won't stop the kernel panic though does it?

Do you know if I can have modules loaded without an initramfs?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Wed Apr 10, 2024 3:13 pm    Post subject: Reply with quote

You will need SCSI ALWAYS (even with a M.2 nvme) ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Wed Apr 10, 2024 3:16 pm    Post subject: Reply with quote

MajorJalepino wrote:
Do you know if I can have modules loaded without an initramfs?

Usually the kernel will load modules if they are requested; so, your AMD GPU modules should be loaded automatically. Because you have them as <m>odule enabled they will load also the firmware automatically. See more here: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Driver_needs_Firmware
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1920

PostPosted: Wed Apr 10, 2024 3:17 pm    Post subject: Reply with quote

MajorJalepino wrote:
Do you know if I can have modules loaded without an initramfs?

The kernel cannot load modules on its own. Critical functions that are needed to start the rootfs must be static in the kernel or modules inside an initramfs.
Once the rootfs is mounted and available, the kernel starts the init process. Secondary modules can be loaded by init's services (often with udev or specifically configured).
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Wed Apr 10, 2024 3:19 pm    Post subject: Reply with quote

P.S.: Please do not confuse XHCI (-> USB 3.0) with AHCI (Advance Host Controller Interface) ... :lol:
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
MajorJalepino
n00b
n00b


Joined: 26 Jul 2022
Posts: 34

PostPosted: Wed Apr 10, 2024 3:59 pm    Post subject: Reply with quote

Booted! Did not change anything to do with SATA, fbdev support was set to no.

As you can see from below, AHCI and SCSI are built as modules here, I honestly can't recall what I specifically I changed.

grknight, I believe all I need to do for the kernel is make the rootfs accesible by telling it how to access it and showing it where it is. An initramfs is not necessary in my opinion, I've built in fs support and an NVME driver. Rest is being loaded by systemd here.

DMESG:

https://bpa.st/ND7A

Lsmod:

https://bpa.st/R7NQ

lspci -nnk:

https://bpa.st/6AQQ[/u]
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22657

PostPosted: Wed Apr 10, 2024 4:56 pm    Post subject: Reply with quote

The point posters were making above is that if you have no initramfs, then your kernel has no access to modules until after the rootfs is successfully mounted. From that, if the kernel does not have built-in support for the mass storage device holding your rootfs, the partition scheme of that device, and the filesystem you used for root, then it will not be able to mount the rootfs. It is very common for people to try to use a module for a core component like this, fail, and come to us for help. Therefore, one of the first things we check is whether the kernel can, without using any modules, mount rootfs.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1920

PostPosted: Wed Apr 10, 2024 5:03 pm    Post subject: Reply with quote

As long as you don't want sound or wifi, this looks complete.

Sound is completely off:
Code:
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_PCI is not set

WiFi doesn't work because of no IWLMVM:
Code:
CONFIG_IWLWIFI=m
# CONFIG_IWLMVM is not set
Back to top
View user's profile Send private message
MajorJalepino
n00b
n00b


Joined: 26 Jul 2022
Posts: 34

PostPosted: Wed Apr 10, 2024 9:28 pm    Post subject: Reply with quote

Thanks for the pickup on the sound and wifi!

I don't know what causes it, but when I get to the prompt, I keep getting boot messages posting to the screen, as in writing over the top of the prompt.

I had this issue on an earlier base install, I've mananged to somewhat fix it by setting printk console loglevel to 1 for quiet mode in the kernel, but I feel like this isn't a rigorous fix.

Thoughts here?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Thu Apr 11, 2024 12:55 am    Post subject: Reply with quote

MajorJalepino wrote:
I don't know what causes it, but when I get to the prompt, I keep getting boot messages posting to the screen, as in writing over the top of the prompt.

I had this issue on an earlier base install, I've mananged to somewhat fix it by setting printk console loglevel to 1 for quiet mode in the kernel, but I feel like this isn't a rigorous fix.

Thoughts here?

What happens if you add the parameter "quiet" to your
Code:
CONFIG_CMDLINE="root=PARTUUID=4f68bce3-e8cd-4db1-96e7-fbcaf984b709 rootfstype=xfs init=/usr/lib/systemd/systemd"

_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3005
Location: Edge of marsh USA

PostPosted: Thu Apr 11, 2024 2:00 am    Post subject: Re: [SOLVED] Initramfs-less System, Kernel Modules = M Reply with quote

MajorJalepino wrote:
...
Is this even possible? I'm not interested in having an initramfs, but I want granular control of the modules, for no other reason than that this is Gentoo.
...

Definitely possible, as you have already learned. I only have an initrd is to load Intel microcode. My AMD CPU systems have no initrd at all.
Code:
initrd   /boot/intel-uc.img

Everything is built-into the kernel or loaded as modules, and I don't load that many modules. A very slim custom kernel without initrd will probably only boot on the hardware to which it has been customized. One of the primary purposes of an initramfs is hardware discovery. Not everybody needs that.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
MajorJalepino
n00b
n00b


Joined: 26 Jul 2022
Posts: 34

PostPosted: Thu Apr 11, 2024 9:22 am    Post subject: Reply with quote

I set the quiet printk loglevel in the kernel to 1, and I'm using grub to pass it to ther kernel currently.

It's remedied the log messages error but it feels like thats not the correct solution

What would be causing that error in the first place?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5109
Location: Bavaria

PostPosted: Thu Apr 11, 2024 2:27 pm    Post subject: Reply with quote

MajorJalepino wrote:
What would be causing that error in the first place?

I dont think you are getting error messages (*). I think you will get only normal messages (e.g. from USB saying kernel found a device). Now if your systemstart is very fast AND some devices are slow then you have the login screen before everything is done ... and kernel gives you messages. The only way I know to handle this is the parm "quiet". Maybe another solution would be to inject a rc-script in the system startup which does nothing else than waiting a little bit (but TBH I don't think it's worth the effort.)

*) Because: If there would be a real ERROR message from kernel you would see it anyway - even with parm "quiet".
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
MajorJalepino
n00b
n00b


Joined: 26 Jul 2022
Posts: 34

PostPosted: Thu Apr 11, 2024 3:08 pm    Post subject: Reply with quote

Makes sense to me, correct there are no error messages, just journalctl and some other services just spilling into the screen.

I enabled the performance governor as per your wiki article Pete which probably turbos the boot time.

I'm happy with my boot setup now, case closed.
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
Page 1 of 1

 
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