Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Dracut not including necessary files for booting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
vhns
n00b
n00b


Joined: 22 Feb 2020
Posts: 21
Location: Brazil

PostPosted: Thu Dec 15, 2022 2:26 pm    Post subject: [SOLVED] Dracut not including necessary files for booting Reply with quote

Hi all,

Here's how I have my boot setup:

EFI->Dracut EFI STUB blob->OpenRC (Or how I think I have it setup :P)

For some reason, it seems that dracut is no longer including the necessary files for booting in the initramfs anymore. It's even missing /lib64/ld-linux-x86-64.so.2!

Here's some data I believe might be helpful:

lsinitrd on the current, working kernel/initramfs:

http://0x0.st/onxK.efi;

lsinitrd on the new, non-bootable kernel/initramfs:

http://0x0.st/onxP.efi;

The command I use for generating the bootable image is the following:

Code:


vhns@gen2lap ~ $ doas dracut --kver=5.15.80-gentoo-vhns-dell-laptop-nopreempt-teste --force



Here are the dracut options I use:

Code:


vhns@gen2lap ~ $ cat /etc/dracut.conf /etc/dracut.conf.d/*
# PUT YOUR CONFIG IN separate files
# in /etc/dracut.conf.d named "<name>.conf"
# SEE man dracut.conf(5) for options
force_drivers=" evdev ahci sd_mod dm-mod dm-crypt i915 usbcore xhci-pci hid hid-generic usbhid serio i8042 ext4 vfat "
compress="zstd"
early_microcode="yes"
#fileloglvl="6"
#force_add_dracutmodules=" crypt dm "
#hostonly_cmdline="yes"
#hostonly="yes"
#kernel_cmdline="rd.shell rd.luks.uuid=luks-919d9f12-8a21-4e37-bc29-56a32e2dfc8d  rd.lvm.lv=deblappy-vg/gentoo rd.debug log_buf_len=1M root=/dev/mapper/deblappy--vg-gentoo rootfstype=xfs rootflags=rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota"
#kernel_cmdline=" rd.luks.uuid=luks-919d9f12-8a21-4e37-bc29-56a32e2dfc8d  rd.lvm.lv=deblappy-vg/gentoo root=/dev/mapper/deblappy--vg-gentoo rootfstype=xfs rootflags=rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota"
logfile="/var/log/dracut.log"
machine_id="no"
early_microcode="yes"
uefi="yes"
uefi_stub="/usr/lib/systemd/boot/efi/linuxx64.efi.stub"
vhns@gen2lap ~ $



And here are the kernels .configs:

Working:

http://0x0.st/onxq.gz;

"Broken":

http://0x0.st/onxb.txt

Here's a video of the normal, working bootup process:

https://u.teknik.io/Mt1MM.mp4

And here's the borked one:

https://u.teknik.io/lHPN9.mp4

If any other info is needed helpful, I'd be glad to provide it.

Best regards,

vhns


Last edited by vhns on Thu Dec 15, 2022 9:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Thu Dec 15, 2022 2:32 pm    Post subject: Reply with quote

Hi
Plz copy the kernel and initramfs into
/boot/EFI<>/
or
/boot/efi/EFI/<>/
then run something similar to
Code:

efibootmgr --create --disk /dev/sdX --part Y --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=block_device_identifier rw initrd=\initramfs-linux.img'

_________________
:)
Back to top
View user's profile Send private message
vhns
n00b
n00b


Joined: 22 Feb 2020
Posts: 21
Location: Brazil

PostPosted: Thu Dec 15, 2022 2:46 pm    Post subject: Reply with quote

alamahant wrote:
Hi
Plz copy the kernel and initramfs into
/boot/EFI<>/
or
/boot/efi/EFI/<>/
then run something similar to
Code:

efibootmgr --create --disk /dev/sdX --part Y --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=block_device_identifier rw initrd=\initramfs-linux.img'


Hi! I don't believe that to be the issue, as I already have the proper EFI boot entries setup.

Here they are

Code:

vhns@gen2lap ~ $ efibootmgr -v
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0000,0003,0002,0005,0006
Boot0000* meow  HD(1,GPT,244bb69f-3001-4347-8acd-68820262d8e4,0x800,0x100000)/File(\EFI\Linux\linux-5.15.80-gentoo-vhns-dell-laptop-nopreempt-teste.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 9f b6 4b 24 01 30 47 43 8a cd 68 82 02 62 d8 e4 02 02 / 04 04 8e 00 5c 00 45 00 46 00 49 00 5c 00 4c 00 69 00 6e 00 75 00 78 00 5c 00 6c 00 69 00 6e 00 75 00 78 00 2d 00 35 00 2e 00 31 00 35 00 2e 00 38 00 30 00 2d 00 67 00 65 00 6e 00 74 00 6f 00 6f 00 2d 00 76 00 68 00 6e 00 73 00 2d 00 64 00 65 00 6c 00 6c 00 2d 00 6c 00 61 00 70 00 74 00 6f 00 70 00 2d 00 6e 00 6f 00 70 00 72 00 65 00 65 00 6d 00 70 00 74 00 2d 00 74 00 65 00 73 00 74 00 65 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0002* Linux HD(1,GPT,244bb69f-3001-4347-8acd-68820262d8e4,0x800,0x100000)/File(\EFI\Linux\linux-5.15.80-gentoo-vhns-dell-laptop-nopreempt.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 9f b6 4b 24 01 30 47 43 8a cd 68 82 02 62 d8 e4 02 02 / 04 04 82 00 5c 00 45 00 46 00 49 00 5c 00 4c 00 69 00 6e 00 75 00 78 00 5c 00 6c 00 69 00 6e 00 75 00 78 00 2d 00 35 00 2e 00 31 00 35 00 2e 00 38 00 30 00 2d 00 67 00 65 00 6e 00 74 00 6f 00 6f 00 2d 00 76 00 68 00 6e 00 73 00 2d 00 64 00 65 00 6c 00 6c 00 2d 00 6c 00 61 00 70 00 74 00 6f 00 70 00 2d 00 6e 00 6f 00 70 00 72 00 65 00 65 00 6d 00 70 00 74 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0003* Linux HD(1,GPT,244bb69f-3001-4347-8acd-68820262d8e4,0x800,0x100000)/File(\EFI\Linux\linux-5.15.80-gentoo-vhns-dell-laptop-nopreempt-virt.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 9f b6 4b 24 01 30 47 43 8a cd 68 82 02 62 d8 e4 02 02 / 04 04 8c 00 5c 00 45 00 46 00 49 00 5c 00 4c 00 69 00 6e 00 75 00 78 00 5c 00 6c 00 69 00 6e 00 75 00 78 00 2d 00 35 00 2e 00 31 00 35 00 2e 00 38 00 30 00 2d 00 67 00 65 00 6e 00 74 00 6f 00 6f 00 2d 00 76 00 68 00 6e 00 73 00 2d 00 64 00 65 00 6c 00 6c 00 2d 00 6c 00 61 00 70 00 74 00 6f 00 70 00 2d 00 6e 00 6f 00 70 00 72 00 65 00 65 00 6d 00 70 00 74 00 2d 00 76 00 69 00 72 00 74 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0005* debian        HD(1,GPT,244bb69f-3001-4347-8acd-68820262d8e4,0x800,0x100000)/File(\EFI\debian\shimx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 9f b6 4b 24 01 30 47 43 8a cd 68 82 02 62 d8 e4 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 64 00 65 00 62 00 69 00 61 00 6e 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0006* UEFI: Seagate Expansion 060E, Partition 2     PciRoot(0x0)/Pci(0x14,0x0)/USB(15,0)/USB(3,0)/HD(2,GPT,604733f7-8f01-4ee6-a8b8-24bd345ae8d6,0x73820800,0xee6000)0000424f
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 14 / 03 05 06 00 0f 00 / 03 05 06 00 03 00 / 04 01 2a 00 02 00 00 00 00 08 82 73 00 00 00 00 00 60 ee 00 00 00 00 00 f7 33 47 60 01 8f e6 4e a8 b8 24 bd 34 5a e8 d6 02 02 / 7f ff 04 00
    data: 00 00 42 4f
vhns@gen2lap ~ $
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Thu Dec 15, 2022 3:04 pm    Post subject: Reply with quote

Are these
Code:

linux-5.15.80-gentoo-vhns-dell-laptop-nopreempt-virt.efi)

kernels?
or efi binaries?
If kernels you need to also provide initramfs if your setup requires one.
If efi binaries renamed then you need grub kernel and initramfs--not efi stub setup..
_________________
:)
Back to top
View user's profile Send private message
vhns
n00b
n00b


Joined: 22 Feb 2020
Posts: 21
Location: Brazil

PostPosted: Thu Dec 15, 2022 3:13 pm    Post subject: Reply with quote

alamahant wrote:
Are these
Code:

linux-5.15.80-gentoo-vhns-dell-laptop-nopreempt-virt.efi)

kernels?
or efi binaries?
If kernels you need to also provide initramfs if your setup requires one.
If efi binaries renamed then you need grub kernel and initramfs--not efi stub setup..


They're UEFI executables which include the kernel and the initramfs. They're generated by dracut. As per dracut.conf(5)

Code:


       uefi="{yes|no}"
           Instead of creating an initramfs image, dracut will create an UEFI executable, which can be executed by an UEFI BIOS (default=no). The default output filename is
           <EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi. <EFI> might be /efi, /boot or /boot/efi depending on where the ESP partition is mounted. The <BUILD_ID> is taken
           from BUILD_ID in /usr/lib/os-release or if it exists /etc/os-release and is left out, if BUILD_ID is non-existant or empty.



it's a single blob that includes everything necessary for booting. You can see what it includes in the outputs of lsinitrd that I included in the first post.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Thu Dec 15, 2022 3:25 pm    Post subject: Reply with quote

Cool....
Well if it doesnt work then please try the explicit way above.
_________________
:)
Back to top
View user's profile Send private message
vhns
n00b
n00b


Joined: 22 Feb 2020
Posts: 21
Location: Brazil

PostPosted: Thu Dec 15, 2022 9:59 pm    Post subject: Reply with quote

I am very sorry for pestering the forum with this. I turned out to be a case of PEBKAC. I am used to running non-multilib profiles, so I had IA32 support disabled in the kernel. This made it so that ldd would throw errors for lib/ld-linux.so.2, which made it so that dracut wouldn't include a bunch of programs, as it found errors with a shared object common amongst them. The reason I had managed to create a bootable UEFI executable that worked, was because I generated it from another system, with a kernel that had IA32 support enabled (A Debian stable logical volume in the same device). Enabling IA32 support fixed the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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