Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dracut default install location in /efi
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
tithom
n00b
n00b


Joined: 19 Nov 2022
Posts: 24

PostPosted: Tue May 28, 2024 9:31 pm    Post subject: Dracut default install location in /efi Reply with quote

Hello,

Quick question that I cannot find an answer to online... man dracut reads:

Quote:
If <image> is omitted or empty, depending on bootloader specification, the default location can be /efi/<machine-id>/<kernel-version>/initrd, /boot/<machine-id>/<kernel-version>/initrd, /boot/efi/<machine-id>/<kernel-version>/initrd, /lib/modules/<kernel-version>/initrd or /boot/initramfs-<kernel-version>.img.


I have a separate /efi partition with grub. I have an encrypted /boot (luks1) and an encrypted rootfs (luks2). When I use dracut -f, I have the following error message:
Quote:
Can't write to /efi/<machine-id>/<kernel-version>/initrd


I cannot find a way to change the default location to
Quote:
/boot/initramfs-<kernel-version>.img
. Now, it's relatively easy to work around it, but still wondering if I've missed some info.

Thanks!
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5108
Location: Bavaria

PostPosted: Wed May 29, 2024 10:33 am    Post subject: Reply with quote

Moved from Documentation, Tips & Tricks to Installing Gentoo.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Nowa
Developer
Developer


Joined: 25 Jun 2014
Posts: 429
Location: Nijmegen

PostPosted: Wed May 29, 2024 1:27 pm    Post subject: Reply with quote

Quote:
I cannot find a way to change the default location to


You cannot change the default location, you'll have to specify it manually.

Dracut tries these defaults in the order specified in the manual, so if /efi/<machine-id> exists, this will be the default, if not the next is tried etc.
_________________
OS: Gentoo 6.10.12-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
tithom
n00b
n00b


Joined: 19 Nov 2022
Posts: 24

PostPosted: Fri May 31, 2024 6:45 pm    Post subject: Reply with quote

Thanks for the reply,

I have done a lot more digging. My use case boils down to the following code in dracut.sh (https://github.com/dracut-ng/dracut-ng/blob/main/dracut.sh), line 1160:

Code:
elif [[ -z $dracutsysrootdir ]] \
            && [[ $MACHINE_ID ]] \
            && mountpoint -q /efi; then
            outfile="/efi/${MACHINE_ID}/${kernel}/initrd"


So it will output to /efi/${MACHINE_ID}/${kernel}/initrd if a device is mounted there, regardless of whether the directory exists (the directory /efi/${MACHINE_ID}) which looks like a bug to me? I have commented out these 4 lines and it works as I think it should be (eg. default location is /boot). I suppose that a more logical solution would be to test for the existence of all directories in the proposed path before sending the initramfs to it.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1919

PostPosted: Fri May 31, 2024 7:07 pm    Post subject: Reply with quote

Or just pass --no-machineid to dracut and it will fail any "&& [[ $MACHINE_ID ]]" test

Alternatively, set machine_id=no in a /etc/dracut.conf.d/ file
Back to top
View user's profile Send private message
tithom
n00b
n00b


Joined: 19 Nov 2022
Posts: 24

PostPosted: Fri May 31, 2024 7:34 pm    Post subject: Reply with quote

Thanks!

I had tried to set --sysroot to //... as it should then become /// in the script (eg. ${dracutsysrootdir}/boot.......) and should be interpreted as / though I thought that this would fail the first test, [[ -z $dracutsysrootdir ]]. But that did not work at all.
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