Welcome to fedora-update. This document outlines the architectural principles, design requirements, and development guidelines for this repository. All human contributors and AI agents working on this codebase must adhere to these rules.
fedora-update is a modular, lightweight, and robust maintenance suite and system tray monitor for Fedora Linux:
bin/fedora-update-cli: Interactive command-line update runner. Manages package updates (DNF & Flatpak), Secure Boot / MOK key validation, kernel module compilation (akmods), and initramfs regeneration (dracut).lib/check_backend.sh: Lightweight background checker executed by systemd timer or triggered on-demand. Gathers DNF/Flatpak update counts, reboot requirements, Secure Boot state, and NVIDIA Flatpak GL runtime compatibility into/var/cache/fedora-update/status.json.lib/fedora-update-tray: PyQt5 system tray indicator. Watches/var/cache/fedora-update/status.json, displays visual badges/notifications, manages language switching, and launches the CLI tool inside the user's terminal emulator.lib/fedora_update_i18n.py: Central internationalization (i18n) engine supporting 20+ languages with automated system locale detection and user configuration override (~/.config/fedora-update/config.json).locales/*.json: Multilingual JSON dictionaries.systemd/&polkit/: Systemd timer/service and Polkit rules allowing passwordless background cache refresh.fedora-update.spec&build_rpm.sh: RPM spec definition and local/Copr build automation script.
- Silent when disabled: If Secure Boot is disabled (
mokutil --sb-statedoes not report enabled), the application must run silently with zero MOK-related prompts or checks. - Silent for non-NVIDIA / standard kernel: If Secure Boot is enabled on a system with an AMD or Intel GPU running an official Fedora kernel (
kernel-coresigned by Fedora), no kernel modules require out-of-tree signing. The application must remain completely silent. - Targeted check for NVIDIA & Custom Kernels:
- SCM/akmods uses
/etc/pki/akmods/certs/public_key.derand/etc/pki/akmods/private/private_key.priv. - If Secure Boot is enabled AND (NVIDIA GPU is present OR a custom unsigned kernel is used):
- Check if an active signing key exists and is enrolled in
mokutil --list-enrolled. - If the key already exists and is enrolled, proceed silently without re-signing or prompting.
- Only if the key is missing or unenrolled: prompt the user to generate (
kmodgenca -a) and import (mokutil --import), providing clear instructions for the post-reboot MokManager blue screen.
- Check if an active signing key exists and is enrolled in
- SCM/akmods uses
- No arbitrary signing: Never sign files or trigger mokutil imports indiscriminately.
The "baking" logic into initramfs is a core selling point of fedora-update:
- Smart Trigger: Rebuilding kernel modules and initramfs must only be triggered if:
- An NVIDIA GPU is present AND
- New kernel package(s) were installed OR NVIDIA driver package(s) were upgraded.
- Differentiated Scope:
- Kernel Update Only: If new kernel(s) were installed but the driver version remained constant, run
akmods --force --kernel <new_kver>anddracut --force --kver <new_kver>only for the newly installed kernel(s). - NVIDIA Driver Update: If NVIDIA driver packages (
akmod-nvidia,xorg-x11-drv-nvidia,nvidia-driver) were updated, runakmods --force --kernels allanddracut --regenerate-all --forceacross all installed kernels.
- Kernel Update Only: If new kernel(s) were installed but the driver version remained constant, run
- Clean & Quiet Output:
- Output must start with:
Baking Nvidia kernel modules into initramfs for safe reboot... - Execution of
akmodsanddracutmust run cleanly without standard output spam, capturing errors only if a command fails. - On completion:
Nvidia kernel modules are baked and the system is ready for reboot.
- Output must start with:
- Granular confirmation: Users must never experience unexpected auto-actions. Every major step (DNF upgrade, Flatpak update, MOK enrollment, system reboot) requires clear user confirmation prompts (
[Y/n]). - No hardcoded text in CLI: All UI text must be routed through
fedora_update_i18n.pyusing_("KEY")and backed by entries inlocales/en.json.
- Preserve
rpkgMacros:fedora-update.specmust keep{{{ git_dir_pack }}}and{{{ git_dir_setup_macro }}}in the repository so remote Copr builds succeed. - Local Builds:
build_rpm.shreplaces these macros only in a temporary buildroot during local compilation. - Cross-Distro Mirroring:
build_rpm.shmirrors the repository to/home/tux/SSD2/development/fedora-updatefor deployment alongsidedebian-update. Always verify 1:1 parity after building. - Instant Autostart: The
%postscriptlet infedora-update.specshould trigger autostart for active user sessions viasystemctl --user -M <user>@so the tray indicator launches without requiring a logout/login.