From ee98742ce6ffbd3111ccca7bbe8693454ab73327 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Oct 10 2023 14:49:29 +0000 Subject: Revert "Add fixes for systemd unit + kernel-install plugin (from master branch)." This reverts commit b3999ac3467ee6ea6cd23b1d37dc6f86433d5ef8. --- diff --git a/python-virt-firmware.spec b/python-virt-firmware.spec index cbfe9a0..6571574 100644 --- a/python-virt-firmware.spec +++ b/python-virt-firmware.spec @@ -8,7 +8,6 @@ Summary: Tools for virtual machine firmware volumes License: GPL-2.0-only URL: https://pypi.org/project/virt-firmware/ Source0: virt-firmware-%{pypi_version}.tar.gz -Patch1: systemd-fixes.patch BuildArch: noarch BuildRequires: python3-devel @@ -55,7 +54,7 @@ kernel-install plugin and systemd unit to manage automatic UKI (unified kernel image) updates. %prep -%autosetup -n virt-firmware-%{pypi_version} -p 1 +%autosetup -n virt-firmware-%{pypi_version} %build %py3_build diff --git a/systemd-fixes.patch b/systemd-fixes.patch deleted file mode 100644 index 8f6adb5..0000000 --- a/systemd-fixes.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff --git a/systemd/99-uki-uefi-setup.install b/systemd/99-uki-uefi-setup.install -index a2234e10f4d1..7d7fa47a4fa0 100755 ---- a/systemd/99-uki-uefi-setup.install -+++ b/systemd/99-uki-uefi-setup.install -@@ -23,13 +23,22 @@ fi - UKI_FILE_BOOT="$UKI_DIR_BOOT/$ENTRY_TOKEN-$KERNEL_VERSION.efi" - UKI_FILE_ESP="$UKI_DIR_ESP/$ENTRY_TOKEN-$KERNEL_VERSION.efi" - -+if [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ]; then -+ LOGLEVEL="--loglevel info" -+else -+ LOGLEVEL="--loglevel error" -+fi -+ - case "$COMMAND" in - remove) - [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ -- echo "Removing $UKI_DIR_ESP/$ENTRY_TOKEN-$KERNEL_VERSION.efi from UEFI boot entries" -- for uki in "$UKI_DIR_ESP/$ENTRY_TOKEN-$KERNEL_VERSION.efi"; do -- [ -f "$uki" ] && kernel-bootcfg --remove-uki "$uki" -- done -+ echo "Removing $UKI_FILE_ESP from UEFI boot entries" -+ kernel-bootcfg $LOGLEVEL --remove-uki "$UKI_FILE_ESP" -+ if [ "$UKI_FILE_BOOT" != "$UKI_FILE_ESP" -a -f "$UKI_FILE_ESP" ]; then -+ [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ -+ echo "Removing $UKI_FILE_ESP from ESP" -+ rm -f "$UKI_FILE_ESP" -+ fi - ;; - add) - [ "$KERNEL_INSTALL_LAYOUT" = "uki" ] || exit 0 -@@ -40,18 +49,19 @@ case "$COMMAND" in - exit 1 - fi - -- [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ -- echo "Adding $UKI_FILE_ESP to ESP and UEFI boot entries" -- -- # Copy the UKI to the ESP when $BOOT and ESP differ -- if [ ! -f "$UKI_FILE_ESP" ]; then -- install -D -m 0644 "$UKI_FILE_BOOT" "$UKI_FILE_ESP" || { -- echo "Error: could not copy '$UKI_FILE_BOOT' to '$UKI_FILE_ESP'." >&2 -+ # Move the UKI to the ESP when $BOOT and ESP differ -+ if [ "$UKI_FILE_BOOT" != "$UKI_FILE_ESP" -a ! -f "$UKI_FILE_ESP" ]; then -+ [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ -+ echo "Moving $UKI_FILE_BOOT to ESP" -+ mv "$UKI_FILE_BOOT" "$UKI_FILE_ESP" || { -+ echo "Error: could not move '$UKI_FILE_BOOT' to '$UKI_FILE_ESP'." >&2 - exit 1 - } - fi - -- kernel-bootcfg --add-uki "$UKI_FILE_ESP" --title "$KERNEL_VERSION" --once -+ [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \ -+ echo "Adding $UKI_FILE_ESP to UEFI boot entries" -+ kernel-bootcfg $LOGLEVEL --add-uki "$UKI_FILE_ESP" --title "$KERNEL_VERSION" --once - ;; - *) - exit 0 -diff --git a/systemd/kernel-bootcfg-boot-successful.service b/systemd/kernel-bootcfg-boot-successful.service -index 7bf851496982..b45a317daf96 100644 ---- a/systemd/kernel-bootcfg-boot-successful.service -+++ b/systemd/kernel-bootcfg-boot-successful.service -@@ -2,8 +2,11 @@ - - [Unit] - Description=UKI Successful Boot --After=sysinit.target --Before=systemd-user-sessions.service -+Requires=boot-complete.target -+After=local-fs.target boot-complete.target -+Conflicts=shutdown.target -+Before=shutdown.target -+ConditionFirmware=uefi - ConditionPathExists=!/etc/initrd-release - - [Service]