You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's assume I have a service called my-fancy-tool, that I need to run from the initial ramdisk during early boot. This service is expected to be executed multiple times with different configurations, so I have a template unit at /usr/lib/systemd/system/[email protected] with
The unit name should be stripped from all arguments. So [email protected] should become [email protected] and initrd-cryptsetup.service should remain initrd-cryptsetup.service.
Short description
mkinitcpio-systemd-tool
does not support adding template service units (e.g.[email protected]
) to the initrd yet.Steps to reproduce
Let's assume I have a service called
my-fancy-tool
, that I need to run from the initial ramdisk during early boot. This service is expected to be executed multiple times with different configurations, so I have a template unit at/usr/lib/systemd/system/[email protected]
withNow I enable my service for a specific config with
systemctl enable [email protected]
and then try to recreate the initrd.Expected behavior
Recreating the initrd succeeds and my service is added to the initrd image.
Actual behavior
Recreating the initrd fails with
Technical details
In the function
add_systemd_unit_X
insrc/mkinitcpio-install.sh
the unit of my service is parsed as[email protected]
.Right after that, the tool tries to locate either
/etc/systemd/system/[email protected]
or/usr/lib/systemd/system/[email protected]
.However both files do not exist, as my unit is
/usr/lib/systemd/system/[email protected]
and the tool failes.Suggested solution
The unit name should be stripped from all arguments. So
[email protected]
should become[email protected]
andinitrd-cryptsetup.service
should remaininitrd-cryptsetup.service
.The name of the symlink should still be stored, as it should still be added to the initrd image with its argument in the name.
The text was updated successfully, but these errors were encountered: