Skip to content

Fix: Improve Fedora Atomic/Silverblue support#177

Open
drgnomage wants to merge 2 commits into
TamtamHero:mainfrom
drgnomage:fix/pipx-skip-pip-check
Open

Fix: Improve Fedora Atomic/Silverblue support#177
drgnomage wants to merge 2 commits into
TamtamHero:mainfrom
drgnomage:fix/pipx-skip-pip-check

Conversation

@drgnomage

Copy link
Copy Markdown

This PR fixes installation on Fedora Atomic desktops (Silverblue, Kinoite, etc.) where pip is not available and pipx is used instead.

Bug fix: --pipx still required pip

The installer checked for pip unconditionally before reaching the pipx check, so --pipx would always fail with Missing python package 'pip'! on systems without pip. The check now only runs when pip is actually going to be used.

Warning: Homebrew Python + SELinux

On Fedora Atomic with Homebrew installed, pipx creates a venv using Homebrew's Python, which lives under /home/linuxbrew. SELinux labels this path user_home_t, which systemd's init_t cannot read — causing the service to silently fail with exit code 203/EXEC. The installer now detects this after install and warns the user with instructions to fix it.

README

Expanded the Fedora Atomic section with:

  • Full install commands for both Homebrew and non-Homebrew setups on Silverblue
  • How to install pipx via Homebrew or rpm-ostree
  • The manual venv workaround for the Homebrew Python/SELinux issue

@leopoldhub

Copy link
Copy Markdown
Collaborator

Hi, sorry for the delay.
Here is some feedback on this PR.

Feel free to ask any question

Comment thread install.sh Outdated
which python3
else
pipx install --global --force dist/*.tar.gz
FW_FANCTRL_BIN="$(which fw-fanctrl 2>/dev/null || true)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not believe that using which to guess the installation path of the fw-fanctrl bin is a good idea.
Can you check if pipx gives a way to identify the installation directory and use that instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, I was just copying the usage elsewhere in the same if statement.

I've changed the check, if the issue is detected with homebrew installed python then the venv advice is given.

Comment thread README.md Outdated
Comment on lines +123 to +145
> First, ensure `pipx` is available. If you use Homebrew:
> ```bash
> brew install pipx
> ```
> Otherwise, layer it via rpm-ostree (requires a reboot):
> ```bash
> rpm-ostree install pipx && systemctl reboot
> ```
> Then install fw-fanctrl. If using Homebrew, pass your PATH so sudo can find `pipx`:
> ```bash
> sudo env PATH="$PATH" ./install.sh --prefix-dir "/var/usrlocal/" --pipx
> ```
> Otherwise:
> ```bash
> sudo ./install.sh --prefix-dir "/var/usrlocal/" --pipx
> ```
> **Homebrew Python + SELinux**: if you use Homebrew, the installer will warn you if the pipx venv uses Homebrew's Python (under `/home/linuxbrew`), which SELinux blocks systemd from executing. To fix it:
> ```bash
> sudo /usr/bin/python3 -m venv /opt/fw-fanctrl-venv
> sudo /opt/fw-fanctrl-venv/bin/pip install fw-fanctrl
> sudo ln -sf /opt/fw-fanctrl-venv/bin/fw-fanctrl /var/usrlocal/bin/fw-fanctrl
> sudo systemctl restart fw-fanctrl
> ```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is helpful for atomic distribution users, we try to keep the installation documentation as distro agnostic as possible (1 or 2 small comments are the exception).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've dropped the README changes in favour of issue detection and advice in script.

@drgnomage drgnomage force-pushed the fix/pipx-skip-pip-check branch 3 times, most recently from c961154 to 70c711d Compare June 14, 2026 08:54

@leopoldhub leopoldhub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is way more aligned with what I had in mind

I am not really familiar with pipx itself or SELinux, so I have some questions (cf. The comments bellow)

Also, I believed that those changes might become obsolete when moving to the Nuitka bin install in #182, but I will merge this PR first as the last edit before the new version so that people who want to stuck with the python install will have pipx working as intended

Comment thread install.sh Outdated
fi

if [ "$NO_PIP_INSTALL" = false ]; then
if [ "$NO_PIP_INSTALL" = false ] && [ "$PIPX" = false ]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to detect if pipx is installed if $PIPX = true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restructured pip/pipx detection into a single $NO_PIP_INSTALL block — verifies pipx is available when --pipx is set, same as pip.

Comment thread install.sh
else
pipx install --global --force dist/*.tar.gz
FW_FANCTRL_BIN="$(pipx environment --value PIPX_BIN_DIR --global 2>/dev/null || true)"
if [ -n "$FW_FANCTRL_BIN" ]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it failed?
The pipx package is still installed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a fallback to PYTHON_SCRIPT_INSTALLATION_PATH — if pipx environment fails, we check the path the services will actually use.

Comment thread install.sh Outdated
pipx install --global --force dist/*.tar.gz
FW_FANCTRL_BIN="$(pipx environment --value PIPX_BIN_DIR --global 2>/dev/null || true)"
if [ -n "$FW_FANCTRL_BIN" ]; then
FW_FANCTRL_BIN="$FW_FANCTRL_BIN/fw-fanctrl"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used to populate the systemd services

Is that the intended behaviour ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional — FW_FANCTRL_BIN is only used for the shebang warning. Services are populated from PYTHON_SCRIPT_INSTALLATION_PATH (set via --prefix-dir), which matches where pipx installs.

@drgnomage drgnomage force-pushed the fix/pipx-skip-pip-check branch 2 times, most recently from 07c0fd1 to 0cbf921 Compare June 14, 2026 14:59
…to find binary

- restructure pip/pipx detection into a single conditional block
- use pipx environment --value PIPX_BIN_DIR --global to find
  the installed binary path, falling back to
  PYTHON_SCRIPT_INSTALLATION_PATH if that fails
- verify the binary exists before reading the shebang
- warn if pipx venv uses Homebrew Python under /home (SELinux issue)
  with inline fix instructions
@drgnomage drgnomage force-pushed the fix/pipx-skip-pip-check branch from 0cbf921 to 966c1f3 Compare June 14, 2026 15:11
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.

2 participants