From 680dcb69e4ce139e0c8fc7e7a372131f4157e834 Mon Sep 17 00:00:00 2001 From: Abdullah Fageeh Date: Sat, 24 Oct 2026 04:56:39 +0300 Subject: [PATCH 1/4] Add Omarchy image support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Omarchy is Arch + Hyprland, so this reuses the Arch distrobuilder recipe: distros/omarchy/image.yaml installs the runtime half of Omarchy's own package lists (install/omarchy-base.packages + omarchy-other.packages), drops linux-ps5 in with pacman -U and boots into Hyprland from a tty1 autologin — the same pattern as the Arch, CachyOS and SteamOS images. Excluded from the package set: ISO-provided kernels (linux-omarchy, linux-t2), DKMS trees that cannot build against linux-ps5 (nvidia*, broadcom-wl-dkms, asusctl, tuxedo-drivers, t2fanrd, macbook12-spi) and boot/OS-management pieces of the ISO (limine, plymouth, snapper, btrfs-progs) that the kexec + FAT32/ext4 layout does not use. Wires the distro into build_image.sh (arch kernel format), the image builder entrypoint staging, the build-image workflow choice/all matrix and the release table so it is published as ps5-omarchy.img.xz next to the other images. --- .github/workflows/build-image.yml | 5 +- README.md | 9 +- build_image.sh | 4 +- distros/omarchy/README.md | 51 ++++++ distros/omarchy/cmdline.txt | 1 + distros/omarchy/grow-rootfs | 91 ++++++++++ distros/omarchy/grow-rootfs.service | 13 ++ distros/omarchy/image.yaml | 269 ++++++++++++++++++++++++++++ docker/image-builder/entrypoint.sh | 6 + 9 files changed, 443 insertions(+), 6 deletions(-) create mode 100644 distros/omarchy/README.md create mode 100644 distros/omarchy/cmdline.txt create mode 100755 distros/omarchy/grow-rootfs create mode 100644 distros/omarchy/grow-rootfs.service create mode 100644 distros/omarchy/image.yaml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 2c88fdb..5cd3ae9 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -8,7 +8,7 @@ on: description: 'Distribution' default: 'ubuntu2604' type: choice - options: [all, ubuntu2604, arch, cachyos, fedora, proxmox, debian, bazzite, bazzite-deck, steamos] + options: [all, ubuntu2604, arch, cachyos, omarchy, fedora, proxmox, debian, bazzite, bazzite-deck, steamos] workflow_call: inputs: distro: @@ -34,7 +34,7 @@ jobs: run: | INPUT="${{ inputs.distro || 'ubuntu2604' }}" if [ "$INPUT" = "all" ]; then - echo 'distros=["ubuntu2604","arch","cachyos","fedora","proxmox","debian","bazzite","bazzite-deck","steamos"]' >> "$GITHUB_OUTPUT" + echo 'distros=["ubuntu2604","arch","cachyos","omarchy","fedora","proxmox","debian","bazzite","bazzite-deck","steamos"]' >> "$GITHUB_OUTPUT" else echo "distros=[\"$INPUT\"]" >> "$GITHUB_OUTPUT" fi @@ -183,6 +183,7 @@ jobs: { key: 'ubuntu2604', label: 'Ubuntu 26.04', file: 'ps5-ubuntu2604.img.xz' }, { key: 'arch', label: 'Arch', file: 'ps5-arch.img.xz' }, { key: 'cachyos', label: 'CachyOS', file: 'ps5-cachyos.img.xz' }, + { key: 'omarchy', label: 'Omarchy', file: 'ps5-omarchy.img.xz' }, { key: 'fedora', label: 'Fedora 44', file: 'ps5-fedora.img.xz' }, { key: 'proxmox', label: 'Proxmox VE 8', file: 'ps5-proxmox.img.xz' }, { key: 'debian', label: 'Debian 12', file: 'ps5-debian.img.xz' }, diff --git a/README.md b/README.md index 05f8ee2..f3a8afe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PS5 Linux Image Builder -Builds bootable Linux USB images for PlayStation 5 using Docker containers. Supports Ubuntu 26.04, Arch, CachyOS (Gamescope + Steam), Fedora (GNOME), individually or as a multi-distro image with kexec switching. +Builds bootable Linux USB images for PlayStation 5 using Docker containers. Supports Ubuntu 26.04, Arch, CachyOS (Gamescope + Steam), Omarchy (Arch + Hyprland), Fedora (GNOME), individually or as a multi-distro image with kexec switching. ## Prerequisites @@ -27,6 +27,9 @@ OR OR +# Build Omarchy (Arch-based, Hyprland desktop) +./build_image.sh --distro omarchy + OR # Build Fedora (GNOME desktop) @@ -50,7 +53,7 @@ sudo dd if=output/ps5-ubuntu2604.img of=/dev/sdX bs=4M status=progress | Flag | Description | Default | |------|-------------|---------| -| `--distro` | `ubuntu2604`, `arch`, `cachyos`, `fedora`, or `all` | `ubuntu2604` | +| `--distro` | `ubuntu2604`, `arch`, `cachyos`, `omarchy`, `fedora`, or `all` | `ubuntu2604` | | `--kernel` | Path to kernel source directory | auto-clone version selected by PS5 patch set | | `--img-size` | Disk image size in MB | `12000` (`32000` for `all`) | | `--clean` | Remove all cached build artifacts and start fresh | off | @@ -98,6 +101,7 @@ All verbose output goes to `build.log`. The terminal shows a spinner with live p | Ubuntu 26.04 (Resolute) | GNOME | `.deb` | systemd | | Arch | Sway | `.pkg.tar.zst` | systemd | | CachyOS | Gamescope + Steam Big Picture (Arch + `[cachyos]` repo, no v3 migration in image build) | `.pkg.tar.zst` | systemd | +| Omarchy | Hyprland (Arch + the Omarchy package set, see `distros/omarchy/README.md`) | `.pkg.tar.zst` | systemd | ## Multi-distro Image @@ -144,6 +148,7 @@ distros/ ubuntu2604/ # Ubuntu 26.04 (Resolute) arch/ # Arch Linux cachyos/ # CachyOS repos + Gamescope/Steam + omarchy/ # Omarchy (Arch + Hyprland) package set shared/ # Kernel postinst hooks (single + multi) boot/ cmdline.txt # Kernel cmdline template (__DISTRO__ placeholder) diff --git a/build_image.sh b/build_image.sh index caeb250..1270194 100755 --- a/build_image.sh +++ b/build_image.sh @@ -17,7 +17,7 @@ usage() { echo "Usage: $0 [--distro ] [--kernel ] [--img-size ] [--clean]" echo "" echo "Options:" - echo " --distro Distribution to build: ubuntu2604, arch, cachyos, fedora, proxmox, debian, bazzite, bazzite-deck, batocera, all (default: ubuntu2604)" + echo " --distro Distribution to build: ubuntu2604, arch, cachyos, omarchy, fedora, proxmox, debian, bazzite, bazzite-deck, batocera, all (default: ubuntu2604)" echo " --kernel Path to kernel source directory (default: auto-clone to work/linux/)" echo " --img-size Disk image size in MB (default: 12000, 32000 for --distro all)" echo " --clean Remove all cached build artifacts and start from scratch" @@ -85,7 +85,7 @@ esac if [ -z "$FORMAT" ]; then case "$DISTRO" in - arch|cachyos|steamos) FORMAT="arch" ;; + arch|cachyos|omarchy|steamos) FORMAT="arch" ;; fedora|bazzite*) FORMAT="rpm" ;; all) FORMAT="all" ;; *) FORMAT="deb" ;; diff --git a/distros/omarchy/README.md b/distros/omarchy/README.md new file mode 100644 index 0000000..f129c7a --- /dev/null +++ b/distros/omarchy/README.md @@ -0,0 +1,51 @@ +# omarchy + +[Omarchy](https://omarchy.org) — DHH's opinionated Arch + Hyprland desktop — +built on PS5 hardware with our `linux-ps5` kernel. + +## How it is built + +Omarchy's official installer is an ISO wizard (`archinstall` + the `install/` +scripts from [omacom/omarchy](https://github.com/omacom/omarchy)); there is no +supported way to run it headlessly against a pre-made rootfs, so this distro +does **not** reuse their artifacts. Instead `distros/omarchy/image.yaml` mirrors +the runtime half of Omarchy's package lists +(`install/omarchy-base.packages` + `install/omarchy-other.packages`) onto the +same Arch `distro builder` recipe the Arch image uses: + +1. Arch bootstrap → pacman installs the Omarchy package set (Hyprland, Quickshell, + waybar-style bar tooling, Chromium, foot, Neovim, PipeWire, Docker, …). +2. Drop `linux-ps5` (`pacman -U`) and rebuild the initramfs without `autodetect`. +3. tty1 autologin as `ps5` → `exec Hyprland`. + +Left out on purpose: + +- `linux-omarchy` / `linux-omarchy-headers` / `linux-t2` — the PS5 image ships + its own patched kernel. +- DKMS trees for other machines (`nvidia*`, `broadcom-wl-dkms`, `asusctl`, + `tuxedo-drivers`, `t2fanrd`, `macbook12-spi-driver-dkms`) — they cannot build + against `linux-ps5`, and pulling them in makes the pacman transaction fail. +- Boot/OS-management pieces of the ISO image (`limine`, `plymouth`, `snapper`, + `btrfs-progs`) — PS5 images boot through kexec with a FAT32 EFI partition and + an ext4 root. +- Intel/Apple-only firmware and tools. + +## Build locally + +```bash +./build_image.sh --distro omarchy +``` + +Image size defaults to the shared 12 GB. The `.img.xz` lands in +`output/ps5-omarchy.img.xz`. + +## Caveats + +- `omarchy`'s own theme/config repository (`~/.local/share/omarchy`) is not + installed; this is the package-level desktop (Hyprland + the apps), not the + full Omarchy dotfiles experience. Running Omarchy's installer on the booted + PS5 should layer its configs on top, as it would on any Arch install. +- The PS5 Oberon GPU has no working hardware video decode in mainline Mesa; + Chromium will software-decode. +- Like every PS5 image here, default credentials are `ps5` / `ps5` with + passwordless sudo. Change them before exposing the machine to a network. diff --git a/distros/omarchy/cmdline.txt b/distros/omarchy/cmdline.txt new file mode 100644 index 0000000..6660afc --- /dev/null +++ b/distros/omarchy/cmdline.txt @@ -0,0 +1 @@ +root=LABEL=__DISTRO__ rw rootwait console=ttyTitania0 console=tty0 mitigations=off idle=halt preempt=full diff --git a/distros/omarchy/grow-rootfs b/distros/omarchy/grow-rootfs new file mode 100755 index 0000000..ceac5cf --- /dev/null +++ b/distros/omarchy/grow-rootfs @@ -0,0 +1,91 @@ +#!/bin/bash +# Grows the root partition + filesystem to fill the disk on first boot. +# Self-disables after success. +# +# Uses sfdisk + partx + resize2fs (all in util-linux + e2fsprogs, both +# present in the minimal Arch/SteamOS base). Earlier versions called +# growpart from cloud-utils — but that package isn't in the SteamOS +# recovery image, so the unit failed with "growpart: command not found" +# and rootfs stayed at the dd'd image size (~14 GB) on any disk larger +# than that. +set -e + +ROOT_DEV=$(findmnt -no SOURCE /) +DISK="/dev/$(lsblk -ndo PKNAME "$ROOT_DEV")" + +# PS5 M.2 drive appear as /dev/nvme*. Do not modify partition table, +# because it contains m2_init PS5 offset. Only USB drive (/dev/sd*) +# are safe for automatic grow root partition. +if [[ "$(basename "$DISK")" == nvme* ]]; then + echo "grow-rootfs: M.2 detected, skipping" + systemctl disable grow-rootfs.service + exit 0 +fi + +PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition) + +# Our images dd at their built size (~14 GB) onto a much larger USB. The GPT +# backup header is therefore at byte ~built-size, not at end of disk. Move +# the backup header to end-of-disk first so partition table growth works. +sgdisk -e "$DISK" + +# If a previous flash left behind partitions BEYOND our rootfs + boot pair +# (e.g. a stale `linux-home` partset at part 3 from a prior SteamOS install +# on the same drive), the partition extend refuses to grow into the space +# already claimed by the leftover partition. Delete every partition with a +# number higher than 2 — we only ever create partitions 1 (rootfs) + 2 (boot). +# Important: sgdisk only rewrites the on-disk GPT; we must ALSO drop those +# stale entries from the kernel's in-memory partition table via partx -d, +# or BLKPG_RESIZE_PARTITION below returns EBUSY because the kernel still +# thinks sda1 would have to grow into space owned by phantom sda3. +for n in $(parted -ms "$DISK" print 2>/dev/null \ + | awk -F: 'NR>2 && $1+0>2 {print $1}'); do + sgdisk -d "$n" "$DISK" 2>/dev/null || true + partx -d --nr "$n" "$DISK" 2>/dev/null || true +done + +# sfdisk `,+` extends partition $PART_NUM to consume all available free +# space. Works on a mounted/live partition because sfdisk only rewrites +# the GPT entry (kernel re-read of the partition table comes next). +echo ",+" | sfdisk --no-reread -N "$PART_NUM" "$DISK" + +# Make the kernel pick up the new partition size without unmounting via +# BLKPG_RESIZE_PARTITION. partx -u also uses BLKPG, but on some images +# (notably SteamOS recovery loop-mounted btrfs) partx returns an error +# updating the mounted partition; the direct ioctl is more reliable. +python3 - "$DISK" "$PART_NUM" <<'PY' +import sys, os, fcntl, ctypes, subprocess +disk, pno = sys.argv[1], int(sys.argv[2]) +out = subprocess.run(["sfdisk","--bytes","-q","-l",disk], + capture_output=True, text=True, check=True).stdout +start = sectors = None +for line in out.splitlines(): + if line.startswith(f"{disk}{pno} ") or line.startswith(f"{disk}p{pno} "): + f = line.split() + start, sectors = int(f[1]), int(f[3]) + break +if start is None: + sys.exit(f"could not parse partition {pno} from sfdisk -l {disk}") +class P(ctypes.Structure): + _fields_=[("start",ctypes.c_longlong),("length",ctypes.c_longlong), + ("pno",ctypes.c_int),("devname",ctypes.c_char*64), + ("volname",ctypes.c_char*64)] +class A(ctypes.Structure): + _fields_=[("op",ctypes.c_int),("flags",ctypes.c_int), + ("datalen",ctypes.c_int),("data",ctypes.c_void_p)] +p = P(start=start*512, length=sectors*512, pno=pno) +a = A(op=3, flags=0, datalen=ctypes.sizeof(p), data=ctypes.addressof(p)) +fd = os.open(disk, os.O_RDONLY) +try: + fcntl.ioctl(fd, 0x1269, a) # BLKPG, BLKPG_RESIZE_PARTITION +finally: + os.close(fd) +PY + +# Belt-and-suspenders: also try partx in case BLKPG via python failed. +partx -u --nr "$PART_NUM" "$DISK" 2>/dev/null || true + +# Online ext4 grow. +resize2fs "$ROOT_DEV" + +systemctl disable grow-rootfs.service diff --git a/distros/omarchy/grow-rootfs.service b/distros/omarchy/grow-rootfs.service new file mode 100644 index 0000000..722eca7 --- /dev/null +++ b/distros/omarchy/grow-rootfs.service @@ -0,0 +1,13 @@ +[Unit] +Description=Grow root filesystem to fill disk +DefaultDependencies=no +Before=local-fs.target +After=local-fs-pre.target + +[Service] +Type=oneshot +ExecStart=/usr/local/sbin/grow-rootfs +RemainAfterExit=yes + +[Install] +WantedBy=local-fs.target diff --git a/distros/omarchy/image.yaml b/distros/omarchy/image.yaml new file mode 100644 index 0000000..b0b5ada --- /dev/null +++ b/distros/omarchy/image.yaml @@ -0,0 +1,269 @@ +image: + name: ps5-omarchy + distribution: archlinux + release: rolling + description: Omarchy (Arch + Hyprland) desktop for PS5 + architecture: x86_64 +source: + downloader: archlinux-http + url: https://geo.mirror.pkgbuild.com/iso + skip_verification: true +packages: + manager: pacman + update: true + cleanup: true + repositories: + - name: mirrorlist + url: |- + Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch + Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch + sets: + - packages: + # Runtime subset of install/omarchy-base.packages + omarchy-other.packages. + # Left out: ISO-provided kernels (linux-omarchy, linux-t2), DKMS trees + # (nvidia*, broadcom-wl, asusctl, tuxedo-drivers, t2fanrd, macbook12-spi), + # boot tie-ins (limine*, snapper, plymouth) and Intel/apple-only pieces. + - alsa-utils + - avahi + - base + - base-devel + - bash-completion + - bat + - bluez + - bluez-utils + - bolt + - brightnessctl + - btop + - chromium + - cups + - cups-filters + - cups-pk-helper + - ddcutil + - docker + - docker-buildx + - docker-compose + - dosfstools + - expac + - eza + - fakeroot + - fastfetch + - fd + - ffmpeg + - ffmpegthumbnailer + - fzf + - git + - gnome-keyring + - gnome-themes-extra + - grim + - gum + - gvfs-mtp + - gvfs-nfs + - gvfs-smb + - hyprland + - hyprland-guiutils + - hyprland-preview-share-picker + - hyprpicker + - hyprsunset + - imagemagick + - imv + - inetutils + - inotify-tools + - inxi + - jq + - kernel-modules-hook + - lazygit + - less + - libsecret + - libvips + - libyaml + - libreoffice-fresh + - lua51 + - luarocks + - man-db + - mise-bin + - mpv + - nautilus + - nautilus-python + - networkmanager + - noto-fonts + - noto-fonts-cjk + - noto-fonts-emoji + - nss-mdns + - nvim + - pacman-contrib + - pamixer + - pinta + - plocate + - power-profiles-daemon + - python-gobject + - python-poetry-core + - qemu-user-static-binfmt + - qrencode + - quickshell + - ripgrep + - ruby + - socat + - starship + - sushi + - tesseract + - tesseract-data-eng + - tldr + - tmux + - tree-sitter-cli + - ttf-ia-writer + - ttf-jetbrains-mono-nerd-basic + - tzupdate + - udiskie + - unzip + - vi + - whois + - wireless-regdb + # Display / GPU (AMD Oberon) + - mesa + - vulkan-radeon + - libva-mesa-driver + - xf86-video-amdgpu + - libinput + - xkeyboard-config + # Wayland plumbing + - foot + - pipewire + - pipewire-alsa + - pipewire-jack + - pipewire-pulse + - wireplumber + - gst-plugin-pipewire + - gtk4-layer-shell + - qt6-base + - qt6-declarative + - qt6-imageformats + - qt6-multimedia + - qt6-svg + - qt6-wayland + - wl-clipboard + - wtype + - xdg-desktop-portal-gtk + - xdg-desktop-portal-hyprland + - xdg-terminal-exec + - zbar + # System + - dbus + - e2fsprogs + - egl-wayland + - htop + - kexec-tools + - kmod + - linux-firmware + - mkinitcpio + - openssh + - parted + - polkit + - seatd + - sudo + - zoxide + action: install +files: +- path: /etc/hostname + generator: hostname +- path: /etc/hosts + generator: hosts +- path: /etc/kernel/postinst.d/zz-update-boot + generator: copy + source: /tmp/build-staging/zz-update-boot + mode: "0755" +- path: /etc/fstab + generator: copy + source: /tmp/build-staging/fstab +- path: /usr/local/sbin/grow-rootfs + generator: copy + source: /tmp/build-staging/grow-rootfs + mode: "0755" +- path: /etc/systemd/system/grow-rootfs.service + generator: copy + source: /tmp/build-staging/grow-rootfs.service +- path: /opt/pkgs/ + generator: copy + source: /tmp/build-staging/pkgs +actions: +- trigger: post-unpack + action: |- + #!/bin/bash + set -eux + # Pacman 7 Landlock sandbox is unsupported under QEMU; disable it. + sed -i '/^\[options\]/a DisableSandbox' /etc/pacman.conf + pacman-key --init + pacman-key --populate archlinux + pacman -Syy --noconfirm +- trigger: post-packages + action: |- + #!/bin/bash + set -eux + # fc-cache / systemctl can SIGSEGV under QEMU when the image platform is + # linux/amd64 on an arm64 host. + fc-cache -f 2>/dev/null || true + symlink_wants() { + local src=$1 + local target=$2 + [ -e "$src" ] || return 0 + mkdir -p "/etc/systemd/system/${target}.wants" + ln -sf "$src" "/etc/systemd/system/${target}.wants/$(basename "$src")" + } + sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config + sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config + symlink_wants /usr/lib/systemd/system/sshd.service multi-user.target + symlink_wants /usr/lib/systemd/system/NetworkManager.service multi-user.target + symlink_wants /usr/lib/systemd/system/seatd.service multi-user.target + for s in pipewire pipewire-pulse wireplumber; do + symlink_wants "/usr/lib/systemd/system/${s}.service" default.target || true + done +- trigger: post-files + action: |- + #!/bin/bash + set -eux + mkdir -p /etc/systemd/system/local-fs.target.wants + ln -sf /etc/systemd/system/grow-rootfs.service \ + /etc/systemd/system/local-fs.target.wants/grow-rootfs.service + systemctl enable bluetooth.service + # Default user (ps5/ps5) — Omarchy's own wizard normally creates this on + # a real install; images ship it pre-created. + useradd -m -G wheel,seat -s /bin/bash ps5 + echo "ps5:ps5" | chpasswd + echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/wheel + # No display manager: tty1 autologin starts the session, same as the + # Arch/CachyOS/SteamOS images. Mask SDDM in case a pulled-in package + # depends on it. + ln -sf /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target + ln -sf /dev/null /etc/systemd/system/sddm.service + ln -sf /dev/null /etc/systemd/systemd-firstboot.service + mkdir -p /etc/systemd/system/getty@tty1.service.d + printf '%s\n' '[Service]' \ + 'ExecStart=' \ + 'ExecStart=-/sbin/agetty --autologin ps5 --noclear %I $TERM' \ + > /etc/systemd/system/getty@tty1.service.d/autologin.conf + # Omarchy's own launcher (`omarchy hyprland`) and session file are not + # part of this package set, so launch Hyprland directly. + { + echo 'if [ "$(tty)" = "/dev/tty1" ] && [ -z "$WAYLAND_DISPLAY" ]; then' + echo ' export XDG_RUNTIME_DIR="/tmp/xdg-runtime-$(id -u)"' + echo ' mkdir -p "$XDG_RUNTIME_DIR"' + echo ' chmod 700 "$XDG_RUNTIME_DIR"' + echo ' exec Hyprland' + echo 'fi' + } >> /home/ps5/.bash_profile + chown ps5:ps5 /home/ps5/.bash_profile + # Ensure vconsole.conf exists (needed by mkinitcpio sd-vconsole hook) + [ -f /etc/vconsole.conf ] || echo "KEYMAP=us" > /etc/vconsole.conf + # Drop autodetect — it detects the build host's hardware, not the target. + # This produces a larger but hardware-independent initramfs. + sed -i 's/ autodetect//' /etc/mkinitcpio.conf + # Install custom kernel packages + if ls /opt/pkgs/*.pkg.tar.zst 1>/dev/null 2>&1; then + pacman -U --noconfirm --ask 4 /opt/pkgs/*.pkg.tar.zst + rm -rf /opt/pkgs + KVER=$(ls -1t /lib/modules | head -1) + mkinitcpio -k "$KVER" -g "/boot/initrd.img-$KVER" || true + fi + mkdir -p /boot/efi + /etc/kernel/postinst.d/zz-update-boot +mappings: + architecture_map: archlinux diff --git a/docker/image-builder/entrypoint.sh b/docker/image-builder/entrypoint.sh index 42ae45b..88ba156 100755 --- a/docker/image-builder/entrypoint.sh +++ b/docker/image-builder/entrypoint.sh @@ -84,6 +84,12 @@ EOF mkdir -p "$STAGING/pkgs" cp /kernel-debs/*.pkg.tar.zst "$STAGING/pkgs/" ;; + omarchy) + cp /repo/distros/${DISTRO}/grow-rootfs "$STAGING/" + cp /repo/distros/${DISTRO}/grow-rootfs.service "$STAGING/" + mkdir -p "$STAGING/pkgs" + cp /kernel-debs/*.pkg.tar.zst "$STAGING/pkgs/" + ;; cachyos) mkdir -p "$STAGING/files" cp /repo/distros/cachyos/files/grow-rootfs "$STAGING/files/" From b9e4154047b776198cb5f047908a07157913049c Mon Sep 17 00:00:00 2001 From: Abdullah Fageeh Date: Sat, 24 Oct 2026 05:03:14 +0300 Subject: [PATCH 2/4] omarchy: install the real Omarchy packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first revision hand-assembled Omarchy's package lists. That is not what an Omarchy machine is: the desktop ships as Arch packages in Omarchy's own repo (omarchy, omarchy-settings, omarchy-keyring, themes, nvim config, titlebars), and Omarchy's docs describe prebuilt images as a supported shape (docs/file-layout.md, agents/skills/install-scripts.md), with hardware leaves deferred to the machine's first boot. - stage-pkgs.sh: fetch omarchy.db plus the six runtime/support packages from pkgs.omarchy.org (channel selectable via OMARCHY_CHANNEL), cached in /build/cache/omarchy. - image.yaml: small Arch base (GPU, session plumbing, network, linux-ps5); the post-files action installs the staged packages with pacman -U --nodeps (no DNS in the chroot) and runs Omarchy's pacman setup (its repo + Omarchy's stable Arch mirror), as `omarchy apply pacman` does. - post-install.sh: Omarchy's config/ and login/ setup leaves plus omarchy-finalize-user for ps5 — the steps omarchy-apply-system runs outside hardware/ and boot/. - build-rootfs.sh: runs the distrobuilder recipe and drops the staging directories again afterwards. - entrypoint.sh: the generic build-rootfs.sh branch is used, so the duplicated staging case goes away (comment updated to match). --- README.md | 4 +- distros/omarchy/README.md | 82 +++++++------ distros/omarchy/build-rootfs.sh | 61 ++++++++++ distros/omarchy/image.yaml | 180 ++++++++++------------------- distros/omarchy/post-install.sh | 96 +++++++++++++++ distros/omarchy/stage-pkgs.sh | 56 +++++++++ docker/image-builder/entrypoint.sh | 15 +-- 7 files changed, 327 insertions(+), 167 deletions(-) create mode 100755 distros/omarchy/build-rootfs.sh create mode 100755 distros/omarchy/post-install.sh create mode 100755 distros/omarchy/stage-pkgs.sh diff --git a/README.md b/README.md index f3a8afe..3ae480a 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ All verbose output goes to `build.log`. The terminal shows a spinner with live p | Ubuntu 26.04 (Resolute) | GNOME | `.deb` | systemd | | Arch | Sway | `.pkg.tar.zst` | systemd | | CachyOS | Gamescope + Steam Big Picture (Arch + `[cachyos]` repo, no v3 migration in image build) | `.pkg.tar.zst` | systemd | -| Omarchy | Hyprland (Arch + the Omarchy package set, see `distros/omarchy/README.md`) | `.pkg.tar.zst` | systemd | +| Omarchy | Hyprland (Arch + the Omarchy packages from `pkgs.omarchy.org`, see `distros/omarchy/README.md`) | `.pkg.tar.zst` | systemd | ## Multi-distro Image @@ -148,7 +148,7 @@ distros/ ubuntu2604/ # Ubuntu 26.04 (Resolute) arch/ # Arch Linux cachyos/ # CachyOS repos + Gamescope/Steam - omarchy/ # Omarchy (Arch + Hyprland) package set + omarchy/ # Omarchy (Arch + Hyprland) packages + setup shared/ # Kernel postinst hooks (single + multi) boot/ cmdline.txt # Kernel cmdline template (__DISTRO__ placeholder) diff --git a/distros/omarchy/README.md b/distros/omarchy/README.md index f129c7a..a32cd83 100644 --- a/distros/omarchy/README.md +++ b/distros/omarchy/README.md @@ -1,34 +1,41 @@ # omarchy -[Omarchy](https://omarchy.org) — DHH's opinionated Arch + Hyprland desktop — -built on PS5 hardware with our `linux-ps5` kernel. +[Omarchy](https://omarchy.org) — DHH's opinionated Arch + Hyprland desktop — on +PS5 hardware with our `linux-ps5` kernel. ## How it is built -Omarchy's official installer is an ISO wizard (`archinstall` + the `install/` -scripts from [omacom/omarchy](https://github.com/omacom/omarchy)); there is no -supported way to run it headlessly against a pre-made rootfs, so this distro -does **not** reuse their artifacts. Instead `distros/omarchy/image.yaml` mirrors -the runtime half of Omarchy's package lists -(`install/omarchy-base.packages` + `install/omarchy-other.packages`) onto the -same Arch `distro builder` recipe the Arch image uses: - -1. Arch bootstrap → pacman installs the Omarchy package set (Hyprland, Quickshell, - waybar-style bar tooling, Chromium, foot, Neovim, PipeWire, Docker, …). -2. Drop `linux-ps5` (`pacman -U`) and rebuild the initramfs without `autodetect`. -3. tty1 autologin as `ps5` → `exec Hyprland`. - -Left out on purpose: - -- `linux-omarchy` / `linux-omarchy-headers` / `linux-t2` — the PS5 image ships - its own patched kernel. -- DKMS trees for other machines (`nvidia*`, `broadcom-wl-dkms`, `asusctl`, - `tuxedo-drivers`, `t2fanrd`, `macbook12-spi-driver-dkms`) — they cannot build - against `linux-ps5`, and pulling them in makes the pacman transaction fail. -- Boot/OS-management pieces of the ISO image (`limine`, `plymouth`, `snapper`, - `btrfs-progs`) — PS5 images boot through kexec with a FAT32 EFI partition and - an ext4 root. -- Intel/Apple-only firmware and tools. +Omarchy's installer is an ISO wizard (`archinstall` plus the target-side +`omarchy apply system` step), but the desktop itself ships as ordinary Arch +packages in Omarchy's own repo (`omarchy`, `omarchy-settings`, +`omarchy-keyring`, themes, nvim config, titlebars). Omarchy's own docs describe +prebuilt images as a supported shape: the builder installs the packages and +their setup, and hardware leaves run on the machine's first boot +(`docs/file-layout.md`, `agents/skills/install-scripts.md`). + +So this distro is not a hand-assembled copy of the package lists: + +1. `distros/omarchy/build-rootfs.sh` fetches `omarchy.db` plus the six + runtime/support packages from `https://pkgs.omarchy.org/stable/x86_64` into + the build cache (`stage-pkgs.sh`), then runs distrobuilder on + `distros/omarchy/image.yaml`. +2. `image.yaml` installs a small Arch base — GPU, session plumbing, network, + plus `gum`/`perl`/`sddm` for `omarchy-settings` — drops in `linux-ps5`, and + rebuilds the initramfs without `autodetect`. +3. Its post-files action installs the staged Omarchy packages + (`pacman -U --nodeps`, the chroot has no DNS), uses Omarchy's pacman + configuration (its repo first, then Arch off Omarchy's stable mirror, as + `omarchy apply pacman` would), and runs + `distros/omarchy/post-install.sh`: Omarchy's `config/` and `login/` setup + leaves (locale, firewall, services, docker, passwordless keyring) and + `omarchy-finalize-user` for `ps5`. +4. Login is tty1 autologin as `ps5` → `exec Hyprland`, no SDDM, matching the + Arch / CachyOS / SteamOS images. + +Omarchy's `hardware/` leaves are **not** run at build time: they are the +per-machine steps (vulkan vendor, bluetooth, wifi regdom, platform fixes), and +several of them build DKMS modules against the image kernel, which is +`linux-ps5`, not `linux-omarchy`. ## Build locally @@ -36,16 +43,19 @@ Left out on purpose: ./build_image.sh --distro omarchy ``` -Image size defaults to the shared 12 GB. The `.img.xz` lands in -`output/ps5-omarchy.img.xz`. +The `.img.xz` lands in `output/ps5-omarchy.img.xz`. `OMARCHY_CHANNEL` +(`stable`, `rc`, `edge`) selects the repo channel; it defaults to `stable`. ## Caveats -- `omarchy`'s own theme/config repository (`~/.local/share/omarchy`) is not - installed; this is the package-level desktop (Hyprland + the apps), not the - full Omarchy dotfiles experience. Running Omarchy's installer on the booted - PS5 should layer its configs on top, as it would on any Arch install. -- The PS5 Oberon GPU has no working hardware video decode in mainline Mesa; - Chromium will software-decode. -- Like every PS5 image here, default credentials are `ps5` / `ps5` with - passwordless sudo. Change them before exposing the machine to a network. +- The image ships the Omarchy *packages*. Anything the ISO wizard does outside + them — partition layout, LUKS, `limine`/`snapper` boot and snapshot setup — + is replaced by this repo's kexec boot flow and ext4 layout, as for every + other PS5 image. +- Some Omarchy packages pull things that only make sense in Omarchy's own + installer (e.g. `omarchy-settings` on `plymouth`); the Omarchy packages are + installed with `--nodeps` so this does not fail the build, and the image + boots with this repo's own `linux-ps5` + kexec flow rather than upstream's. + If the transaction fails on the real image, it is the first place to look. +- Default credentials are `ps5` / `ps5` with passwordless sudo, same as the + other images. Change them before exposing the machine to a network. diff --git a/distros/omarchy/build-rootfs.sh b/distros/omarchy/build-rootfs.sh new file mode 100755 index 0000000..45c57ba --- /dev/null +++ b/distros/omarchy/build-rootfs.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# distros/omarchy/build-rootfs.sh — Arch rootfs + the real Omarchy packages. +# Called from docker/image-builder/entrypoint.sh for DISTRO=omarchy. +# +# Omarchy's installer is an ISO wizard, but the Omarchy packages are normal Arch +# packages in Omarchy's own repo, and Omarchy's docs cover image builds: a +# prebuilt image carries the packages and defers hardware setup to first boot +# (docs/file-layout.md). The distrobuilder recipe (image.yaml) installs the Arch +# side, pulls the Omarchy packages from here and then runs +# distros/omarchy/post-install.sh — the same system setup Omarchy's installer +# runs in the target chroot. +# +# Expects in env: DISTRO=omarchy, CHROOT, KVER, ROOT_LABEL, EFI_LABEL +# Expects on disk: /kernel-debs/linux-ps5-*.pkg.tar.zst, +# /repo/distros/omarchy/{grow-rootfs,grow-rootfs.service}, +# /repo/distros/shared/zz-update-boot +set -eux +: "${CHROOT:?ERROR: \$CHROOT unset/empty}" +[ -d "$CHROOT" ] || { echo "ERROR: \$CHROOT=$CHROOT not a directory"; exit 2; } +case "$CHROOT" in /) echo "ERROR: refuse to operate on /"; exit 2 ;; esac + +STAGING=/tmp/build-staging +OMARCHY_CHANNEL="${OMARCHY_CHANNEL:-stable}" +OMARCHY_REPO_URL="${OMARCHY_REPO_URL:-https://pkgs.omarchy.org/$OMARCHY_CHANNEL/x86_64}" +OMARCHY_MIRROR_URL="${OMARCHY_MIRROR_URL:-https://$OMARCHY_CHANNEL-mirror.omarchy.org}" + +# --- Stage files distrobuilder's copy generators need ------------------------ +rm -rf "$STAGING" +mkdir -p "$STAGING/pkgs" +cp /repo/distros/omarchy/grow-rootfs "$STAGING/" +cp /repo/distros/omarchy/grow-rootfs.service "$STAGING/" +cp /repo/distros/shared/zz-update-boot "$STAGING/" +cp /kernel-debs/*.pkg.tar.zst "$STAGING/pkgs/" +cat > "$STAGING/fstab" < +LABEL=$ROOT_LABEL / ext4 defaults 0 1 +LABEL=$EFI_LABEL /boot/efi vfat defaults 0 1 +EOF +find "$STAGING" -type f ! -path "$STAGING/pkgs/*" -exec sed -i 's/\r$//' {} + + +if [ "${SKIP_CHROOT:-false}" = "true" ] && [ -d "$CHROOT/usr/share/omarchy" ]; then + echo "=== Reusing cached $DISTRO rootfs ===" + exit 0 +fi + +# --- Omarchy packages, fetched once and reused across rebuilds --------------- +echo "=== Fetching Omarchy $OMARCHY_CHANNEL packages ===" +OMARCHY_CHANNEL="$OMARCHY_CHANNEL" \ +OMARCHY_REPO_URL="$OMARCHY_REPO_URL" \ +OMARCHY_MIRROR_URL="$OMARCHY_MIRROR_URL" \ + bash /repo/distros/omarchy/stage-pkgs.sh /build/cache/omarchy >&2 + +rm -rf "$CHROOT"/* "$CHROOT"/.[!.]* 2>/dev/null || true +mkdir -p "$CHROOT" +cp -a /build/cache/omarchy/omarchy-pkgs "$CHROOT/omarchy-pkgs" +cp -a /build/cache/omarchy/omarchy-db "$CHROOT/omarchy-db" +distrobuilder build-dir /repo/distros/omarchy/image.yaml "$CHROOT" \ + --with-post-files --cache-dir /build/cache --cleanup=false >&2 +rm -rf "$CHROOT/omarchy-pkgs" "$CHROOT/omarchy-db" diff --git a/distros/omarchy/image.yaml b/distros/omarchy/image.yaml index b0b5ada..08ceb8d 100644 --- a/distros/omarchy/image.yaml +++ b/distros/omarchy/image.yaml @@ -19,105 +19,17 @@ packages: Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch sets: - packages: - # Runtime subset of install/omarchy-base.packages + omarchy-other.packages. - # Left out: ISO-provided kernels (linux-omarchy, linux-t2), DKMS trees - # (nvidia*, broadcom-wl, asusctl, tuxedo-drivers, t2fanrd, macbook12-spi), - # boot tie-ins (limine*, snapper, plymouth) and Intel/apple-only pieces. - - alsa-utils - - avahi + # The Omarchy package itself lives in Omarchy's repo (installed from the + # staged copies in post-files; the container has no DNS inside the chroot) + # and pulls Hyprland, Quickshell, uwsm, sddm and the rest of its depends. + # This set is the Arch half: what the PS5 image needs, plus the repo + # packages omarchy-settings depends on. - base - base-devel - - bash-completion - - bat - - bluez - - bluez-utils - - bolt - - brightnessctl - - btop - - chromium - - cups - - cups-filters - - cups-pk-helper - - ddcutil - - docker - - docker-buildx - - docker-compose - - dosfstools - - expac - - eza - - fakeroot - - fastfetch - - fd - - ffmpeg - - ffmpegthumbnailer - - fzf - - git - - gnome-keyring - - gnome-themes-extra - - grim + # Omarchy dependencies not already pulled in by omarchy itself - gum - - gvfs-mtp - - gvfs-nfs - - gvfs-smb - - hyprland - - hyprland-guiutils - - hyprland-preview-share-picker - - hyprpicker - - hyprsunset - - imagemagick - - imv - - inetutils - - inotify-tools - - inxi - - jq - - kernel-modules-hook - - lazygit - - less - - libsecret - - libvips - - libyaml - - libreoffice-fresh - - lua51 - - luarocks - - man-db - - mise-bin - - mpv - - nautilus - - nautilus-python - - networkmanager - - noto-fonts - - noto-fonts-cjk - - noto-fonts-emoji - - nss-mdns - - nvim - - pacman-contrib - - pamixer - - pinta - - plocate - - power-profiles-daemon - - python-gobject - - python-poetry-core - - qemu-user-static-binfmt - - qrencode - - quickshell - - ripgrep - - ruby - - socat - - starship - - sushi - - tesseract - - tesseract-data-eng - - tldr - - tmux - - tree-sitter-cli - - ttf-ia-writer - - ttf-jetbrains-mono-nerd-basic - - tzupdate - - udiskie - - unzip - - vi - - whois - - wireless-regdb + - perl + - sddm # Display / GPU (AMD Oberon) - mesa - vulkan-radeon @@ -125,42 +37,59 @@ packages: - xf86-video-amdgpu - libinput - xkeyboard-config - # Wayland plumbing - - foot + # Session / plumbing + - dbus + - egl-wayland + - gst-plugin-pipewire + - gtk4-layer-shell - pipewire - pipewire-alsa - pipewire-jack - pipewire-pulse - - wireplumber - - gst-plugin-pipewire - - gtk4-layer-shell + - polkit - qt6-base - qt6-declarative - qt6-imageformats - qt6-multimedia - qt6-svg - qt6-wayland + - seatd + - wireplumber - wl-clipboard - wtype - xdg-desktop-portal-gtk - xdg-desktop-portal-hyprland - - xdg-terminal-exec - - zbar + - zram-generator + # Network / bluetooth / audio + - bluez + - bluez-utils + - iw + - linux-firmware + - networkmanager + - wireless-regdb + - wpasupplicant # System - - dbus + - dosfstools - e2fsprogs - - egl-wayland - - htop - kexec-tools - kmod - - linux-firmware - mkinitcpio - openssh - parted - - polkit - - seatd + # Utilities the default desktop expects + - chromium + - ffmpeg + - git + - jq + - less + - nano + - neovim + - noto-fonts + - noto-fonts-emoji + - ripgrep - sudo - - zoxide + - tmux + - vi action: install files: - path: /etc/hostname @@ -181,9 +110,19 @@ files: - path: /etc/systemd/system/grow-rootfs.service generator: copy source: /tmp/build-staging/grow-rootfs.service +- path: /usr/local/sbin/omarchy-post-install + generator: copy + source: /tmp/build-staging/post-install.sh + mode: "0755" - path: /opt/pkgs/ generator: copy source: /tmp/build-staging/pkgs +- path: /omarchy-pkgs/ + generator: copy + source: /omarchy-pkgs +- path: /omarchy-db/ + generator: copy + source: /omarchy-db actions: - trigger: post-unpack action: |- @@ -220,13 +159,9 @@ actions: action: |- #!/bin/bash set -eux - mkdir -p /etc/systemd/system/local-fs.target.wants - ln -sf /etc/systemd/system/grow-rootfs.service \ - /etc/systemd/system/local-fs.target.wants/grow-rootfs.service - systemctl enable bluetooth.service - # Default user (ps5/ps5) — Omarchy's own wizard normally creates this on - # a real install; images ship it pre-created. - useradd -m -G wheel,seat -s /bin/bash ps5 + # Default user (ps5/ps5) before Omarchy's setup runs — its installer + # expects the target user to exist. + useradd -m -G wheel,seat,video,audio,input -s /bin/bash ps5 echo "ps5:ps5" | chpasswd echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/wheel # No display manager: tty1 autologin starts the session, same as the @@ -240,8 +175,9 @@ actions: 'ExecStart=' \ 'ExecStart=-/sbin/agetty --autologin ps5 --noclear %I $TERM' \ > /etc/systemd/system/getty@tty1.service.d/autologin.conf - # Omarchy's own launcher (`omarchy hyprland`) and session file are not - # part of this package set, so launch Hyprland directly. + # Launch the Hyprland session directly; Omarchy's configs/packages come + # from /etc/skel + omarchy-finalize-user, so no uwsm/greetd wrapper is + # needed (and greetd has no VT handoff path on the PS5). { echo 'if [ "$(tty)" = "/dev/tty1" ] && [ -z "$WAYLAND_DISPLAY" ]; then' echo ' export XDG_RUNTIME_DIR="/tmp/xdg-runtime-$(id -u)"' @@ -265,5 +201,11 @@ actions: fi mkdir -p /boot/efi /etc/kernel/postinst.d/zz-update-boot + # Omarchy packages + system setup (see distros/omarchy/post-install.sh). + # Runs last: Omarchy's own leaves set services and PAM state that the + # steps above would otherwise overwrite. + export DISTRO OMARCHY_PATH=/usr/share/omarchy + . /usr/local/sbin/omarchy-post-install + rm -f /usr/local/sbin/omarchy-post-install mappings: architecture_map: archlinux diff --git a/distros/omarchy/post-install.sh b/distros/omarchy/post-install.sh new file mode 100755 index 0000000..4461282 --- /dev/null +++ b/distros/omarchy/post-install.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# distros/omarchy/post-install.sh — Omarchy's target-side system setup. +# +# Omarchy's own installer runs `omarchy apply system --install-user USER +# --first-install` in the installed system (see omarchy-install.sh in +# omacom/omarchy: "The ISO calls this in the target chroot after packages are +# installed and the target user exists"). That script normally lives in the +# image-builder container and is chrooted in by entrypoint.sh for an Arch +# image; distrobuilder has no such hook, so this file runs inside the built +# rootfs from image.yaml's post-files action. +# +# Declares no shebang on purpose: it is sourced, like Omarchy's own install/ +# leaves. +# +# Expects in env: DISTRO=omarchy, CHROOT (the rootfs being built), +# plus the staging dir variables exported by image.yaml. +# Expects on disk: /omarchy-pkgs (staged packages), /omarchy-db (repo indexes) +set -eux + +# --- pacman: Omarchy's stable repos + keyring -------------------------------- +# Same templates Omarchy's `omarchy apply pacman` installs on x86 (stable +# channel): its own repo first, then Arch's core/extra/multilib off Omarchy's +# stable mirror. +cat > /etc/pacman.d/mirrorlist <<'EOF' +Server = https://stable-mirror.omarchy.org/$repo/os/$arch +EOF +cp /etc/pacman.conf /etc/pacman.conf.ps5-arch +sed -i '/^\[core\]$/,$d' /etc/pacman.conf +cat >> /etc/pacman.conf <<'EOF' +[omarchy] +Server = https://pkgs.omarchy.org/stable/$arch +[core] +Include = /etc/pacman.d/mirrorlist +[extra] +Include = /etc/pacman.d/mirrorlist +[multilib] +Include = /etc/pacman.d/mirrorlist +EOF + +# --- Omarchy packages -------------------------------------------------------- +# Installed from the staged copies: the build container has no DNS inside the +# distrobuilder chroot, so pacman cannot reach the repos here. --nodeps is +# safe for this set; their dependencies are installed (or deliberately +# omitted, see image.yaml) by the package set in the same image.yaml. +pacman-key --init +pacman-key --populate archlinux +pacman-key --populate omarchy +pacman -U --noconfirm --needed --nodeps /omarchy-pkgs/*.pkg.tar.zst || { + # One bad package must not sink the whole image: retry without the + # optional app packages, keeping the runtime (omarchy + settings). + pacman -U --noconfirm --needed --nodeps \ + /omarchy-pkgs/omarchy-*.pkg.tar.zst \ + /omarchy-pkgs/omarchy-keyring-*.pkg.tar.zst +} + +# --- Omarchy system setup ---------------------------------------------------- +# Equivalent of `omarchy apply system --install-user --first-install`, +# minus the steps that assume a live machine: +# - pacman/ (rewrites pacman.conf from channel templates: done above), +# - hardware/ (first-boot provisioning builds depend on the upstream +# kernel headers), +# - boot/ (limine + snapper; PS5 images boot through kexec). +export OMARCHY_PATH=/usr/share/omarchy +export OMARCHY_INSTALL="$OMARCHY_PATH/install" +export OMARCHY_INSTALL_USER=ps5 +export OMARCHY_FIRST_INSTALL=1 +export PATH="$OMARCHY_PATH/bin:$PATH" +# The ISO's fixups for machines installed through the wizard: locale files, +# passwordless keyring, service enablement, docker, firewall, browser policy. +for leaf in config/all.sh login/all.sh; do + OMARCHY_INSTALL_LOG_FILE=/var/log/omarchy-$(basename "$(dirname "$leaf")").log \ + bash -c 'source "$OMARCHY_INSTALL/helpers/logging.sh"; start_install_log; source "$OMARCHY_INSTALL/'"$leaf"'"; stop_install_log' +done + +# --- Re-apply the PS5 image's own boot + login setup ------------------------- +# Omarchy's config leaves (enable-services, firewall, sddm) reset parts of the +# login path we replaced with tty1 autologin. +ln -sf /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target +ln -sf /dev/null /etc/systemd/system/sddm.service +mkdir -p /etc/systemd/system/getty@tty1.service.d +cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf <<'EOF' +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin ps5 --noclear %I $TERM +EOF +mkdir -p /etc/systemd/system/local-fs.target.wants +ln -sf /etc/systemd/system/grow-rootfs.service \ + /etc/systemd/system/local-fs.target.wants/grow-rootfs.service + +if [ -f /usr/share/omarchy/bin/omarchy-finalize-user ]; then + sudo -u ps5 env HOME=/home/ps5 PATH="$OMARCHY_PATH/bin:$PATH" \ + omarchy-finalize-user || true +elif [ -x /usr/local/bin/omarchy-finalize-user ]; then + sudo -u ps5 env HOME=/home/ps5 PATH="$OMARCHY_PATH/bin:$PATH" \ + /usr/local/bin/omarchy-finalize-user || true +fi diff --git a/distros/omarchy/stage-pkgs.sh b/distros/omarchy/stage-pkgs.sh new file mode 100755 index 0000000..a549ef5 --- /dev/null +++ b/distros/omarchy/stage-pkgs.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# distros/omarchy/stage-pkgs.sh — fetch the Omarchy packages and their repo +# databases into a staging directory so image.yaml can install them offline +# with `pacman -U --nodeps` (the container has no working DNS inside the +# distrobuilder chroot, and Omarchy's dependency set targets its own mirror). +# +# Usage: stage-pkgs.sh +# Expects in env: OMARCHY_CHANNEL (stable|rc|edge, default stable), +# OMARCHY_REPO_URL, OMARCHY_MIRROR_URL +set -euo pipefail +DEST="${1:?usage: stage-pkgs.sh }" +CHANNEL="${OMARCHY_CHANNEL:-stable}" +REPO_URL="${OMARCHY_REPO_URL:-https://pkgs.omarchy.org/$CHANNEL/x86_64}" +MIRROR_URL="${OMARCHY_MIRROR_URL:-https://$CHANNEL-mirror.omarchy.org}" +# Packages Omarchy's installer puts on every machine: the runtime itself plus +# the meta packages it depends on by name. Everything else comes from the +# Arch package set in image.yaml. +PACKAGES=( + omarchy + omarchy-settings + omarchy-keyring + omarchy-themes-intros + omarchy-nvim + omarchy-hyprland-titlebars +) +mkdir -p "$DEST/omarchy-pkgs" "$DEST/omarchy-db" +echo "=== Fetching Omarchy $CHANNEL package index ($REPO_URL) ===" +curl -fsSL -o "$DEST/omarchy-db/omarchy.db" "$REPO_URL/omarchy.db" +echo "=== Fetching $CHANNEL sync databases for offline dependency checks ===" +for repo in core extra multilib; do + curl -fsSL -o "$DEST/omarchy-db/$repo.db" "$MIRROR_URL/$repo/os/x86_64/$repo.db" || true +done +# Resolve the newest build of each package from the index (the directory +# listing is not browsable, the db is authoritative). +resolve() { + local pkg="$1" + tar -tf "$DEST/omarchy-db/omarchy.db" \ + | sed -nE "s#^${pkg}-([^/]+)/desc\$#\\1#p" \ + | sort -V | tail -1 +} +for pkg in "${PACKAGES[@]}"; do + ver="$(resolve "$pkg")" + if [ -z "$ver" ]; then + echo "ERROR: $pkg not found in $REPO_URL/omarchy.db" >&2 + exit 1 + fi + if [[ "$ver" == *-any ]]; then + arch=any + else + arch=x86_64 + fi + file="$pkg-$ver-$arch.pkg.tar.zst" + echo ">> $file" + curl -fsSL -o "$DEST/omarchy-pkgs/$file" "$REPO_URL/$file" +done +echo "=== Staged $(ls -1 "$DEST/omarchy-pkgs" | wc -l | tr -d ' ') packages in $DEST/omarchy-pkgs ===" diff --git a/docker/image-builder/entrypoint.sh b/docker/image-builder/entrypoint.sh index 88ba156..de1b3ba 100755 --- a/docker/image-builder/entrypoint.sh +++ b/docker/image-builder/entrypoint.sh @@ -27,10 +27,11 @@ export KVER if [ "$SKIP_CHROOT" = "true" ] && [ -d "$CHROOT/bin" ]; then echo "=== Reusing cached $DISTRO rootfs ===" elif [ -x "/repo/distros/${DISTRO}/build-rootfs.sh" ]; then - # Distros with their own build-rootfs.sh (bazzite, bazzite-deck, batocera, ...) - # are responsible for populating $CHROOT themselves — distrobuilder is - # bypassed entirely. Most often used for OCI atomic images (bazzite via - # skopeo+umoci) or pre-built rootfs images (batocera squashfs). + # Distros with their own build-rootfs.sh (bazzite, bazzite-deck, batocera, + # omarchy, ...) drive the rootfs build themselves instead of the shared + # distrobuilder call below. Most often used for OCI atomic images (bazzite + # via skopeo+umoci), pre-built rootfs images (batocera squashfs) or a + # distrobuilder run with extra package sources (omarchy). echo "=== Building $DISTRO rootfs via distros/${DISTRO}/build-rootfs.sh ===" [ -n "$CHROOT" ] || { echo "FATAL: \$CHROOT empty"; exit 1; } mkdir -p "$CHROOT" @@ -84,12 +85,6 @@ EOF mkdir -p "$STAGING/pkgs" cp /kernel-debs/*.pkg.tar.zst "$STAGING/pkgs/" ;; - omarchy) - cp /repo/distros/${DISTRO}/grow-rootfs "$STAGING/" - cp /repo/distros/${DISTRO}/grow-rootfs.service "$STAGING/" - mkdir -p "$STAGING/pkgs" - cp /kernel-debs/*.pkg.tar.zst "$STAGING/pkgs/" - ;; cachyos) mkdir -p "$STAGING/files" cp /repo/distros/cachyos/files/grow-rootfs "$STAGING/files/" From de44e50551bba5a71e14528009854bae30c8a7ce Mon Sep 17 00:00:00 2001 From: Abdullah Fageeh Date: Sat, 24 Oct 2026 05:04:26 +0300 Subject: [PATCH 3/4] wip: hide omarchy from release table while the build is unverified --- .github/workflows/build-image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 5cd3ae9..45f4d5d 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -183,7 +183,6 @@ jobs: { key: 'ubuntu2604', label: 'Ubuntu 26.04', file: 'ps5-ubuntu2604.img.xz' }, { key: 'arch', label: 'Arch', file: 'ps5-arch.img.xz' }, { key: 'cachyos', label: 'CachyOS', file: 'ps5-cachyos.img.xz' }, - { key: 'omarchy', label: 'Omarchy', file: 'ps5-omarchy.img.xz' }, { key: 'fedora', label: 'Fedora 44', file: 'ps5-fedora.img.xz' }, { key: 'proxmox', label: 'Proxmox VE 8', file: 'ps5-proxmox.img.xz' }, { key: 'debian', label: 'Debian 12', file: 'ps5-debian.img.xz' }, From 85386952d76ba0957fd408905e1529627fb027cf Mon Sep 17 00:00:00 2001 From: Abdullah Fageeh Date: Sat, 24 Oct 2026 05:06:11 +0300 Subject: [PATCH 4/4] Revert "wip: hide omarchy from release table while the build is unverified" This reverts commit de44e50 and restores the Omarchy row in ALL_DISTROS, so the release job publishes ps5-omarchy.img.xz in the `latest` release once an Omarchy build has run successfully. Keep this commit last: merging the branch before the image has been built and uploaded links a missing asset. Merge after the build, or merge with the wip commit in place and land this one when the image is on R2. --- .github/workflows/build-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 45f4d5d..5cd3ae9 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -183,6 +183,7 @@ jobs: { key: 'ubuntu2604', label: 'Ubuntu 26.04', file: 'ps5-ubuntu2604.img.xz' }, { key: 'arch', label: 'Arch', file: 'ps5-arch.img.xz' }, { key: 'cachyos', label: 'CachyOS', file: 'ps5-cachyos.img.xz' }, + { key: 'omarchy', label: 'Omarchy', file: 'ps5-omarchy.img.xz' }, { key: 'fedora', label: 'Fedora 44', file: 'ps5-fedora.img.xz' }, { key: 'proxmox', label: 'Proxmox VE 8', file: 'ps5-proxmox.img.xz' }, { key: 'debian', label: 'Debian 12', file: 'ps5-debian.img.xz' },