Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.
This repository was archived by the owner on May 3, 2026. It is now read-only.

[BUG] EnvyControl hangs indefinitely on Arch-based distro with Limine bootloader in non-verbose mode #237

@m24ih

Description

@m24ih

Describe the bug
When running EnvyControl on an Arch-based distribution with the Limine bootloader, the application hangs indefinitely if the --verbose flag is not used.

This happens because the rebuild_initramfs() function executes mkinitcpio -P, and Limine provides a wrapper/hook for mkinitcpio that interactively prompts the user (==> Would you like to run 'limine-mkinitcpio' now? [Y/n]:). Since envycontrol redirects stdout and stderr to subprocess.DEVNULL in non-verbose mode, the prompt is hidden, and the subprocess waits infinitely for a standard input that never comes.

To Reproduce
Steps to reproduce the behavior:

  1. Install EnvyControl on an Arch Linux system using the Limine bootloader.
  2. Run sudo envycontrol -s hybrid (without --verbose).
  3. The application will hang indefinitely during the "Rebuilding the initramfs..." step.

Expected behavior
EnvyControl should either detect the Limine bootloader and execute the appropriate Limine command (limine-mkinitcpio or limine-update) automatically, or it should ensure that interactive prompts from subprocesses do not cause the main thread to hang indefinitely.

Screenshots
N/A - See terminal logs in the Additional Context section.

System Information:

  • Model: HP Victus 16-s0035NT (7Z5Z2EA)
  • Distro: CachyOS (Arch Linux)
  • Kernel: 6.19.11-1-cachyos
  • DE/WM and Display Manager (if applicable): KDE Plasma (Wayland) with SDDM
  • EnvyControl version: 3.5.2
  • Nvidia driver version: 595.58.03
  • lspci output:
❯ lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Phoenix IOMMU
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Host Bridge
00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix GPP Bridge
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Host Bridge
00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix GPP Bridge
00:02.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix GPP Bridge
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix GPP Bridge
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Host Bridge
00:04.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Host Bridge
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Internal GPP Bridge to Bus [C:A]
00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Internal GPP Bridge to Bus [C:A]
00:08.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Internal GPP Bridge to Bus [C:A]
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 71)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Phoenix Data Fabric; Function 7
01:00.0 VGA compatible controller: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation AD107 High Definition Audio Controller (rev a1)
02:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter (rev 02)
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller (rev 16)
04:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 (rev c3)
05:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Radeon High Definition Audio Controller
05:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Phoenix CCP/PSP 3.0 Device
05:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15b9
05:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15ba
05:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] Audio Coprocessor (rev 63)
05:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Ryzen HD Audio Controller
06:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Function
06:00.1 Signal processing controller: Advanced Micro Devices, Inc. [AMD] AMD IPU Device
07:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Phoenix Dummy Function
07:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15c0
07:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15c1

Additional context
When running with the --verbose flag, the root cause becomes visible as the output is not sent to DEVNULL. The process stops and waits for a [Y/n] input:

❯ sudo envycontrol -s hybrid --verbose
INFO: Found Nvidia GPU at 01:00.0
DEBUG: Created file /var/cache/envycontrol/cache.json
Switching to hybrid mode
Enable PCI-Express Runtime D3 (RTD3) Power Management: False
INFO: Removed file /etc/modprobe.d/nvidia.conf
Successfully enabled nvidia-persistenced.service
INFO: Created file /etc/modprobe.d/nvidia.conf
# Automatically generated by EnvyControl

options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1 NVreg_InitializeSystemMemoryAllocations=0

Rebuilding the initramfs...
==> ERROR: No presets found in /etc/mkinitcpio.d
==> WARNING: This does not update Limine boot entries.
    Use 'limine-mkinitcpio' or 'limine-update' instead.
==> Would you like to run 'limine-mkinitcpio' now? [Y/n]: 

Proposed Solution:
Update the rebuild_initramfs() function to check for the existence of limine-mkinitcpio or limine-update before defaulting to mkinitcpio -P on Arch Linux.

Suggested modification:

    # Arch Linux
    elif os.path.exists('/etc/arch-release'):
        if shutil.which('limine-mkinitcpio'):
            command = ['limine-mkinitcpio']
        else:
            command = ['mkinitcpio', '-P']

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions