diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml deleted file mode 100644 index cccfca61..00000000 --- a/.github/workflows/build-and-release.yml +++ /dev/null @@ -1,172 +0,0 @@ -name: Build and Release -on: - schedule: [{cron: "1 1 1 * *"}] - workflow_dispatch: { } - pull_request: - branches: [main] - push: - paths-ignore: - - '**.md' - - '**.json' - - '.gitignore' - - '.vscode/**' - branches: - - main - -jobs: - generate-matrix: - runs-on: ubuntu-24.04-arm - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Checkout repository and submodules - id: checkout - continue-on-error: true - uses: actions/checkout@v4 - with: - submodules: true - - name: Retry checkout after a transient submodule failure - if: steps.checkout.outcome == 'failure' - uses: actions/checkout@v4 - with: - submodules: true - - name: Fetch pinned debootstrap source - env: - DEBOOTSTRAP_VERSION: 1.0.134ubuntu1 - DEBOOTSTRAP_SHA256: e4077fc537d5edf9662305028b1ce7265ac4760086515be180b07b62d15f6a69 - run: | - archive="$RUNNER_TEMP/debootstrap.tar.gz" - curl --fail --location \ - --retry 5 --retry-all-errors \ - --output "$archive" \ - "https://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_${DEBOOTSTRAP_VERSION}.tar.gz" - echo "$DEBOOTSTRAP_SHA256 $archive" | sha256sum --check --strict - mkdir -p fs-cook/core/debootstrap - tar --extract --gzip \ - --file "$archive" \ - --directory fs-cook/core/debootstrap \ - --strip-components=1 - test -s fs-cook/core/debootstrap/debootstrap - - name: Pack pinned debootstrap source - run: | - tar -C fs-cook/core \ - --exclude=debootstrap/.git \ - -cf "$RUNNER_TEMP/debootstrap-source.tar" \ - debootstrap - - name: Share pinned debootstrap source - uses: actions/upload-artifact@v4.5.0 - with: - name: debootstrap-source - path: ${{ runner.temp }}/debootstrap-source.tar - retention-days: 30 - - name: Check Plasma builders - run: python3 -m unittest discover -s tests -v - - name: Generate Matrix JSON - id: set-matrix - run: echo "matrix=$( python3 gen_data/gen-suite-matrix.py )" >> $GITHUB_OUTPUT - - suite-build: - if: github.event_name != 'pull_request' - runs-on: ubuntu-24.04-arm - needs: generate-matrix - strategy: - max-parallel: 10 - fail-fast: false - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} - - steps: - - name: Checkout repository and submodules - id: checkout - continue-on-error: true - uses: actions/checkout@v4 - with: - submodules: true - - name: Retry checkout after a transient submodule failure - if: steps.checkout.outcome == 'failure' - uses: actions/checkout@v4 - with: - submodules: true - - name: Download pinned debootstrap source - uses: actions/download-artifact@v4.1.7 - with: - name: debootstrap-source - path: ${{ runner.temp }}/debootstrap-source - - name: Restore pinned debootstrap source - run: | - tar -C fs-cook/core \ - -xf "$RUNNER_TEMP/debootstrap-source/debootstrap-source.tar" - - name: ⤵️ Install Dependencies - run: | - sudo apt-get update - sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y - - - name: 🛠️ Build ${{ matrix.suite }}-${{ matrix.variant }}-${{ matrix.architecture }} - run: sudo bash build.sh -s ${{ matrix.suite }} -v ${{ matrix.variant }} -a ${{ matrix.architecture }} - - - name: ⬆️ Upload Tarballs - uses: actions/upload-artifact@v4.5.0 - with: - name: ${{ matrix.suite }}-${{ matrix.variant }}-${{ matrix.architecture }}-tarballs - path: fs-cook/out/${{ matrix.suite }}-${{ matrix.variant }}-**.tar.gz - - create-release: - if: github.event_name != 'pull_request' - runs-on: ubuntu-24.04-arm - - needs: suite-build - - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: 📥 Download All Tarballs - uses: actions/download-artifact@v4.1.7 - - - name: 🏷 Generate Release Tag - run: | - udroid_version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ - https://github.com/RandomCoderOrg/ubuntu-on-android \ - | tail -n1 | cut -d / -f 3 | cut -d v -f 2- ) - - latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ - https://github.com/RandomCoderOrg/udroid-download \ - | tail -n1 | cut -d / -f 3) - - if [[ $latest_tag =~ R([0-9]+)$ ]]; then - current_release=${BASH_REMATCH[1]} - else - current_release=0 - fi - - next_release=$((current_release + 1)) - - echo "VERSIONTAG=V${udroid_version}R${next_release}" >> $GITHUB_ENV - - - name: 📝 Generate Release Notes - run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh - - - name: ⬆️ Upload Suite Tarballs - uses: ncipollo/release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ env.VERSIONTAG }} - name: ${{ env.VERSIONTAG }} - bodyFile: release.md - draft: false - prerelease: false - artifacts: '*-*-tarballs/*.tar.gz' - makeLatest: true - - - name: ⚙️ Generate New distro-data.json - run: sudo python3 gen_data/gen-update-json.py --release-tag ${{ env.VERSIONTAG }} - - - name: ⚙️ Run git pull - run: git pull -v - - - name: ⚙️ Update distro-data.json - uses: stefanzweifel/git-auto-commit-action@v4 - with: - skip_fetch: false - skip_checkout: false - commit_message: 'AUTO BOT JOB: (MAIN) update distro-data.json for ${{ env.VERSIONTAG }}' - file_pattern: distro-data.json diff --git a/README.md b/README.md index b066c378..ba878e8e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,33 @@ # udroid-download -An ( fs-cook & debootstrap ) wrapper to build udroid with cmdline +An ( fs-cook & debootstrap ) wrapper to build udroid with cmdline. + +## Ubuntu Plucky GNOME X11 image + +The `plucky/gnomeRaw` target builds an ARM64 Ubuntu Plucky GNOME desktop +image for Termux:X11. GNOME is launched with Mesa's `llvmpipe` software +renderer and GTK's Cairo renderer by default. The launcher clears conflicting +VirGL/KGSL/Turnip loader overrides before starting GNOME. + +Build it with: + +```sh +sudo bash build.sh -s plucky -v gnomeRaw -a arm64 +``` + +The image is written to +`fs-cook/out/plucky-gnomeRaw-arm64.tar.gz`. After extracting the rootfs and +starting Termux:X11, launch GNOME from the rootfs with: + +```sh +udroid-gnome-x11 +``` + +The `udroid-gnome-x11` launcher starts the system D-Bus when needed, creates a +per-user runtime directory, checks the X11 connection, and starts a fresh +session D-Bus for GNOME. It intentionally uses CPU rendering; it does not +attempt to enable VirGL or direct KGSL acceleration. ## Resolute Plasma image diff --git a/suites/plucky/gnomeRaw/.architectures b/suites/plucky/gnomeRaw/.architectures new file mode 100644 index 00000000..d4000675 --- /dev/null +++ b/suites/plucky/gnomeRaw/.architectures @@ -0,0 +1 @@ +arm64 diff --git a/suites/plucky/gnomeRaw/gnomeRaw-cleanup.sh b/suites/plucky/gnomeRaw/gnomeRaw-cleanup.sh new file mode 100644 index 00000000..2c72298f --- /dev/null +++ b/suites/plucky/gnomeRaw/gnomeRaw-cleanup.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +apt-get clean +rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb diff --git a/suites/plucky/gnomeRaw/gnomeRaw-extras.sh b/suites/plucky/gnomeRaw/gnomeRaw-extras.sh new file mode 100644 index 00000000..2e5f1ba4 --- /dev/null +++ b/suites/plucky/gnomeRaw/gnomeRaw-extras.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +export DEBIAN_FRONTEND=noninteractive + +apt-get install -y \ + gnome-system-monitor gnome-text-editor gnome-calculator gnome-calendar \ + gnome-clocks file-roller evince yaru-theme-icon diff --git a/suites/plucky/gnomeRaw/gnomeRaw-fixes.sh b/suites/plucky/gnomeRaw/gnomeRaw-fixes.sh new file mode 100644 index 00000000..2e03bccc --- /dev/null +++ b/suites/plucky/gnomeRaw/gnomeRaw-fixes.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +# PRoot does not provide systemd/logind. GNOME 48 may detect the installed +# login1 service and ask D-Bus to start it; that activation fails inside +# Android PRoot and aborts GNOME Shell initialization. Keep the service file +# for reference, but move it out of D-Bus's system-services search directory. +login1_service=/usr/share/dbus-1/system-services/org.freedesktop.login1.service +if [[ -e "$login1_service" || -L "$login1_service" ]]; then + mkdir -p /root/login1-disabled + mv -f "$login1_service" /root/login1-disabled/ +fi + +mkdir -p /etc/profile.d /etc/dconf/profile /etc/dconf/db/local.d +cat > /etc/dconf/profile/user <<'PROFILE' +user-db:user +system-db:local +PROFILE + +if command -v dconf >/dev/null 2>&1; then + dconf update || true +fi + +cat > /usr/local/bin/udroid-gnome-x11 <<'LAUNCH' +#!/usr/bin/env bash +set -Eeuo pipefail + +die() { + printf '[udroid-gnome] ERROR: %s\n' "$*" >&2 + exit 1 +} + +# Do not inherit experimental VirGL, KGSL, Turnip, or custom Mesa loader +# settings. Those settings caused Mutter to lose its rendering connection. +unset MESA_LOADER_DRIVER_OVERRIDE +unset FD_FORCE_KGSL +unset TURNIP_KMD +unset VK_ICD_FILENAMES +unset VK_LOADER_LAYERS_DISABLE +unset LD_LIBRARY_PATH +unset LIBGL_DRIVERS_PATH +unset EGL_DRIVERS_PATH +unset __EGL_VENDOR_LIBRARY_FILENAMES +unset DBUS_SESSION_BUS_ADDRESS +unset DBUS_SYSTEM_BUS_ADDRESS + +export DISPLAY="${DISPLAY:-:0}" +export XDG_SESSION_TYPE=x11 +export XDG_CURRENT_DESKTOP=GNOME +export XDG_SESSION_DESKTOP=gnome +export DESKTOP_SESSION=gnome +export LIBGL_ALWAYS_SOFTWARE=1 +export GALLIUM_DRIVER=llvmpipe +export GSK_RENDERER=cairo +export GDK_BACKEND=x11 + +# A private runtime directory is required by modern GNOME. Allow an explicit +# override, otherwise keep each Unix user in a separate directory. +export XDG_RUNTIME_DIR="${UDROID_GNOME_RUNTIME_DIR:-/tmp/gnome-runtime-$(id -u)}" +mkdir -p "$XDG_RUNTIME_DIR" || die "cannot create $XDG_RUNTIME_DIR" +chmod 0700 "$XDG_RUNTIME_DIR" || die "cannot secure $XDG_RUNTIME_DIR" + +if ! command -v gnome-shell >/dev/null 2>&1; then + die "gnome-shell is not installed" +fi + +if command -v xdpyinfo >/dev/null 2>&1 && + ! xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then + die "cannot connect to the X server at DISPLAY=$DISPLAY; start Termux:X11 first" +fi + +# Ensure the machine ID exists before starting a system bus. +if command -v dbus-uuidgen >/dev/null 2>&1; then + dbus-uuidgen --ensure=/etc/machine-id +fi + +# Make sure the system bus is healthy without killing an already-working bus. +if ! dbus-send --system --print-reply \ + --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames \ + >/dev/null 2>&1; then + mkdir -p /run/dbus + rm -f /run/dbus/pid /run/dbus/system_bus_socket + + if command -v service >/dev/null 2>&1; then + service dbus start || true + fi + + if ! dbus-send --system --print-reply \ + --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames \ + >/dev/null 2>&1; then + dbus-daemon --system --fork --nopidfile --nosyslog || + die "could not start the system D-Bus daemon" + fi +fi + +dbus-send --system --print-reply \ + --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames \ + >/dev/null 2>&1 || die "the system D-Bus is not responding" + +exec dbus-run-session -- gnome-shell --x11 --sm-disable +LAUNCH +chmod 0755 /usr/local/bin/udroid-gnome-x11 + +cat > /root/start-gnome.sh <<'LAUNCH' +#!/usr/bin/env bash +exec /usr/local/bin/udroid-gnome-x11 "$@" +LAUNCH +chmod 0755 /root/start-gnome.sh diff --git a/suites/plucky/gnomeRaw/gnomeRaw-setup.sh b/suites/plucky/gnomeRaw/gnomeRaw-setup.sh new file mode 100644 index 00000000..1c916a24 --- /dev/null +++ b/suites/plucky/gnomeRaw/gnomeRaw-setup.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +export DEBIAN_FRONTEND=noninteractive + +# Suppress service startup only while packages are installed in the image. +# Restore any pre-existing policy-rc.d (or remove ours) even if APT fails. +policy_file=/usr/sbin/policy-rc.d +policy_backup=/tmp/udroid-policy-rc.d.backup +had_policy=false +if [[ -e "$policy_file" || -L "$policy_file" ]]; then + cp -a "$policy_file" "$policy_backup" + had_policy=true +else + rm -f "$policy_backup" +fi + +restore_policy_rc_d() { + if [[ "$had_policy" == true ]]; then + rm -f "$policy_file" + mv -f "$policy_backup" "$policy_file" + else + rm -f "$policy_file" "$policy_backup" + fi +} +trap restore_policy_rc_d EXIT + +mkdir -p /usr/sbin +cat > "$policy_file" <<'POLICY' +#!/bin/sh +exit 101 +POLICY +chmod 0755 "$policy_file" + +apt-get update +apt-get install -y \ + gnome-core gnome-shell gnome-control-center nautilus gnome-terminal \ + gnome-shell-extensions gnome-shell-extension-ubuntu-dock \ + dbus dbus-bin dbus-x11 dconf-cli xorg xauth x11-utils x11-xserver-utils \ + mesa-utils libgl1-mesa-dri libglx-mesa0 libegl1 libgles2 libgbm1 libdrm2 \ + locales network-manager sudo nano wget curl git ca-certificates \ + fonts-ubuntu fonts-noto-color-emoji + +restore_policy_rc_d +trap - EXIT + +locale-gen en_US.UTF-8 || true +update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 || true + +mkdir -p /etc/profile.d +cat > /etc/profile.d/gnome-termux-x11.sh <<'PROFILE' +# Defaults for GNOME running against a Termux:X11 display. +export DISPLAY="${DISPLAY:-:0}" +export XDG_CURRENT_DESKTOP=GNOME +export XDG_SESSION_DESKTOP=gnome +export DESKTOP_SESSION=gnome + +# Use Mesa's CPU renderer. VirGL/KGSL overrides are handled by the launcher. +export LIBGL_ALWAYS_SOFTWARE=1 +export GALLIUM_DRIVER=llvmpipe +export GSK_RENDERER=cairo +PROFILE +chmod 0644 /etc/profile.d/gnome-termux-x11.sh diff --git a/suites/plucky/gnomeRaw/gnomeRaw.sh b/suites/plucky/gnomeRaw/gnomeRaw.sh new file mode 100644 index 00000000..2c6b94a4 --- /dev/null +++ b/suites/plucky/gnomeRaw/gnomeRaw.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +set -Ee + +# fs-cook variant entry point for the Plucky GNOME X11 image. +source plugins/envsetup + +SUITE=plucky +VARIENT=gnomeRaw +frn=out/plucky-gnomeRaw +OVERRIDER_COMPRESSION_TYPE=gzip +ENABLE_EXIT=true +ENABLE_USER_SETUP=false + +additional_setup() { + # Plucky is built for ARM64 using the same Ports mirror used by the + # Plucky rootfs. Keep this list aligned with the release's supported pockets. + cat > "$chroot_dir/etc/apt/sources.list" <