View previous topic :: View next topic |
Author |
Message |
tithom n00b
Joined: 19 Nov 2022 Posts: 24
|
Posted: Tue May 28, 2024 9:31 pm Post subject: Dracut default install location in /efi |
|
|
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 |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5108 Location: Bavaria
|
|
Back to top |
|
|
Nowa Developer
Joined: 25 Jun 2014 Posts: 429 Location: Nijmegen
|
Posted: Wed May 29, 2024 1:27 pm Post subject: |
|
|
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 |
|
|
tithom n00b
Joined: 19 Nov 2022 Posts: 24
|
Posted: Fri May 31, 2024 6:45 pm Post subject: |
|
|
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 |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1920
|
Posted: Fri May 31, 2024 7:07 pm Post subject: |
|
|
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 |
|
|
tithom n00b
Joined: 19 Nov 2022 Posts: 24
|
Posted: Fri May 31, 2024 7:34 pm Post subject: |
|
|
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 |
|
|
|