## Problem - The self-update service is not started at boot ## Details - The service files have been moved from `/usr/lib/systemd/system` to `/etc/systemd/system` - The dracut complains: ``` dracut[I]: *** Including module: live-self-update *** dracut-install: ERROR: installing '/usr/lib/systemd/system/live-self-update.service' dracut[E]: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.AltRpF/initramfs -a /usr/lib/systemd/system/live-self-update.service live-self-update Failed to enable unit: Unit live-self-update.service does not exist ``` - Unfortunately dracut continues and ignores the error, that's the reason nobody noticed the problem ## Solution - Fix the service file location - The same problem was found in the `initrd-nmtui.service` file - Use `set -e` to avoid similar problems in the future - Return the original exit value so the `systemctl status live-self-update.service` does not report a failure ## Testing - Tested with a locally built ISO, the self-update service starts properly
34 lines
943 B
Bash
Executable file
34 lines
943 B
Bash
Executable file
#!/bin/bash
|
|
# module-setup.sh for NetworkManger TUI configuration
|
|
# see https://www.man7.org/linux/man-pages/man7/dracut.modules.7.html
|
|
|
|
# called by dracut
|
|
check() {
|
|
# always include this dracut module in the initramfs
|
|
return 0
|
|
}
|
|
|
|
# called by dracut
|
|
depends() {
|
|
echo network
|
|
return 0
|
|
}
|
|
|
|
installkernel() {
|
|
return 0
|
|
}
|
|
|
|
# install hook for dracut
|
|
install() {
|
|
# fail if any install command fails (cannot be used globally as this file is sourced by dracut)
|
|
set -e
|
|
# install the hook for processing the boot parameters and enabling network support in dracut
|
|
inst_hook cmdline 99 "$moddir/initrd-nmtui-cmdline.sh"
|
|
|
|
# install the systemd service and the self-update script to the initramfs
|
|
inst_multiple /etc/systemd/system/initrd-nmtui.service initrd-network-setup.sh dialog nmtui nmcli kill tput clear
|
|
|
|
# enable the self-update service in the initramfs
|
|
$SYSTEMCTL -q --root "$initdir" enable initrd-nmtui.service
|
|
set +e
|
|
}
|