Skip to content

Add --no-reboot-check flag and improve Fedora 43+ compatibility#18

Closed
assisted-by-ai wants to merge 6 commits intoKicksecure:masterfrom
assisted-by-ai:claude/investigate-installer-reboot-WgKmB
Closed

Add --no-reboot-check flag and improve Fedora 43+ compatibility#18
assisted-by-ai wants to merge 6 commits intoKicksecure:masterfrom
assisted-by-ai:claude/investigate-installer-reboot-WgKmB

Conversation

@assisted-by-ai
Copy link
Copy Markdown
Contributor

Summary

This PR adds a new --no-reboot-check command-line flag to allow users to skip the host system reboot requirement check, and improves compatibility with Fedora 43+ where needs-restarting moved from a standalone binary to a dnf5 plugin subcommand.

Key Changes

  • New --no-reboot-check flag: Allows users to bypass the reboot requirement checks in both need_reboot_check_first() and need_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 of needs-restarting from a standalone binary (Fedora 38-42) to a dnf5 plugin subcommand (Fedora 43+). The function now:

    • Checks if /usr/bin/needs-restarting exists and uses it if available
    • Falls back to dnf needs-restarting for Fedora 43+ (dnf5)
    • Properly handles exit codes and avoids running dnf5 via sudo (which breaks due to missing DBUS_SESSION_BUS_ADDRESS)
  • Dynamic package selection: Updated install_package_fedora_common() to install dnf5-plugins instead of dnf-plugins-core when dnf5 is detected, ensuring the correct needs-restarting implementation is available.

  • Documentation updates: Added help text and man page documentation for the new --no-reboot-check flag, and removed obsolete --no-show-errors documentation.

  • Bash/Zsh completion updates: Updated shell completion scripts to include the new flag and reflect other option changes.

  • Minor fixes: Added missing target_user variable to print_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

claude added 6 commits April 1, 2026 17:52
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
@adrelanos
Copy link
Copy Markdown
Member

Manually merged thanks to @ArrayBolt3 with me committing on top.

@adrelanos adrelanos closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants