From 633d5f7f12ef43722137297e666829fad7237ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Gon=C3=A7alves?= Date: Wed, 25 Nov 2026 13:57:17 -0300 Subject: [PATCH 1/4] Start live boot modes in kwin_wayland under SDDM Wayland A live boot mode such as only-calamares runs from the session SDDM starts, which is Wayland and has no compositor yet, so the mode's window had nowhere to appear. Under SDDM every mode but boot-in-plasma now runs in kwin_wayland, with Xwayland for X11 programs, through the same hardware, single GPU and software rendering fallbacks as the setup wizard. LightDM's X11 sessions run the mode directly, as before. --- biglinux-livecd/usr/bin/startbiglive | 44 ++++++++++++++++++++-------- tests/test_livecd_accessibility.py | 22 +++++++++----- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/biglinux-livecd/usr/bin/startbiglive b/biglinux-livecd/usr/bin/startbiglive index aa571ec..1d71159 100755 --- a/biglinux-livecd/usr/bin/startbiglive +++ b/biglinux-livecd/usr/bin/startbiglive @@ -371,26 +371,28 @@ _claim_setup_wizard() { } #------------------------------------------------------------------------------- -# Start kwin_wayland compositor with health check and multi-stage fallback +# Start kwin_wayland running a command, with health check and multi-stage fallback # Fallback chain: # 1. Default hardware rendering # 2. Multi-GPU: primary (integrated) GPU only, with Mesa EGL if NVIDIA present # 3. Software rendering via llvmpipe -# Returns 0 if the wizard completed, 1 if kwin could not start at all -#------------------------------------------------------------------------------- -_start_kwin_wizard() { - _claim_setup_wizard || return 0 - local wizard_command="/usr/bin/python /usr/share/biglinux/livecd/main.py" +# Arguments: the command, then the launcher that receives kwin_wayland's +# environment and command line (env, or _run_on_wizard_bus). +# Returns 0 once kwin stayed up and then exited, 1 if it could not start at all +#------------------------------------------------------------------------------- +_run_in_kwin() { + local session_command=$1 + shift + local -a launcher=("$@") local -a kwin_args=(--drm --no-lockscreen --xwayland) local kwin_pid - _enable_accessibility _detect_multi_gpu # Attempt 1: hardware-accelerated rendering (default GPU selection) _log "Starting kwin_wayland (hardware rendering)..." - _run_on_wizard_bus "${wizard_environment[@]}" \ - kwin_wayland "${kwin_args[@]}" --exit-with-session "$wizard_command" & + "${launcher[@]}" \ + kwin_wayland "${kwin_args[@]}" --exit-with-session "$session_command" & kwin_pid=$! # Give kwin a few seconds to initialize; check it didn't crash immediately @@ -414,8 +416,8 @@ _start_kwin_wizard() { env_vars+=("__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json") fi - _run_on_wizard_bus "${wizard_environment[@]}" "${env_vars[@]}" \ - kwin_wayland "${kwin_args[@]}" --exit-with-session "$wizard_command" & + "${launcher[@]}" "${env_vars[@]}" \ + kwin_wayland "${kwin_args[@]}" --exit-with-session "$session_command" & kwin_pid=$! sleep 3 @@ -433,9 +435,9 @@ _start_kwin_wizard() { # Attempt 3: software rendering via llvmpipe _log "Retrying with software rendering..." - _run_on_wizard_bus "${wizard_environment[@]}" \ + "${launcher[@]}" \ LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe \ - kwin_wayland "${kwin_args[@]}" --exit-with-session "$wizard_command" & + kwin_wayland "${kwin_args[@]}" --exit-with-session "$session_command" & kwin_pid=$! sleep 3 @@ -449,6 +451,14 @@ _start_kwin_wizard() { return 1 } +# Returns 0 if the wizard completed or already ran, 1 if kwin could not start +_start_kwin_wizard() { + _claim_setup_wizard || return 0 + _enable_accessibility + _run_in_kwin "/usr/bin/python /usr/share/biglinux/livecd/main.py" \ + _run_on_wizard_bus "${wizard_environment[@]}" +} + #------------------------------------------------------------------------------- # Start mutter compositor (GNOME) with health check and multi-stage fallback # Fallback chain: @@ -616,6 +626,14 @@ if [[ -e /livefs-pkgs.txt ]]; then if ((boot_mode_status == 0)); then if boot_command=$(live_boot_command_path "$boot_mode") && [[ -x $boot_command ]]; then _log "Starting allowlisted live boot mode: $boot_mode" + # A Wayland session from SDDM has no compositor yet. boot-in-plasma + # starts Plasma's own; every other mode runs inside kwin_wayland. + if [[ $display_manager == sddm && $session_type == wayland && -z ${WAYLAND_DISPLAY:-} && + $boot_mode != boot-in-plasma ]]; then + _wait_for_gpu + _run_in_kwin "$boot_command" env + exit + fi exec "$boot_command" fi _log "ERROR - Refusing unsupported live boot mode: $boot_mode" diff --git a/tests/test_livecd_accessibility.py b/tests/test_livecd_accessibility.py index 004459b..239286b 100644 --- a/tests/test_livecd_accessibility.py +++ b/tests/test_livecd_accessibility.py @@ -163,14 +163,20 @@ def test_every_wizard_launch_carries_the_accessibility_environment() -> None: # hardest kind to notice. source = STARTBIGLIVE.read_text(encoding="utf-8") assert "dbus-run-session kwin_wayland" not in source - assert source.count("_run_on_wizard_bus ") >= 3 - # And every one of them carries the wizard's own environment, which is - # where the accessibility bus address lives now that it is not exported. - assert source.count('_run_on_wizard_bus "${wizard_environment[@]}"') >= 3 - # The environment has to be built before any launch runs. - assert source.index("_enable_accessibility\n\t_detect_multi_gpu") < source.index( - '_run_on_wizard_bus "${wizard_environment[@]}"' - ) + # The three paths start kwin_wayland through the launcher they are given. + chain = source[ + source.index("_run_in_kwin() {") : source.index("_start_kwin_wizard() {") + ] + launches = chain.count('kwin_wayland "${kwin_args[@]}"') + assert launches >= 3 + assert chain.count('"${launcher[@]}"') == launches + # The wizard's launcher carries its own environment, which is where the + # accessibility bus address lives now that it is not exported, and that + # environment has to be built before the compositor starts. + wizard = source[source.index("_start_kwin_wizard() {") :] + wizard = wizard[: wizard.index("\n}\n")] + assert '_run_on_wizard_bus "${wizard_environment[@]}"' in wizard + assert wizard.index("_enable_accessibility") < wizard.index("_run_in_kwin") def test_a_stolen_accessibility_socket_is_restored_before_the_desktop( From 35bff04dd3a7b4c5c20ab965d2d97161324579f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Gon=C3=A7alves?= Date: Wed, 25 Nov 2026 13:57:17 -0300 Subject: [PATCH 2/4] Drop the X11 Plasma session names Plasma 6 ships neither plasmawayland.desktop nor xsessions/plasma.desktop, which the installer wrote as SDDM's last session; the installer writes wayland-sessions/plasma.desktop, and only where SDDM is installed. The startplasma-x11 boot mode is gone with that program, and the live sessions no longer name startplasma-x11 or gnome-session as TryExec. --- README.md | 4 ++-- biglinux-livecd/usr/bin/biglinux-install-setup.sh | 13 ++++--------- .../usr/lib/biglinux-livecd/kernel-options | 1 - .../usr/lib/calamares/modules/grubcfg-fix/main.py | 4 ++-- .../share/wayland-sessions/livecdWayland.desktop | 1 - biglinux-livecd/usr/share/xsessions/livecd.desktop | 1 - tests/test_livecd_keyboard.py | 2 +- 7 files changed, 9 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 50a8be1..baf3d6c 100644 --- a/README.md +++ b/README.md @@ -75,10 +75,10 @@ Recognised on the live media's boot line: | Argument | Effect | |---|---| -| `biglinux.bootcmd=` | Skips the normal flow. Accepts `only-calamares`, `boot-in-plasma`, `only-konsole`, `calamares_polkit`, `konsole`, `urxvt` and `startplasma-x11` | +| `biglinux.bootcmd=` | Skips the normal flow. Accepts `only-calamares`, `boot-in-plasma`, `only-konsole`, `calamares_polkit`, `konsole` and `urxvt` | | `driver=nonfree` | Installs the runtime mkinitcpio shim for proprietary drivers | | `driver=free` | Disables proprietary driver detection | -| `wayland` | Starts the session under Wayland | +| `wayland` | No effect; the boot entries still pass it | | `sshenable` | Enables the live SSH server for recovery | These arguments are dropped from the command line written to the installed diff --git a/biglinux-livecd/usr/bin/biglinux-install-setup.sh b/biglinux-livecd/usr/bin/biglinux-install-setup.sh index c6b6c76..6231a74 100755 --- a/biglinux-livecd/usr/bin/biglinux-install-setup.sh +++ b/biglinux-livecd/usr/bin/biglinux-install-setup.sh @@ -371,8 +371,7 @@ write_owned_text() { target_has_plasma_session() { [[ -x $root_mount/usr/bin/startkde-biglinux || - -e $root_mount/usr/share/wayland-sessions/plasmawayland.desktop || - -e $root_mount/usr/share/xsessions/plasma.desktop ]] + -e $root_mount/usr/share/wayland-sessions/plasma.desktop ]] } write_plasma_keyboard_config() { @@ -431,7 +430,7 @@ current_gnome_settings_source() { } main() { - local grub_file sddm_state config_directory session gnome_settings_source + local grub_file sddm_state config_directory gnome_settings_source ((EUID == 0)) || die 'this setup must run as root' load_kernel_options || die 'cannot load kernel option parser' root_mount=$(canonical_root_mount "${1:-}") @@ -440,12 +439,8 @@ main() { config_directory=$root_mount/etc/big-default-config [[ ! -e $grub_file ]] || write_grub_configuration "$grub_file" - if kernel_has_argument wayland; then - session=/usr/share/wayland-sessions/plasmawayland.desktop - else - session=/usr/share/xsessions/plasma.desktop - fi - atomic_write_text "$sddm_state" 0644 $'[Last]\nSession='"$session" + [[ ! -x $root_mount/usr/bin/sddm ]] || + atomic_write_text "$sddm_state" 0644 $'[Last]\nSession=/usr/share/wayland-sessions/plasma.desktop' ensure_directory "$config_directory" copy_live_config "$live_theme_file" "$config_directory/theme" copy_live_config "$live_desktop_file" "$config_directory/desktop" diff --git a/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options b/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options index 27f5321..23ae3f4 100755 --- a/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options +++ b/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options @@ -57,7 +57,6 @@ live_boot_command_path() { calamares_polkit) printf '%s\n' /usr/bin/calamares-biglinux_polkit ;; konsole) printf '%s\n' /usr/bin/konsole ;; urxvt) printf '%s\n' /usr/bin/urxvt ;; - startplasma-x11) printf '%s\n' /usr/bin/startplasma-x11 ;; *) return 1 ;; esac } diff --git a/biglinux-livecd/usr/lib/calamares/modules/grubcfg-fix/main.py b/biglinux-livecd/usr/lib/calamares/modules/grubcfg-fix/main.py index 9897341..21f6467 100644 --- a/biglinux-livecd/usr/lib/calamares/modules/grubcfg-fix/main.py +++ b/biglinux-livecd/usr/lib/calamares/modules/grubcfg-fix/main.py @@ -28,7 +28,7 @@ # handles the following tasks: # # 1. GRUB configuration (BigLinux theme, kernel parameters, cleanup) -# 2. SDDM session configuration (Wayland/X11 based on boot mode) +# 2. SDDM last session (Plasma on Wayland) # 3. Fstab optimization (btrfs compression levels) # 4. Live session config migration (theme, desktop, JamesDSP, display profile) # @@ -47,7 +47,7 @@ def run() -> tuple[str, str] | None: Performs BigLinux-specific post-installation setup: 1. Runs biglinux-install-setup.sh for: - GRUB configuration (theme, parameters) - - SDDM session setup (Wayland/X11) + - SDDM last session (Plasma on Wayland) - Fstab optimization (btrfs compression) - Live session config migration (theme, desktop, JamesDSP, display) """ diff --git a/biglinux-livecd/usr/share/wayland-sessions/livecdWayland.desktop b/biglinux-livecd/usr/share/wayland-sessions/livecdWayland.desktop index 193473c..05b4044 100644 --- a/biglinux-livecd/usr/share/wayland-sessions/livecdWayland.desktop +++ b/biglinux-livecd/usr/share/wayland-sessions/livecdWayland.desktop @@ -2,6 +2,5 @@ Name=Live CD Wayland Type=Application Exec=/usr/bin/startbiglive -TryExec=/usr/bin/gnome-session X-GDM-DesktopNames=livecd X-GDM-SessionRegisters=true diff --git a/biglinux-livecd/usr/share/xsessions/livecd.desktop b/biglinux-livecd/usr/share/xsessions/livecd.desktop index 16a3e4c..a40d8c7 100644 --- a/biglinux-livecd/usr/share/xsessions/livecd.desktop +++ b/biglinux-livecd/usr/share/xsessions/livecd.desktop @@ -2,6 +2,5 @@ Name=Live CD Xorg Type=Application Exec=/usr/bin/startbiglive -TryExec=/usr/bin/startplasma-x11 X-GDM-DesktopNames=livecd X-GDM-SessionRegisters=true diff --git a/tests/test_livecd_keyboard.py b/tests/test_livecd_keyboard.py index 2460a56..223a298 100644 --- a/tests/test_livecd_keyboard.py +++ b/tests/test_livecd_keyboard.py @@ -152,7 +152,7 @@ def test_install_setup_writes_plasma_keyboard_config_from_target_layout( xorg_config.parent.mkdir(parents=True) user_home.mkdir(parents=True) (root / "usr/share/wayland-sessions").mkdir(parents=True) - (root / "usr/share/wayland-sessions/plasmawayland.desktop").write_text( + (root / "usr/share/wayland-sessions/plasma.desktop").write_text( "[Desktop Entry]\nName=Plasma\n", encoding="utf-8", ) From c085c32125792f6913a3fd40a2bcdf3cc1ee4eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Gon=C3=A7alves?= Date: Wed, 25 Nov 2026 15:12:49 -0300 Subject: [PATCH 3/4] Keep live-only boot choices off the installed system The boot menu's text mode (systemd.unit), medium check (checksum) and copy to memory (copytoram) only make sense on the live medium; an install made from text mode booted to a console forever. nouveau.modeset=0 from the proprietary entry kept nouveau off on installed systems that got no NVIDIA driver. --- biglinux-livecd/usr/lib/biglinux-livecd/kernel-options | 6 ++++-- tests/test_livecd_security.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options b/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options index 23ae3f4..903660e 100755 --- a/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options +++ b/biglinux-livecd/usr/lib/biglinux-livecd/kernel-options @@ -72,9 +72,11 @@ sanitize_kernel_arguments() { case "$argument" in # The live GPU choices stay on the medium: the installed system blocks # nouveau through modprobe.d when the NVIDIA driver is installed, and - # needs it loadable when it is not. + # needs it loadable when it is not. Text mode, the medium check and the + # copy to memory belong to the live boot only. BOOT_IMAGE=* | initrd=* | misobasedir=* | misolabel=* | driver=* | rdinit=* | biglinux.bootcmd=* | sshenable | wayland | rw | ro | \ - module_blacklist=* | modprobe.blacklist=* | bdm.gpu=* | bignvidia=*) + module_blacklist=* | modprobe.blacklist=* | bdm.gpu=* | bignvidia=* | nouveau.modeset=* | \ + systemd.unit=* | checksum=* | copytoram=*) continue ;; esac diff --git a/tests/test_livecd_security.py b/tests/test_livecd_security.py index cb53dcd..a9b873a 100644 --- a/tests/test_livecd_security.py +++ b/tests/test_livecd_security.py @@ -70,7 +70,7 @@ def test_kernel_arguments_are_exact_allowlisted_and_sanitized(tmp_path: Path) -> kernel_cmdline_path=$CMDLINE kernel_has_argument sshenable; printf 'ssh=%s\n' "$?" printf 'installed=%s\n' "$(installed_kernel_arguments)" -printf 'sanitized=%s\n' "$(sanitize_installed_kernel_arguments 'quiet splash rw sshenable keep=1 keep=1')" +printf 'sanitized=%s\n' "$(sanitize_installed_kernel_arguments 'quiet splash rw sshenable keep=1 keep=1 systemd.unit=multi-user.target checksum=y copytoram=y nouveau.modeset=0')" printf 'allowed=%s\n' "$(live_boot_command_path only-calamares)" live_boot_command_path '$(touch /tmp/pwn)' >/dev/null; printf 'rejected=%s\n' "$?" """, @@ -79,7 +79,7 @@ def test_kernel_arguments_are_exact_allowlisted_and_sanitized(tmp_path: Path) -> assert result.returncode == 0, result.stderr assert "ssh=1" in result.stdout assert "installed=notsshenable safe=1" in result.stdout - assert "sanitized=quiet splash keep=1" in result.stdout + assert "sanitized=quiet splash keep=1\n" in result.stdout assert "allowed=/usr/bin/only-calamares" in result.stdout assert "rejected=1" in result.stdout assert not Path("/tmp/pwn").exists() From e509de8daf122e7b84f67e75dd884ae2c317d16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Gon=C3=A7alves?= Date: Wed, 25 Nov 2026 16:54:53 -0300 Subject: [PATCH 4/4] Build the package from the standard BigLinux workflow The same build-package.yml as the other BigLinux packages: the branch name and token reach the webhook script through the environment, so a branch name cannot inject commands. --- .github/workflows/build-package.yml | 55 +++++++++++++---------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index b057716..e3eb3f4 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -1,43 +1,36 @@ name: Build Package +# Controls when the workflow will run on: workflow_dispatch: push: + #branches: [ "master", "main", "*" ] branches: [ "*" ] + #pull_request: + #branches: [ "master", "main", "*" ] + #branches: [ "*" ] +# The job only calls the build repository's API with its own token. +permissions: {} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + # This workflow contains a single job called "build" build: + # The type of runner that the job will run on runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # - name: Send Hooks BigLinux Build Package - # shell: bash - # run: | - # if [ -z "$(grep biglinux-package-template pkgbuild/PKGBUILD)" ];then - # curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package/dispatches - # curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package-ARM/dispatches - # fi - # curl -X POST "https://nebulaapi.nimbusnetwork.dev/webhook" \ - # -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" \ - # -H "Content-Type: application/json" \ - # -d '{ - # "event_type": "${{ github.repository }}", - # "branch": "${{ github.ref_name }}", - # "url": "https://github.com/${{ github.repository }}" - # }' - - # - name: Invoke deployment hook - # uses: johannes-huther/webhook.sh@v1 - # env: - # webhook_url: https://nebulaapi.nimbusnetwork.dev/webhook - # webhook_secret: ${{ secrets.WEBHOOK_TOKEN }} - # data: '{ "event_type": "${{ github.repository }}", "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}"}' - #xpto28 - - - - - - + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Send Hooks BigLinux Build Package + shell: bash + # Passed through the environment: a branch name expanded into the script + # could close its quotes and run commands with the token. + env: + WEBHOOK_TOKEN: ${{ secrets.WEBHOOK_TOKEN }} + REPOSITORY: ${{ github.repository }} + BRANCH: ${{ github.ref_name }} + run: | + curl -X POST -H "Accept: application/json" -H "Authorization: token $WEBHOOK_TOKEN" --data "$(jq -n --arg repository "$REPOSITORY" --arg branch "$BRANCH" '{event_type: $repository, client_payload: {branch: $branch, url: "https://github.com/\($repository)", version: "1.2.3"}}')" https://api.github.com/repos/BigLinux-Package-Build/build-package/dispatches + curl -X POST -H "Accept: application/json" -H "Authorization: token $WEBHOOK_TOKEN" --data "$(jq -n --arg repository "$REPOSITORY" --arg branch "$BRANCH" '{event_type: $repository, client_payload: {branch: $branch, url: "https://github.com/\($repository)"}}')" https://api.github.com/repos/BigLinux-Package-Build/build-package-ARM/dispatches