Add --no-reboot-check flag and improve Fedora 43+ compatibility#18
Closed
assisted-by-ai wants to merge 6 commits intoKicksecure:masterfrom
Closed
Add --no-reboot-check flag and improve Fedora 43+ compatibility#18assisted-by-ai wants to merge 6 commits intoKicksecure:masterfrom
assisted-by-ai wants to merge 6 commits intoKicksecure:masterfrom
Conversation
On Fedora 43+, needs-restarting is a dnf5 plugin subcommand rather than a standalone binary at /usr/bin/needs-restarting. The old code called the missing binary via sudo, which always failed with non-zero exit, causing the installer to endlessly demand a reboot. Additionally, even when the command exists, running dnf5 needs-restarting via sudo fails due to missing DBUS_SESSION_BUS_ADDRESS environment variable (dnf5 issue #2562). Changes: - Check for standalone /usr/bin/needs-restarting first (Fedora 38-42) - Fall back to 'dnf needs-restarting' plugin for dnf5 (Fedora 43+) - Run dnf5 variant without sudo (it doesn't require root) - Distinguish exit code 1 (reboot needed) from other errors - Skip gracefully if needs-restarting is unavailable Bug: https://forums.whonix.org/t/whonix-installer-keeps-telling-me-to-reboot/23108 Ref: rpm-software-management/dnf5#2562 https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT
Replace 'cmd && return 0' with 'cmd || exit_code="$?"' to safely capture the exit code without risking set -e termination. Initialize needs_restarting_exit_code=0 and check all exit paths explicitly. https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT
On Fedora 43+ (dnf5), needs-restarting is provided by dnf5-plugins, not dnf-plugins-core. Detect dnf5 and install the correct package. Also add fedora:43 to the CI test matrix. https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT
Adds a new --no-reboot-check command-line option that bypasses both need_reboot_check_first (Debian /var/run/reboot-required) and need_reboot_check_second (Fedora needs-restarting) checks. This gives users a workaround when reboot detection is unreliable, such as on Fedora 43 where needs-restarting may report false positives. Updated in all required locations: - Global variable declaration and set_default - parse_opt case handler - print_getopt output - usage help text - Both reboot check functions - Standalone version (all of the above) - Bash completion - Zsh completion - Man page (ronn) https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT
--no-show-errors was documented in usage, man page, and completions but never implemented in parse_opt. Remove it entirely. Also fix several option consistency issues: - Add --user to man page, bash completion, zsh completion - Add --noupdate and --noupgrade to man page, bash/zsh completions - Add target_user to print_getopt output - Fix bash completion mirror values from 0-5 to 0-2 (only 3 exist) https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT
dnf5 outputs "GPG signature verification error: Signing key not found" while the grep only matched "OpenPGP signature verification error". This caused the workaround (return 0 after key auto-import) to not trigger on dnf5, making the installer abort on Fedora 42+ CI. Broaden the grep to "signature verification error: Signing key not" which matches both the dnf4 "OpenPGP" and dnf5 "GPG" variants. https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT
Member
|
Manually merged thanks to @ArrayBolt3 with me committing on top. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
--no-reboot-checkcommand-line flag to allow users to skip the host system reboot requirement check, and improves compatibility with Fedora 43+ whereneeds-restartingmoved from a standalone binary to a dnf5 plugin subcommand.Key Changes
New
--no-reboot-checkflag: Allows users to bypass the reboot requirement checks in bothneed_reboot_check_first()andneed_reboot_check_second()functions. This is useful when reboot detection is unreliable or produces false positives.Fedora 43+ compatibility: Updated
need_reboot_check_second()to handle the migration ofneeds-restartingfrom a standalone binary (Fedora 38-42) to a dnf5 plugin subcommand (Fedora 43+). The function now:/usr/bin/needs-restartingexists and uses it if availablednf needs-restartingfor Fedora 43+ (dnf5)Dynamic package selection: Updated
install_package_fedora_common()to installdnf5-pluginsinstead ofdnf-plugins-corewhen dnf5 is detected, ensuring the correctneeds-restartingimplementation is available.Documentation updates: Added help text and man page documentation for the new
--no-reboot-checkflag, and removed obsolete--no-show-errorsdocumentation.Bash/Zsh completion updates: Updated shell completion scripts to include the new flag and reflect other option changes.
Minor fixes: Added missing
target_uservariable toprint_getopt()output and updated mirror count in bash completion.Implementation Details
The reboot check logic now gracefully handles different Fedora versions and dnf implementations, with proper error handling for unexpected exit codes from
needs-restarting. The new flag provides an escape hatch for users experiencing issues with reboot detection while maintaining the default safety checks.https://claude.ai/code/session_01EZcsmvQWmaAJDM6KXL1RoT