From 65b38eaf93fc4b6263c05cfa0b3d53050c357211 Mon Sep 17 00:00:00 2001 From: Inoki Date: Wed, 5 Nov 2025 21:58:00 +0100 Subject: [PATCH 1/6] Add PATH to env to avoid missing /usr/local/bin --- qefientrymanager-launcher | 1 + 1 file changed, 1 insertion(+) diff --git a/qefientrymanager-launcher b/qefientrymanager-launcher index 32364ef..0ebb983 100755 --- a/qefientrymanager-launcher +++ b/qefientrymanager-launcher @@ -5,6 +5,7 @@ env_array=( "QT_QPA_PLATFORM=${QT_QPA_PLATFORM}" "QT_QPA_PLATFORMTHEME=${QT_QPA_PLATFORMTHEME}" "QT_STYLE_OVERRIDE=${QT_STYLE_OVERRIDE}" + "PATH=${PATH}" ) if [[ -z "${WAYLAND_DISPLAY}" ]]; then From 1ac29ba68b89027c914bb710277fa30bf8f11d53 Mon Sep 17 00:00:00 2001 From: Inoki Date: Wed, 5 Nov 2025 22:16:22 +0100 Subject: [PATCH 2/6] Update PATH variable to include local bin directory (maybe in AppImage) --- qefientrymanager-launcher | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qefientrymanager-launcher b/qefientrymanager-launcher index 0ebb983..03bcf5a 100755 --- a/qefientrymanager-launcher +++ b/qefientrymanager-launcher @@ -1,11 +1,13 @@ #!/usr/bin/env bash +this_dir="$(readlink -f "$(dirname "$0")")" + env_array=( "XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP}" "QT_QPA_PLATFORM=${QT_QPA_PLATFORM}" "QT_QPA_PLATFORMTHEME=${QT_QPA_PLATFORMTHEME}" "QT_STYLE_OVERRIDE=${QT_STYLE_OVERRIDE}" - "PATH=${PATH}" + "PATH=${PATH}:$this_dir/usr/local/bin" ) if [[ -z "${WAYLAND_DISPLAY}" ]]; then From ebb2f8de3f7f1ea44e41deae7ef8cf378f215f58 Mon Sep 17 00:00:00 2001 From: Inoki Date: Wed, 5 Nov 2025 22:25:20 +0100 Subject: [PATCH 3/6] Add debug info --- qefientrymanager-launcher | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qefientrymanager-launcher b/qefientrymanager-launcher index 03bcf5a..1ea85f7 100755 --- a/qefientrymanager-launcher +++ b/qefientrymanager-launcher @@ -1,5 +1,8 @@ #!/usr/bin/env bash +whoami +echo $PATH + this_dir="$(readlink -f "$(dirname "$0")")" env_array=( From a4b619c0cf1aac149985bc6f159880626fb1977b Mon Sep 17 00:00:00 2001 From: Inoki Date: Wed, 11 Feb 2026 19:16:48 +0000 Subject: [PATCH 4/6] Remove use-pkexec-launcher in CI --- .../workflows/cmake-linux-amd64-appimage.yml | 119 +++++++++--------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/.github/workflows/cmake-linux-amd64-appimage.yml b/.github/workflows/cmake-linux-amd64-appimage.yml index 0914427..1ea88ed 100644 --- a/.github/workflows/cmake-linux-amd64-appimage.yml +++ b/.github/workflows/cmake-linux-amd64-appimage.yml @@ -2,9 +2,9 @@ name: Build Linux x64 AppImage and deb on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -22,74 +22,75 @@ jobs: - os: ubuntu-22.04 qt-ver: 5 qt-pkg: qtbase5-dev qttools5-dev - use-pkexec-launcher: OFF - - os: ubuntu-22.04 - qt-ver: 5 - qt-pkg: qtbase5-dev qttools5-dev - use-pkexec-launcher: ON - os: ubuntu-24.04 qt-ver: 6 qt-pkg: qt6-base-dev qt6-tools-dev - use-pkexec-launcher: OFF - - os: ubuntu-24.04 - qt-ver: 6 - qt-pkg: qt6-base-dev qt6-tools-dev - use-pkexec-launcher: ON runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v4 - with: - submodules: true + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Show libc version + run: ldd --version | head -n 1 - - name: Show libc version - run: ldd --version | head -n 1 + - name: Install libefivar, libefiboot and their dev files + run: | + sudo apt update -y + sudo apt install -y ${{matrix.qt-pkg}} fuse - - name: Install libefivar, libefiboot and their dev files - run: | - sudo apt update -y - sudo apt install -y ${{matrix.qt-pkg}} fuse + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: | + cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PACKAGING=ON \ + -DUSE_PKEXEC_LAUNCHER=ON \ + -DBUILD_CLI_UTILITY=ON - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PACKAGING=ON -DUSE_PKEXEC_LAUNCHER=${{matrix.use-pkexec-launcher}} + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + - name: Test EFI Partition Scanning (debug mode only) + run: | + cmake -B ${{github.workspace}}/build-debug -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PACKAGING=OFF \ + -DBUILD_CLI_UTILITY=ON + cmake --build ${{github.workspace}}/build-debug --config Debug + chmod +x ${{github.workspace}}/scripts/test-efi-partition-scan-linux.sh + sudo ${{github.workspace}}/scripts/test-efi-partition-scan-linux.sh ${{github.workspace}}/build-debug/qefibootmgr - - name: Packaging - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: | - export QMAKE=/usr/lib/qt${{matrix.qt-ver}}/bin/qmake - make install DESTDIR=AppDir - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage - wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage - chmod +x linuxdeploy*.AppImage - ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage - mv EFI_Entry_Manager-x86_64.AppImage EFI_Entry_Manager-x86_64-Qt${{matrix.qt-ver}}.AppImage + - name: Packaging + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: | + export QMAKE=/usr/lib/qt${{matrix.qt-ver}}/bin/qmake + make install DESTDIR=AppDir + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage + chmod +x linuxdeploy*.AppImage + ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage + mv EFI_Entry_Manager-x86_64.AppImage EFI_Entry_Manager-x86_64-Qt${{matrix.qt-ver}}.AppImage - - name: Upload a Build Artifact - uses: actions/upload-artifact@v4 - with: - # Artifact name - name: QEFI Entry Manager x86_64 AppImage Qt${{matrix.qt-ver}} pkexec-launcher-${{matrix.use-pkexec-launcher}} - # A file, directory or wildcard pattern that describes what to upload - path: ${{github.workspace}}/build/EFI_Entry_Manager-x86_64-Qt${{matrix.qt-ver}}.AppImage + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + # Artifact name + name: QEFI Entry Manager x86_64 AppImage Qt${{matrix.qt-ver}} + # A file, directory or wildcard pattern that describes what to upload + path: ${{github.workspace}}/build/EFI_Entry_Manager-x86_64-Qt${{matrix.qt-ver}}.AppImage - - name: Packaging Debian - if: ${{ matrix.use-pkexec-launcher == 'ON' }} - working-directory: ${{github.workspace}}/build - run: cpack -G DEB + - name: Packaging Debian + working-directory: ${{github.workspace}}/build + run: cpack -G DEB - - name: Upload a Build Artifact - if: ${{ matrix.use-pkexec-launcher == 'ON' }} - uses: actions/upload-artifact@v4 - with: - # Artifact name - name: QEFI Entry Manager x86_64 deb Qt${{matrix.qt-ver}} - # A file, directory or wildcard pattern that describes what to upload - path: ${{github.workspace}}/build/*.deb + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + # Artifact name + name: QEFI Entry Manager x86_64 deb Qt${{matrix.qt-ver}} + # A file, directory or wildcard pattern that describes what to upload + path: ${{github.workspace}}/build/*.deb From 071bd5c4ad8a19379d6b2e10cbdc70a3fa7b8f72 Mon Sep 17 00:00:00 2001 From: Inoki Date: Wed, 11 Feb 2026 19:18:04 +0000 Subject: [PATCH 5/6] Set a workaround to avoid fuse Inspired by Cursor Codex-5.3 --- qefientrymanager-launcher | 58 +++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/qefientrymanager-launcher b/qefientrymanager-launcher index 1ea85f7..8aa4087 100755 --- a/qefientrymanager-launcher +++ b/qefientrymanager-launcher @@ -1,22 +1,52 @@ #!/usr/bin/env bash -whoami -echo $PATH +# Resolve the bundled binary path first; avoid relying on PATH after pkexec +launcher_path="$(readlink -f "${BASH_SOURCE[0]}")" +launcher_dir="$(dirname "${launcher_path}")" +target="${launcher_dir}/QEFIEntryManager" +if [[ ! -x "${target}" ]]; then + target="QEFIEntryManager" +fi -this_dir="$(readlink -f "$(dirname "$0")")" +env_array=() +append_env() { + local key="$1" + local value="${!key-}" + if [[ -n "${value}" ]]; then + env_array+=("${key}=${value}") + fi +} -env_array=( - "XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP}" - "QT_QPA_PLATFORM=${QT_QPA_PLATFORM}" - "QT_QPA_PLATFORMTHEME=${QT_QPA_PLATFORMTHEME}" - "QT_STYLE_OVERRIDE=${QT_STYLE_OVERRIDE}" - "PATH=${PATH}:$this_dir/usr/local/bin" -) +# Preserve the minimum GUI/session vars that pkexec strips +append_env XDG_CURRENT_DESKTOP +append_env XDG_SESSION_TYPE +append_env QT_QPA_PLATFORM +append_env QT_QPA_PLATFORMTHEME +append_env QT_STYLE_OVERRIDE +append_env DBUS_SESSION_BUS_ADDRESS -if [[ -z "${WAYLAND_DISPLAY}" ]]; then - env_array+=("DISPLAY=${DISPLAY}" "XAUTHORITY=${XAUTHORITY}") +if [[ -n "${WAYLAND_DISPLAY:-}" ]]; then + # Wayland: pass both runtime dir and display socket + append_env XDG_RUNTIME_DIR + append_env WAYLAND_DISPLAY else - env_array+=("WAYLAND_DISPLAY=${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}") + # X11: pass display and auth cookie + append_env DISPLAY + append_env XAUTHORITY +fi + +if [[ "${EUID}" -eq 0 ]]; then + # If already root, run directly without re-exec + exec "${target}" "$@" +fi + +if [[ -n "${APPIMAGE:-}" && -x "${APPIMAGE}" ]]; then + # AppImages mount their SquashFS via FUSE under the calling user. + # After pkexec, root often cannot read that user FUSE mount unless + # allow_root/allow_other is set, so we re-exec the AppImage as root + # and force extract+run to bypass the mount. + exec pkexec env "${env_array[@]}" APPIMAGE_EXTRACT_AND_RUN=1 "${APPIMAGE}" "$@" fi -exec pkexec env "${env_array[@]}" QEFIEntryManager "$@" +# Fallback for non-AppImage installs +exec pkexec env "${env_array[@]}" "${target}" "$@" From c8d64bbfefd295ebd9b17210d233f5994d718393 Mon Sep 17 00:00:00 2001 From: Inoki Date: Fri, 13 Feb 2026 00:41:30 +0100 Subject: [PATCH 6/6] Refactor Wayland environment variable handling Combine WAYLAND_DISPLAY and XDG_RUNTIME_DIR into a single environment variable. --- qefientrymanager-launcher | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qefientrymanager-launcher b/qefientrymanager-launcher index 8aa4087..534563d 100755 --- a/qefientrymanager-launcher +++ b/qefientrymanager-launcher @@ -26,9 +26,8 @@ append_env QT_STYLE_OVERRIDE append_env DBUS_SESSION_BUS_ADDRESS if [[ -n "${WAYLAND_DISPLAY:-}" ]]; then - # Wayland: pass both runtime dir and display socket - append_env XDG_RUNTIME_DIR - append_env WAYLAND_DISPLAY + # Wayland: pass combined runtime dir and display socket + env_array+=("WAYLAND_DISPLAY=${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}") else # X11: pass display and auth cookie append_env DISPLAY