mirror of
https://gitlab.com/fedora/bootc/base-images.git
synced 2026-08-30 13:00:45 +00:00
MR https://gitlab.com/fedora/bootc/base-images/-/merge_requests/257 added `bootloader-update.service` for >= F43, we need the same for "-ge CentOS9" before having this in Image Mode RHEL Also, move the preset to a separate file addressing comment https://gitlab.com/fedora/bootc/base-images/-/merge_requests/257#note_2683334416
41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
# Postprocessing relating to systemd presets on the system.
|
|
postprocess:
|
|
- |
|
|
#!/bin/bash
|
|
set -xeuo pipefail
|
|
# Override some of the default presets.
|
|
cat <<EOF > usr/lib/systemd/system-preset/85-bootc.preset
|
|
# Disable dnf-makecache.timer on bootc/image mode systems
|
|
# https://github.com/coreos/fedora-coreos-tracker/issues/1896#issuecomment-2848251507
|
|
disable dnf-makecache.timer
|
|
EOF
|
|
# Enable bootloader-update.service on F43+ and CentOS9+
|
|
# https://github.com/coreos/fedora-coreos-tracker/issues/1468#issuecomment-2996654547
|
|
# https://fedoraproject.org/wiki/Changes/AutomaticBootloaderUpdatesBootc
|
|
- |
|
|
#!/bin/bash
|
|
set -xeuo pipefail
|
|
source /usr/lib/os-release
|
|
|
|
preset_file_name=/usr/lib/systemd/system-preset/85-bootc-bootloader-update.preset
|
|
|
|
case "$ID" in
|
|
fedora)
|
|
[ "$VERSION_ID" -ge 43 ] && echo "enable bootloader-update.service" >> "$preset_file_name"
|
|
;;
|
|
|
|
centos)
|
|
[ "$VERSION_ID" -ge 9 ] && echo "enable bootloader-update.service" >> "$preset_file_name"
|
|
;;
|
|
|
|
*) ;;
|
|
esac
|
|
# Undo RPM scripts enabling units; we want the presets to be canonical
|
|
# https://github.com/projectatomic/rpm-ostree/issues/1803
|
|
- |
|
|
#!/bin/bash
|
|
set -xeuo pipefail
|
|
rm -rf /etc/systemd/system/*
|
|
systemctl preset-all
|
|
rm -rf /etc/systemd/user/*
|
|
systemctl --user --global preset-all
|