Dracut adding all amdgpu drivers to init image

Hello everyone! I have laptop HP 255 G7 which have AMD A6-9225 CPU and Radeon R4 (Stoney) GPU.
I have problem with dracut. It include all amdgpu drivers to initramfs and it slow down boot proces, systemd-analyze says initrd phase taking 19 seconds.
Can I somehow set up sracut to include only stoney binary?

P.S. Sorry my English.

You can limit what goes into your initial ram filesystem…

Create a custom dracut config in /etc/dracut.conf.d/amdgpu.conf`

Add omit_drivers+=" radeon " and limit the amount of firmware it includes with install_items+=" /lib/firmware/amdgpu/stoney_* "

Then rebuild the ram filesystem with dracut.

I used to do this to exclude the nouveau drivers when I used an Nv card.

Alternatively, you can create /etc/dracut.conf.d/hostonly.conf and include hostonly=yes which will probably give you a much, much smaller initramfs.

I already using hostonly parameter with strict mode, it give me 60 MB init image from 80.
omit_drivers parameter, as i know, exclude drivers from image.
Could you please tell more how I can use this parameter to solve my problem?

The initrd is not slow because it is a large file. It is slow because it is execution commands to get your system up and running.

You can see the time line by viewing the output of systemd-analyse plot >bootup.svg Then view the SVG file. Please don’t post here.

You will have to zoom in to read the text. But you will see that the initrd time overlaps with services starting.

Edit: I found that Firefox does a reasonable job displaying the SVG.

If you already have trimmed the initrd down to only those drivers that your host actually requires, then the issue is probably not the initial ram fs, it’ll be everything else starting up alongside it.

As @barryascott notes, have a look at the blame file and the plot output and see what’s taking a long time.

I know about systemd-analyze plot but I need exclude amdgpu drivers which not used on my laptop from init image, they also slowing down boot proces.

Yeah I know this hardware is weak but 19 seconds for initrd is not OK as I know…

Which drivers do you think are being added which you don’t need?

Dump your lsinitrd output and see what is actually being included.

I looked at lsinird and as I say all amdgpu drivers included. Not onlu for stoney which I need all binaries.

I’m confused. Do you use the amdgpu driver?
Your default target is the graphical.target?

If so why is loading in from the initrd slowing your boot time down?

The initrd time is not important as a metric as systemd is starting service once initrd is loaded. On my system services show up being started about .5s after the initrd loads.

The extra drivers will be ignored as there is not a PCI ID that will trigger the kernel to load them as I understand it.

Isn’t there a database of PCI ID to kernel driver that is used?

Yes, I’m using the amdgpu driver, and yes, the default target is graphical.target.

I also checked the boot time on Debian, and the boot issue was present there as well.

On Debian, I also tried removing plymouth, which requires loading the amdgpu drivers into the initrd to run, and that helped speed up the boot process. Debian does not display inird time in `systemd-analyze` output but it reduced boot time for 10 seconds

But I think removing plymouth is good solution, so I want just remove unused amdgpu drivers from initrd if it possible.

I tend to remove plymouth on most of my systems just so that I see the boot messages. You can do that by dnf remove of the packages with no problem.

I do not know about PCI ID database which are you talking about…
As I say in other reply plymouth can be trigger for loading all amdgpu drivers.

See boot messages is possible by pressing ESC during boot. And I also want keep plymouth in system…

From man dracut.conf

       omit_drivers+=" <kernel modules> "
           Specify a space-separated list of kernel modules
           not to add to the initramfs. The kernel modules
           have to be specified without the ".ko" suffix.

Notice the space after the first " character and before the last ".

You to identify the modules to omit, which would be specific to your system.

Yes I know, but since I like the boot messages I just remove plymouth.

I do not have plymouth and my initramfs does not have any GPU drivers in it. But 1.3s after boot amdgpu is loaded, I assume from my root partition /lib/modules/$(uname -r) where I see a amdgpu.ko.xz.