commit 45329394e8273de2554eb914bd5745e3a03c2700 Author: torter <koubbamohamedrayan@gmail.com> Date: Wed, 21 Oct 2026 01:54:50 +0000 Chamesle Linux: Xfce edition from Void packages, dinit, Windows-style desktop Diffstat:
66 files changed, 1112 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -0,0 +1,4 @@ +work/ +out/ +*.iso +*.iso.sha256 diff --git a/CODENAME b/CODENAME @@ -0,0 +1 @@ +Margit diff --git a/README.md b/README.md @@ -0,0 +1,33 @@ +# Chamesle Linux + +A user-friendly Linux distribution built on Void Linux's packages, with **dinit** as the init system. + +- **For everyone:** a ready desktop, Flatpak with Flathub set up, and (coming) the Chamesle Store for apps, + drivers and updates. +- **For advanced users:** `get`, a source-based package manager, on top. +- **Editions:** Xfce (made to feel like Windows), with MATE, Cinnamon, GNOME and KDE Plasma to follow. + +Every edition comes with linux-firmware, the open graphics drivers, os-prober for dual boot, and Firefox. + +## Building an ISO + +On any Linux host with xbps, squashfs-tools, xorriso, GRUB (i386-pc and x86_64-efi), zstd, cpio and kmod: + +```sh +sudo EDITION=xfce ./build.sh +``` + +The ISO lands in `out/`. Packages are cached in `~/.cache/chamesle-xbps`, so later builds are quick. + +## Layout + +| path | what | +| --- | --- | +| `build.sh` | builds an edition's ISO | +| `editions/base.packages` | packages every edition has | +| `editions/NAME/` | an edition: its packages, name and look (`overlay/`) | +| `overlay/` | files shared by every edition: dinit services, Flathub, branding, artwork | +| `tools/initrd/` | the initramfs (live medium and installed systems) | +| `tools/themes.sh` | installs the Fluent theme and icons | +| `artwork/` | wallpaper and logo sources (`render.sh` renders them) | +| `keys/` | Void Linux's repository signing keys | diff --git a/VERSION b/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/artwork/render.sh b/artwork/render.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Render the artwork the editions ship (the PNGs are committed; run this after changing an SVG). Needs resvg. +set -eu +HERE=$(cd "$(dirname "$0")" && pwd) +OUT=$HERE/../overlay/usr/share +RESVG=${RESVG:-resvg} +mkdir -p "$OUT/backgrounds/chamesle" "$OUT/icons/hicolor/scalable/apps" +$RESVG -w 1920 -h 1080 "$HERE/wallpaper.svg" "$OUT/backgrounds/chamesle/default.png" +cp "$HERE/start.svg" "$OUT/icons/hicolor/scalable/apps/chamesle-start.svg" +echo "rendered into $OUT" diff --git a/artwork/start.svg b/artwork/start.svg @@ -0,0 +1,11 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"> + <!-- Chamesle start button (placeholder until the real logo): a rounded tile with a C --> + <defs> + <linearGradient id="g" x1="0" y1="0" x2="1" y2="1"> + <stop offset="0" stop-color="#22c55e"/> + <stop offset="1" stop-color="#0ea5e9"/> + </linearGradient> + </defs> + <rect x="4" y="4" width="56" height="56" rx="14" fill="url(#g)"/> + <path d="M42 22.5 A13 13 0 1 0 42 41.5" fill="none" stroke="#ffffff" stroke-width="7" stroke-linecap="round"/> +</svg> diff --git a/artwork/wallpaper.svg b/artwork/wallpaper.svg @@ -0,0 +1,32 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080"> + <!-- Chamesle default wallpaper (placeholder art): soft layered ribbons in blue and teal --> + <defs> + <linearGradient id="sky" x1="0" y1="0" x2="1" y2="1"> + <stop offset="0" stop-color="#0b1f3a"/> + <stop offset="0.55" stop-color="#103a6b"/> + <stop offset="1" stop-color="#0a5c6e"/> + </linearGradient> + <linearGradient id="r1" x1="0" y1="0" x2="1" y2="0"> + <stop offset="0" stop-color="#2f8cff" stop-opacity="0"/> + <stop offset="0.45" stop-color="#4aa3ff" stop-opacity="0.85"/> + <stop offset="1" stop-color="#22d3c5" stop-opacity="0.9"/> + </linearGradient> + <linearGradient id="r2" x1="0" y1="0" x2="1" y2="0"> + <stop offset="0" stop-color="#7cc4ff" stop-opacity="0"/> + <stop offset="0.5" stop-color="#9ad8ff" stop-opacity="0.55"/> + <stop offset="1" stop-color="#5eead4" stop-opacity="0.7"/> + </linearGradient> + <linearGradient id="r3" x1="0" y1="0" x2="1" y2="0"> + <stop offset="0" stop-color="#1d4ed8" stop-opacity="0"/> + <stop offset="0.6" stop-color="#2563eb" stop-opacity="0.6"/> + <stop offset="1" stop-color="#14b8a6" stop-opacity="0.65"/> + </linearGradient> + <filter id="blur" x="-10%" y="-10%" width="120%" height="120%"><feGaussianBlur stdDeviation="18"/></filter> + <filter id="soft" x="-10%" y="-10%" width="120%" height="120%"><feGaussianBlur stdDeviation="2"/></filter> + </defs> + <rect width="1920" height="1080" fill="url(#sky)"/> + <path d="M-100 820 C 380 560, 760 980, 1180 700 S 1840 360, 2040 520 L 2040 1180 L -100 1180 Z" fill="url(#r3)" filter="url(#blur)"/> + <path d="M-100 760 C 420 470, 820 900, 1240 610 S 1860 300, 2040 430 L 2040 520 C 1840 390, 1500 700, 1220 760 S 400 640, -100 900 Z" fill="url(#r1)" filter="url(#soft)"/> + <path d="M-100 700 C 460 420, 860 820, 1280 540 S 1880 250, 2040 360 L 2040 400 C 1860 300, 1520 600, 1260 660 S 460 540, -100 780 Z" fill="url(#r2)" filter="url(#soft)"/> + <circle cx="1460" cy="300" r="260" fill="#38bdf8" opacity="0.10" filter="url(#blur)"/> +</svg> diff --git a/build.sh b/build.sh @@ -0,0 +1,146 @@ +#!/bin/bash +# Build a Chamesle Linux live/installer ISO for one edition, from Void Linux's glibc packages (no compiling): +# +# sudo EDITION=xfce ./build.sh -> out/chamesle-VERSION-EDITION-x86_64.iso (+ .sha256) +# +# 1. installs editions/base.packages + editions/EDITION/packages into a new root with xbps (runit is blocked: +# dinit is the init system), from Void's repository, packages cached in XBPS_CACHE +# 2. copies overlay/ (services, branding, Flathub, artwork) and editions/EDITION/overlay/ (the desktop's look) on top +# 3. installs the Fluent theme and icons, sets up the live user, locale and Chamesle branding +# 4. builds the initramfs from the image (tools/initrd), packs the root into a squashfs and masters a hybrid +# BIOS+UEFI ISO with GRUB +# +# Needs: xbps (xbps-install; Void's static build works on any distribution), mksquashfs, xorriso, grub-mkrescue with +# the i386-pc and x86_64-efi platforms, readelf, zstd, cpio, depmod and curl. Run it as root (sudo). +# EDITION=... xfce (default), and later mate, cinnamon, gnome, kde +# VOID_REPO=... the Void mirror (default https://repo-default.voidlinux.org/current) +# XBPS_CACHE=... downloaded packages, kept between builds (default ~/.cache/chamesle-xbps of the sudo user) +# WORK=... OUT=... work and output directories (default work/EDITION and out/) +set -euo pipefail +HERE=$(cd "$(dirname "$0")" && pwd) +EDITION=${EDITION:-xfce} +[ -f "$HERE/editions/$EDITION/packages" ] || { echo "build: no edition '$EDITION' (editions/*/packages)" >&2; exit 1; } +VERSION=$(cat "$HERE/VERSION"); CODENAME=$(cat "$HERE/CODENAME" 2>/dev/null || true) +EDITION_NAME=$(sed -n 's/^name=//p' "$HERE/editions/$EDITION/edition" 2>/dev/null || echo "$EDITION") +WORK=${WORK:-$HERE/work/$EDITION}; ROOT=$WORK/root; ISO_DIR=$WORK/iso +OUT=${OUT:-$HERE/out}; ISO=$OUT/chamesle-$VERSION-$EDITION-x86_64.iso +REPO=${VOID_REPO:-https://repo-default.voidlinux.org/current} +home=$(getent passwd "${SUDO_USER:-$(id -un)}" | cut -d: -f6) +CACHE=${XBPS_CACHE:-$home/.cache/chamesle-xbps} +IN=$HERE/tools/in-image.sh + +missing= +for t in xbps-install mksquashfs xorriso readelf zstd cpio depmod curl; do command -v "$t" >/dev/null || missing="$missing $t"; done +command -v grub-mkrescue >/dev/null || command -v grub2-mkrescue >/dev/null || missing="$missing grub-mkrescue" +[ -z "$missing" ] || { echo "build: missing tools:$missing" >&2; exit 1; } +GRUB_MKRESCUE=$(command -v grub-mkrescue || command -v grub2-mkrescue) +packages() { sed 's/#.*//' "$HERE/editions/base.packages" "$HERE/editions/$EDITION/packages" | tr ' \t' '\n\n' | grep -v '^$' | sort -u; } + +echo "=== [1/5] INSTALLING THE SYSTEM ($EDITION_NAME, from Void Linux's packages)" +rm -rf "$WORK"; mkdir -p "$ROOT/var/db/xbps/keys" "$ROOT/etc/xbps.d" "$CACHE" "$ISO_DIR/live" "$OUT" +cp "$HERE"/keys/*.plist "$ROOT/var/db/xbps/keys/" +cp "$HERE/overlay/etc/xbps.d/00-chamesle.conf" "$ROOT/etc/xbps.d/" +# the packages' install scripts run chrooted in the new root: give them /dev and /proc (Python's bytecode compiler +# and the kernel's hooks need them) +mkdir -p "$ROOT/dev" "$ROOT/proc" +mount --rbind /dev "$ROOT/dev"; mount --make-rslave "$ROOT/dev"; mount -t proc proc "$ROOT/proc" +trap 'umount "$ROOT/proc" 2>/dev/null; umount -lR "$ROOT/dev" 2>/dev/null; true' EXIT +XBPS_ARCH=x86_64 xbps-install -S -y -r "$ROOT" -R "$REPO" -R "$REPO/nonfree" -c "$CACHE" $(packages) +umount "$ROOT/proc"; umount -lR "$ROOT/dev"; trap - EXIT +if [ -e "$ROOT/usr/bin/runit" ]; then echo "build: runit got installed; dinit must be the only init" >&2; exit 1; fi + +echo "=== [2/5] CHAMESLE: SERVICES, LOOK AND BRANDING" +cp -a "$HERE/overlay/." "$ROOT/" +cp -a "$HERE/editions/$EDITION/overlay/." "$ROOT/" +"$HERE/tools/themes.sh" "$ROOT" +# Xfce's built-in wallpapers point at Chamesle's, so a monitor of any name gets it before xfce4-desktop.xml knows it +for f in xfce-x.svg xfce-shapes.svg xfce-stripes.png xfce-teal.png xfce-verticals.png; do + [ -d "$ROOT/usr/share/backgrounds/xfce" ] && ln -sf ../chamesle/default.png "$ROOT/usr/share/backgrounds/xfce/$f" +done +# the Windows key opens the Start menu +KS=$ROOT/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml +if [ -f "$KS" ] && ! grep -q 'xfce4-popup-whiskermenu' "$KS"; then + sed -i 's|^\( *\)<property name="<Super>e" type="string" value="thunar"/>|&\n\1<property name="Super_L" type="string" value="xfce4-popup-whiskermenu"/>|' "$KS" +fi +# identity +SUFFIX=${CODENAME:+ $CODENAME} +cat > "$ROOT/etc/os-release" <<EOF +NAME="Chamesle Linux" +PRETTY_NAME="Chamesle Linux $VERSION$SUFFIX ($EDITION_NAME)" +ID=chamesle +ID_LIKE=void +VERSION="$VERSION${CODENAME:+ ($CODENAME)}" +VERSION_ID="$VERSION" +${CODENAME:+VERSION_CODENAME=$(echo "$CODENAME" | tr '[:upper:]' '[:lower:]')} +VARIANT="$EDITION_NAME" +VARIANT_ID=$EDITION +HOME_URL="https://chamesle.org/" +LOGO=chamesle-start +EOF +rm -f "$ROOT/usr/lib/os-release"; ln -sf ../../etc/os-release "$ROOT/usr/lib/os-release" +printf 'Chamesle Linux %s%s \\r (\\l)\n\n' "$VERSION" "$SUFFIX" > "$ROOT/etc/issue" +echo chamesle > "$ROOT/etc/hostname" +mkdir -p "$ROOT/usr/share/chamesle" +echo "$VERSION" > "$ROOT/usr/share/chamesle/version"; echo "$EDITION" > "$ROOT/usr/share/chamesle/edition" +# English (US) UTF-8 by default; the installer changes it +grep -qx 'en_US.UTF-8 UTF-8' "$ROOT/etc/default/libc-locales" 2>/dev/null || echo 'en_US.UTF-8 UTF-8' >> "$ROOT/etc/default/libc-locales" +echo 'LANG=en_US.UTF-8' > "$ROOT/etc/locale.conf" +ln -sf /usr/share/zoneinfo/UTC "$ROOT/etc/localtime" +"$IN" "$ROOT" /usr/bin/xbps-reconfigure -f glibc-locales +"$IN" "$ROOT" /usr/bin/fc-cache -f +"$IN" "$ROOT" /usr/bin/gtk-update-icon-cache -q -f /usr/share/icons/hicolor 2>/dev/null || true + +echo "=== [3/5] THE LIVE USER" +# "live", no password, administrator without a password, logged in by LightDM by itself. Only the live image +# has this: the installer removes the autologin and the passwordless sudo, and creates your own user. +"$IN" "$ROOT" /usr/bin/useradd -m -c "Live session" -s /bin/bash -G wheel,audio,video,input,network,storage,optical,scanner,lp,plugdev,users live +"$IN" "$ROOT" /usr/bin/passwd -d live +"$IN" "$ROOT" /usr/bin/passwd -l root +echo 'live ALL=(ALL:ALL) NOPASSWD: ALL' > "$ROOT/etc/sudoers.d/live"; chmod 440 "$ROOT/etc/sudoers.d/live" +SESSION=$(sed -n 's/^session=//p' "$HERE/editions/$EDITION/edition" 2>/dev/null || echo "$EDITION") +printf '# the live session only (the installer removes this file)\n[Seat:*]\nautologin-user=live\nautologin-session=%s\n' "$SESSION" \ + > "$ROOT/etc/lightdm/lightdm.conf.d/90-live.conf" +"$IN" "$ROOT" /usr/bin/xdg-user-dirs-update 2>/dev/null || true +rm -f "$ROOT/etc/machine-id" "$ROOT/var/lib/dbus/machine-id" +rm -rf "$ROOT/var/cache/xbps"/* + +echo "=== [4/5] KERNEL AND INITRAMFS" +KVER=$(ls "$ROOT/usr/lib/modules" | sort -V | tail -n1) +BUILD_ID="$VERSION-$EDITION-$(date +%s)" +cp "$ROOT/boot/vmlinuz-$KVER" "$ISO_DIR/live/vmlinuz" +"$HERE/tools/initrd/build-initrd.sh" "$ROOT" "$KVER" "$ISO_DIR/live/initrd.img" "$BUILD_ID" +echo "$BUILD_ID" > "$ISO_DIR/live/build-id" +# installed systems boot with the same initramfs (root=UUID=...) +cp "$ISO_DIR/live/initrd.img" "$ROOT/boot/initramfs-$KVER.img" + +echo "=== [5/5] SQUASHFS AND ISO" +mksquashfs "$ROOT" "$ISO_DIR/live/rootfs.squashfs" -comp zstd -Xcompression-level 15 -b 1M -noappend -no-xattrs -quiet +mkdir -p "$ISO_DIR/boot/grub" +TITLE="Chamesle Linux $VERSION$SUFFIX ($EDITION_NAME)" +cat > "$ISO_DIR/boot/grub/grub.cfg" <<EOF +set default=0 +set timeout=5 +insmod all_video +if [ ! -f /live/vmlinuz ]; then search --no-floppy --set=root --file /live/vmlinuz; fi + +menuentry "Try or install $TITLE" { + linux /live/vmlinuz quiet loglevel=3 + initrd /live/initrd.img +} +menuentry "$TITLE (safe graphics)" { + linux /live/vmlinuz quiet loglevel=3 nomodeset + initrd /live/initrd.img +} +menuentry "$TITLE (copy to RAM)" { + linux /live/vmlinuz chamesle.toram=1 quiet loglevel=3 + initrd /live/initrd.img +} +menuentry "$TITLE (show boot messages)" { + linux /live/vmlinuz loglevel=4 console=tty0 console=ttyS0,115200 + initrd /live/initrd.img +} +EOF +"$GRUB_MKRESCUE" -o "$ISO" "$ISO_DIR" -volid CHAMESLE +(cd "$OUT" && sha256sum "$(basename "$ISO")" > "$(basename "$ISO").sha256") +ls -lh "$ISO" +echo "SUCCESS: $ISO" diff --git a/editions/base.packages b/editions/base.packages @@ -0,0 +1,30 @@ +# Every Chamesle edition: Void Linux glibc packages, installed with xbps (runit is blocked: dinit is the init). +# One package per line; blank lines and # comments are ignored. + +# core system +base-files bash coreutils findutils diffutils grep sed gawk which file less +gzip bzip2 xz zstd tar unzip +util-linux shadow procps-ng psmisc kmod eudev dbus elogind polkit dinit busybox xbps +iproute2 iputils NetworkManager openssh curl wget ca-certificates rsync +sudo nano glibc-locales tzdata man-db + +# kernel, firmware and microcode: drivers for as much hardware as possible out of the box +linux linux-headers linux-firmware intel-ucode + +# disks, filesystems and boot (the installer and dual boot need them) +grub grub-x86_64-efi grub-i386-efi efibootmgr os-prober +e2fsprogs dosfstools ntfs-3g exfatprogs btrfs-progs xfsprogs cryptsetup lvm2 gptfdisk parted + +# graphics: X, Mesa with LLVM (hardware OpenGL and Vulkan on Intel, AMD and NVIDIA's open driver), video decoding +xorg-minimal xorg-input-drivers xorg-video-drivers xorg-fonts +mesa-dri mesa-vulkan-intel mesa-vulkan-radeon vulkan-loader mesa-vaapi intel-video-accel + +# sound, Bluetooth, printing +pipewire wireplumber alsa-pipewire alsa-utils bluez cups cups-filters + +# apps for everyone: Flatpak (Flathub is set up), Firefox, fonts +flatpak xdg-desktop-portal xdg-user-dirs firefox +noto-fonts-ttf noto-fonts-emoji dejavu-fonts-ttf + +# `get` builds from source: the toolchain it needs +gcc make pkg-config cmake meson ninja perl python3 autoconf automake libtool patch bison flex git diff --git a/editions/xfce/edition b/editions/xfce/edition @@ -0,0 +1,2 @@ +name=Xfce +session=xfce diff --git a/editions/xfce/overlay/etc/lightdm/lightdm-gtk-greeter.conf b/editions/xfce/overlay/etc/lightdm/lightdm-gtk-greeter.conf @@ -0,0 +1,10 @@ +[greeter] +background=/usr/share/backgrounds/chamesle/default.png +theme-name=Fluent-Light +icon-theme-name=Fluent +font-name=Noto Sans 11 +cursor-theme-name=Adwaita +position=50%,center 50%,center +indicators=~host;~spacer;~clock;~spacer;~session;~a11y;~power +clock-format=%A %d %B %H:%M +user-background=false diff --git a/editions/xfce/overlay/etc/lightdm/lightdm.conf.d/50-chamesle.conf b/editions/xfce/overlay/etc/lightdm/lightdm.conf.d/50-chamesle.conf @@ -0,0 +1,5 @@ +# Chamesle: Xfce is the session; the GTK greeter wears the Chamesle look. +[Seat:*] +user-session=xfce +greeter-session=lightdm-gtk-greeter +greeter-hide-users=false diff --git a/editions/xfce/overlay/etc/xdg/xfce4/panel/whiskermenu-1.rc b/editions/xfce/overlay/etc/xdg/xfce4/panel/whiskermenu-1.rc @@ -0,0 +1,50 @@ +favorites=firefox.desktop,thunar.desktop,xfce4-terminal.desktop,org.xfce.mousepad.desktop,xfce-settings-manager.desktop +recent= +button-icon=chamesle-start +button-single-row=false +show-button-title=false +show-button-icon=true +launcher-show-name=true +launcher-show-description=false +launcher-show-tooltip=true +item-icon-size=3 +hover-switch-category=false +category-show-name=true +category-icon-size=1 +view-as-icons=true +default-category=0 +recent-items-max=10 +favorites-in-recent=true +position-search-alternate=true +position-commands-alternate=false +position-categories-alternate=true +position-categories-horizontal=false +stay-on-focus-out=false +profile-shape=0 +confirm-session-command=true +menu-width=640 +menu-height=560 +menu-opacity=100 +command-settings=xfce4-settings-manager +show-command-settings=true +command-lockscreen=xflock4 +show-command-lockscreen=true +command-switchuser=dm-tool switch-to-greeter +show-command-switchuser=false +command-logoutuser=xfce4-session-logout --logout --fast +show-command-logoutuser=false +command-restart=xfce4-session-logout --reboot --fast +show-command-restart=true +command-shutdown=xfce4-session-logout --halt --fast +show-command-shutdown=true +command-suspend=xfce4-session-logout --suspend +show-command-suspend=false +command-hibernate=xfce4-session-logout --hibernate +show-command-hibernate=false +command-logout=xfce4-session-logout +show-command-logout=true +command-menueditor=menulibre +show-command-menueditor=false +command-profile=mugshot +show-command-profile=false +search-actions=0 diff --git a/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml b/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- The Chamesle wallpaper on every monitor; Home and Trash on the desktop --> +<channel name="xfce4-desktop" version="1.0"> + <property name="backdrop" type="empty"> + <property name="screen0" type="empty"> + <property name="monitor0" type="empty"> + <property name="workspace0" type="empty"> + <property name="last-image" type="string" value="/usr/share/backgrounds/chamesle/default.png"/> + <property name="image-style" type="int" value="5"/> + </property> + </property> + <property name="monitorVirtual-1" type="empty"> + <property name="workspace0" type="empty"> + <property name="last-image" type="string" value="/usr/share/backgrounds/chamesle/default.png"/> + <property name="image-style" type="int" value="5"/> + </property> + </property> + </property> + </property> + <property name="desktop-icons" type="empty"> + <property name="file-icons" type="empty"> + <property name="show-home" type="bool" value="true"/> + <property name="show-trash" type="bool" value="true"/> + <property name="show-filesystem" type="bool" value="false"/> + <property name="show-removable" type="bool" value="true"/> + </property> + <property name="icon-size" type="uint" value="48"/> + </property> +</channel> diff --git a/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- One taskbar at the bottom, laid out like Windows: Start, window buttons, then tray, volume, network, clock and + "show desktop" at the far right --> +<channel name="xfce4-panel" version="1.0"> + <property name="configver" type="int" value="2"/> + <property name="panels" type="array"> + <value type="int" value="1"/> + <property name="dark-mode" type="bool" value="false"/> + <property name="panel-1" type="empty"> + <property name="position" type="string" value="p=8;x=0;y=0"/> + <property name="length" type="uint" value="100"/> + <property name="position-locked" type="bool" value="true"/> + <property name="size" type="uint" value="44"/> + <property name="icon-size" type="uint" value="24"/> + <property name="enter-opacity" type="uint" value="100"/> + <property name="leave-opacity" type="uint" value="100"/> + <property name="plugin-ids" type="array"> + <value type="int" value="1"/> + <value type="int" value="2"/> + <value type="int" value="3"/> + <value type="int" value="4"/> + <value type="int" value="5"/> + <value type="int" value="6"/> + <value type="int" value="7"/> + <value type="int" value="8"/> + </property> + </property> + </property> + <property name="plugins" type="empty"> + <property name="plugin-1" type="string" value="whiskermenu"/> + <property name="plugin-2" type="string" value="tasklist"> + <property name="show-labels" type="bool" value="false"/> + <property name="grouping" type="uint" value="1"/> + <property name="flat-buttons" type="bool" value="true"/> + <property name="show-handle" type="bool" value="false"/> + <property name="middle-click" type="uint" value="1"/> + </property> + <property name="plugin-3" type="string" value="separator"> + <property name="expand" type="bool" value="true"/> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-4" type="string" value="systray"> + <property name="square-icons" type="bool" value="true"/> + </property> + <property name="plugin-5" type="string" value="pulseaudio"> + <property name="enable-keyboard-shortcuts" type="bool" value="true"/> + </property> + <property name="plugin-6" type="string" value="notification-plugin"/> + <property name="plugin-7" type="string" value="clock"> + <property name="mode" type="uint" value="2"/> + <property name="digital-layout" type="uint" value="0"/> + <property name="digital-date-format" type="string" value="%d/%m/%Y"/> + <property name="digital-time-format" type="string" value="%H:%M"/> + </property> + <property name="plugin-8" type="string" value="showdesktop"> + <property name="show-on-hover" type="bool" value="false"/> + </property> + </property> +</channel> diff --git a/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml b/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Windows-style title bars: icon on the left, minimise / maximise / close on the right --> +<channel name="xfwm4" version="1.0"> + <property name="general" type="empty"> + <property name="theme" type="string" value="Fluent-Light"/> + <property name="button_layout" type="string" value="O|HMC"/> + <property name="title_alignment" type="string" value="left"/> + <property name="title_font" type="string" value="Noto Sans 10"/> + <property name="workspace_count" type="int" value="1"/> + <property name="use_compositing" type="bool" value="true"/> + <property name="show_dock_shadow" type="bool" value="true"/> + <property name="snap_to_border" type="bool" value="true"/> + <property name="tile_on_move" type="bool" value="true"/> + <property name="wrap_windows" type="bool" value="false"/> + </property> +</channel> diff --git a/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml b/editions/xfce/overlay/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Chamesle Xfce: the Windows 11-style Fluent theme and icons, Noto fonts --> +<channel name="xsettings" version="1.0"> + <property name="Net" type="empty"> + <property name="ThemeName" type="string" value="Fluent-Light"/> + <property name="IconThemeName" type="string" value="Fluent"/> + <property name="SoundThemeName" type="string" value="freedesktop"/> + <property name="EnableEventSounds" type="bool" value="false"/> + </property> + <property name="Gtk" type="empty"> + <property name="FontName" type="string" value="Noto Sans 10"/> + <property name="MonospaceFontName" type="string" value="Noto Sans Mono 10"/> + <property name="CursorThemeName" type="string" value="Adwaita"/> + <property name="CursorThemeSize" type="int" value="24"/> + <property name="ButtonImages" type="bool" value="false"/> + <property name="MenuImages" type="bool" value="true"/> + <property name="DecorationLayout" type="string" value="icon,menu:minimize,maximize,close"/> + </property> + <property name="Xft" type="empty"> + <property name="Antialias" type="int" value="1"/> + <property name="Hinting" type="int" value="1"/> + <property name="HintStyle" type="string" value="hintslight"/> + <property name="RGBA" type="string" value="rgb"/> + </property> +</channel> diff --git a/editions/xfce/packages b/editions/xfce/packages @@ -0,0 +1,5 @@ +# Chamesle Xfce: light, and set up to look and work like Windows (taskbar, Start menu, Fluent theme) +xfce4 xfce4-whiskermenu-plugin xfce4-pulseaudio-plugin xfce4-notifyd xfce4-screenshooter xfce4-power-manager +xfce4-taskmanager xfce4-clipman-plugin network-manager-applet blueman +thunar-volman thunar-archive-plugin ristretto mousepad xarchiver pavucontrol gvfs +lightdm lightdm-gtk-greeter xdg-desktop-portal-gtk xdg-user-dirs-gtk adwaita-icon-theme gnome-themes-extra diff --git a/keys/3d:b9:c0:50:41:a7:68:4c:2e:2c:a9:a2:5a:04:b7:3f.plist b/keys/3d:b9:c0:50:41:a7:68:4c:2e:2c:a9:a2:5a:04:b7:3f.plist @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>public-key</key> + <data>LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUFvM1Nrc2p5N01PMmc4UWxsZjdCVQp1aXhFUWlqN3FOSVJrU0hrWWw4SGxxd1hOczFnK1FzbzhGV3dSbDNMbUpTVW5wT1BaOG1sdVdSajd4Y2pLbnVJCnhPRjBtQS8vM0lzTnVId2dYV2RLL0JiT29wNzFLZmt4aEE0WjhwK0hRbmhLMThxUkFPbG9xOGJ6WXZhaGI2NmEKemdWVTVFM1JzRDU4V0M2ZTFOUVdSSGpiMG1TM2h6M1NxVWVWZFVMT20zVzZBRTdYdWlVQVJOSEdyY1ljMXkyKwpxNjBKWHMrVk5sRlMwaGdDdnpqS3phMVg5cWtzQndzTmdaRlhBcXN1MGFKRndYSTEvM2R4ZWxBcUZFbnRMWVFSCjA4NHpaTDFmWDVRMWlacGNEaHVhTWZVREVZQjA4UzdKTTBYKytibkxxVnphVTZzc0RXdGtzbFJaNjNaVStISTUKemk5a0pyc25LcU5Pa3BKSnJTUkRyMGFvRjV2RDRwN20vYWdZKzdTRk5aaDZzOUJ5V0x3NDVFdytwalVVUmp5aQp6T01TSFhEM3YzczhFdzZkV29wbTVQTGUvUEgzZWFiMEVnbG9yVDZhYmRwaCtaVG4zaUxMWVVkSGNmQ1FDN01GCkNmVGl1TWt4SkJpaCtoOEhKaUlBdmpDZjVxdjZiaFpEUHpGRzAwbEpYRUZwNHRpbGp6eTFmbitiMkdLY3BDOWQKUUs4TEc3M0RFaXhacHBmU09IU09MMWYxVlBzZTBRdnl6d2RWc0xzR0dqV0FaZkw4WUdVZDl4Y20yeW5tVzFuNgpKTjl6NE9oZ3lRa21mNUFFUXpYSUxQR0d1MlREUVh5c05IRG0vUnRMMHJPN3cxbFVKSTVYOW1kbEZYd0xUWHI3ClYrU25aK3U5VCtFREg1NTV6WDJDZTgwQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=</data> + <key>public-key-size</key> + <integer>4096</integer> + <key>signature-by</key> + <string>Void Linux</string> +</dict> +</plist> diff --git a/keys/60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d.plist b/keys/60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d.plist @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>public-key</key> + <data>LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUF2clN6QlpNdmd2T0NJM0FYYk9qYQoycktSa0pTVE0zYy9FalRJZ0NnRFhndW05M0JQQ3RZOE1jRlZvQ1U0T2lYSEdmVG1xMzlCVk5wTHZMSEw5S2sxCnAyNzhTQmhYVk90YkIyRVZtREtudmZJREVUbGRMR3plN3JaTlJKZHR1TjJtWi9UVnJVQjlTMHlRYytJdWY0aHYKMytEOTdWSWRUSkhBN0FTcjA0MjhwcEVHSkd3U1NoWTJYSm05RDVJMEV1R1JXYzE0TUVHN2RJS0ppWWlNMG5FNAp0WW8yL3ZINElGVEhkblZBM2dZaVp5RG5idUNBUi84RVNmVVRVMTNTTkNPZGJ1ZGYzRDVCY3krVWlNREpJM1llCjRNRktCclQ5WmhaK0dzWEJaWTQ4MmxxaVppNkNMNXB0YzlJUUZmOC9lS1phOGphdGtpVkZWZ3JLZU5Sak9UeE4KZldTdTJua3hHTlgrYmhYWXRoaUdXbUpFWThjQ0FQeUZOK0x2NVJldEsyNTZnZGNiMnNrbUVxZWZ2MnpQQyt3VgpXQmJkSDViRDRiWmpuME42Wmw4MXJ2NVJ6RHZudmYrdkQxNGFGVWJaOFFGcXU3NVBiTDR3Nm1ZTTRsZE0vZzBSCjZOWEU4QXo5Qnd4MnREZlllS3V1dHcxRXBQbTJZdkZ5VFViMWNveUF1VEdSeUFhcDFVVEh2ZzlsaFBJSm1oRlEKSjVrQ2cxcUQ3QTMxV2wwUmxuZTZoZ0dvMFpaTko1Y0pNL3YvelNUS0pjdUZnd283SDBoT0dpbDZEZm84OUI0agpHOTZBQ3lQUytEVktQRlhSWXdqL0FrYkhwYVEyZjFGTUFvU3BCcXVEcUhoM3VrazcxS1g2ajE5dDBpRjhEUUxyCnZ0RlNTZElqREEwMmx3ZVY5TmFRcFdzQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=</data> + <key>public-key-size</key> + <integer>4096</integer> + <key>signature-by</key> + <string>Void Linux</string> +</dict> +</plist> diff --git a/overlay/etc/dinit.d/NetworkManager b/overlay/etc/dinit.d/NetworkManager @@ -0,0 +1,9 @@ +# Network management (Wi-Fi, Ethernet, VPN): the tray icon and the settings talk to it. +type = process +command = /usr/bin/NetworkManager --no-daemon +depends-on = dbus +depends-on = udev-trigger +restart = true +smooth-recovery = true +# output goes to a log file, not over the console and the login prompt +logfile = /var/log/NetworkManager.log diff --git a/overlay/etc/dinit.d/bluetoothd b/overlay/etc/dinit.d/bluetoothd @@ -0,0 +1,8 @@ +# Bluetooth. +type = process +command = /usr/libexec/bluetooth/bluetoothd -n +depends-on = dbus +waits-for = udev-trigger +restart = true +smooth-recovery = true +logfile = /var/log/bluetoothd.log diff --git a/overlay/etc/dinit.d/boot b/overlay/etc/dinit.d/boot @@ -0,0 +1,11 @@ +# The boot target dinit starts at PID 1 start-up. `dinitctl stop boot` (or `shutdown`) runs the shutdown. +# Services you turn on with `dinitctl enable NAME` are links in boot.d. +type = internal +depends-on = early-filesystems +depends-on = udev-trigger +depends-on = system-identity +waits-for = mount-fstab +waits-for = zram +waits-for = console-setup +waits-for = getty-tty1 +waits-for.d = boot.d diff --git a/overlay/etc/dinit.d/boot.d/NetworkManager b/overlay/etc/dinit.d/boot.d/NetworkManager @@ -0,0 +1 @@ +../NetworkManager +\ No newline at end of file diff --git a/overlay/etc/dinit.d/boot.d/bluetoothd b/overlay/etc/dinit.d/boot.d/bluetoothd @@ -0,0 +1 @@ +../bluetoothd +\ No newline at end of file diff --git a/overlay/etc/dinit.d/boot.d/cupsd b/overlay/etc/dinit.d/boot.d/cupsd @@ -0,0 +1 @@ +../cupsd +\ No newline at end of file diff --git a/overlay/etc/dinit.d/boot.d/display-manager b/overlay/etc/dinit.d/boot.d/display-manager @@ -0,0 +1 @@ +../display-manager +\ No newline at end of file diff --git a/overlay/etc/dinit.d/boot.d/elogind b/overlay/etc/dinit.d/boot.d/elogind @@ -0,0 +1 @@ +../elogind +\ No newline at end of file diff --git a/overlay/etc/dinit.d/boot.d/polkitd b/overlay/etc/dinit.d/boot.d/polkitd @@ -0,0 +1 @@ +../polkitd +\ No newline at end of file diff --git a/overlay/etc/dinit.d/console-setup b/overlay/etc/dinit.d/console-setup @@ -0,0 +1,6 @@ +# Console keymap and font from /etc/vconsole.conf (KEYMAP=..., FONT=...). +type = scripted +command = /usr/lib/dinit/console-setup +depends-on = early-filesystems +waits-for = udev-trigger +restart = false diff --git a/overlay/etc/dinit.d/cupsd b/overlay/etc/dinit.d/cupsd @@ -0,0 +1,7 @@ +# Printing (CUPS). +type = process +command = /usr/bin/cupsd -f +depends-on = dbus +waits-for = network +smooth-recovery = true +logfile = /var/log/cupsd.log diff --git a/overlay/etc/dinit.d/dbus b/overlay/etc/dinit.d/dbus @@ -0,0 +1,8 @@ +# System message bus (foreground; dinit supervises it). +type = process +command = /usr/bin/dbus-daemon --system --nofork --nopidfile +depends-on = dbus-prepare +restart = true +smooth-recovery = true +# output goes to a log file, not over the console and the login prompt +logfile = /var/log/dbus.log diff --git a/overlay/etc/dinit.d/dbus-prepare b/overlay/etc/dinit.d/dbus-prepare @@ -0,0 +1,5 @@ +# /run/dbus and the machine id that dbus-daemon needs. +type = scripted +command = /usr/lib/dinit/dbus-prepare +depends-on = system-identity +restart = false diff --git a/overlay/etc/dinit.d/display-manager b/overlay/etc/dinit.d/display-manager @@ -0,0 +1,11 @@ +# The graphical login (LightDM). On the live system it logs the live user in by itself. +type = process +command = /usr/bin/lightdm +depends-on = dbus +depends-on = elogind +waits-for = polkitd +waits-for = udev-trigger +waits-for = network +restart = true +smooth-recovery = true +logfile = /var/log/lightdm-dinit.log diff --git a/overlay/etc/dinit.d/early-filesystems b/overlay/etc/dinit.d/early-filesystems @@ -0,0 +1,4 @@ +# Pseudo and runtime filesystems that the initramfs does not hand over (/run, /dev/pts, /dev/shm, /tmp). +type = scripted +command = /usr/lib/dinit/early-filesystems +restart = false diff --git a/overlay/etc/dinit.d/elogind b/overlay/etc/dinit.d/elogind @@ -0,0 +1,9 @@ +# Login and seat management (the logind API without systemd): user sessions, /run/user/UID, suspend and +# shutdown from the desktop, device access for the logged-in user. +type = process +command = /usr/libexec/elogind/elogind +depends-on = dbus +depends-on = udev-trigger +restart = true +smooth-recovery = true +logfile = /var/log/elogind.log diff --git a/overlay/etc/dinit.d/getty-tty1 b/overlay/etc/dinit.d/getty-tty1 @@ -0,0 +1,7 @@ +# Console login on tty1 (Ctrl+Alt+F1); the desktop runs on its own VT. +type = process +command = /usr/bin/agetty tty1 38400 linux +depends-on = system-identity +waits-for = console-setup +restart = true +smooth-recovery = true diff --git a/overlay/etc/dinit.d/mount-fstab b/overlay/etc/dinit.d/mount-fstab @@ -0,0 +1,6 @@ +# Mount /etc/fstab's filesystems and turn on its swap. The live image has no fstab. +type = scripted +command = /usr/lib/dinit/mount-fstab +depends-on = early-filesystems +waits-for = udev-trigger +restart = false diff --git a/overlay/etc/dinit.d/network b/overlay/etc/dinit.d/network @@ -0,0 +1,3 @@ +# Everything needed for networking. +type = internal +depends-on = NetworkManager diff --git a/overlay/etc/dinit.d/polkitd b/overlay/etc/dinit.d/polkitd @@ -0,0 +1,8 @@ +# PolicyKit: lets desktop programs ask for administrator rights (mounting disks, network settings, the store). +type = process +command = /usr/lib/polkit-1/polkitd --no-debug +depends-on = dbus +waits-for = elogind +restart = true +smooth-recovery = true +logfile = /var/log/polkitd.log diff --git a/overlay/etc/dinit.d/ssh-keygen b/overlay/etc/dinit.d/ssh-keygen @@ -0,0 +1,5 @@ +# Generate any missing SSH host keys (first boot of an install; sshd waits for it). +type = scripted +command = /usr/bin/ssh-keygen -A +depends-on = early-filesystems +restart = false diff --git a/overlay/etc/dinit.d/sshd b/overlay/etc/dinit.d/sshd @@ -0,0 +1,8 @@ +# OpenSSH server. Not started by default: dinitctl enable sshd +type = process +command = /usr/bin/sshd -D +depends-on = network +waits-for = ssh-keygen +smooth-recovery = true +# output goes to a log file, not over the console and the login prompt +logfile = /var/log/sshd.log diff --git a/overlay/etc/dinit.d/system-identity b/overlay/etc/dinit.d/system-identity @@ -0,0 +1,5 @@ +# Hostname (from /etc/hostname), loopback interface and /etc/machine-id. +type = scripted +command = /usr/lib/dinit/system-identity +depends-on = early-filesystems +restart = false diff --git a/overlay/etc/dinit.d/udev-trigger b/overlay/etc/dinit.d/udev-trigger @@ -0,0 +1,5 @@ +# Coldplug: replay kernel events so devices that exist already get their udev rules applied. +type = scripted +command = /usr/lib/dinit/udev-trigger +depends-on = udevd +restart = false diff --git a/overlay/etc/dinit.d/udevd b/overlay/etc/dinit.d/udevd @@ -0,0 +1,8 @@ +# Device manager: eudev's udevd (built by tools/eudev/build.sh; systemd is not part of the image). +type = process +command = /usr/bin/udevd +depends-on = early-filesystems +restart = true +smooth-recovery = true +# output goes to a log file, not over the console and the login prompt +logfile = /var/log/udevd.log diff --git a/overlay/etc/dinit.d/zram b/overlay/etc/dinit.d/zram @@ -0,0 +1,6 @@ +# Compressed swap in RAM (4G zstd zram device). stop-command turns it off again at shutdown. +type = scripted +command = /usr/lib/dinit/zram start +stop-command = /usr/lib/dinit/zram stop +depends-on = early-filesystems +restart = false diff --git a/overlay/etc/flatpak/remotes.d/flathub.flatpakrepo b/overlay/etc/flatpak/remotes.d/flathub.flatpakrepo @@ -0,0 +1,8 @@ +[Flatpak Repo] +Title=Flathub +Url=https://dl.flathub.org/repo/ +Homepage=https://flathub.org/ +Comment=Central repository of Flatpak applications +Description=Central repository of Flatpak applications +Icon=https://dl.flathub.org/repo/logo.svg +GPGKey=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 diff --git a/overlay/etc/sudoers.d/wheel b/overlay/etc/sudoers.d/wheel @@ -0,0 +1,2 @@ +# members of wheel (the first user the installer creates) may administer the system +%wheel ALL=(ALL:ALL) ALL diff --git a/overlay/etc/xbps.d/00-chamesle.conf b/overlay/etc/xbps.d/00-chamesle.conf @@ -0,0 +1,3 @@ +# Chamesle boots with dinit: never install runit (some Void packages would pull it in). +ignorepkg=runit-void +ignorepkg=runit diff --git a/overlay/usr/bin/halt b/overlay/usr/bin/halt @@ -0,0 +1 @@ +dinit-shutdown +\ No newline at end of file diff --git a/overlay/usr/bin/poweroff b/overlay/usr/bin/poweroff @@ -0,0 +1 @@ +dinit-shutdown +\ No newline at end of file diff --git a/overlay/usr/bin/reboot b/overlay/usr/bin/reboot @@ -0,0 +1 @@ +dinit-shutdown +\ No newline at end of file diff --git a/overlay/usr/bin/shutdown b/overlay/usr/bin/shutdown @@ -0,0 +1 @@ +dinit-shutdown +\ No newline at end of file diff --git a/overlay/usr/lib/dinit/console-setup b/overlay/usr/lib/dinit/console-setup @@ -0,0 +1,11 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +# Console keymap and font from /etc/vconsole.conf (KEYMAP=fr, FONT=ter-v22n, ...), on every virtual console. +[ -r /etc/vconsole.conf ] || exit 0 +KEYMAP= FONT= +. /etc/vconsole.conf +[ -n "$KEYMAP" ] && loadkeys -q "$KEYMAP" +if [ -n "$FONT" ]; then + for tty in /dev/tty[1-6]; do setfont -C "$tty" "$FONT" 2>/dev/null; done +fi +exit 0 diff --git a/overlay/usr/lib/dinit/dbus-prepare b/overlay/usr/lib/dinit/dbus-prepare @@ -0,0 +1,5 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +mkdir -p /run/dbus /var/lib/dbus +dbus-uuidgen --ensure +exit 0 diff --git a/overlay/usr/lib/dinit/early-filesystems b/overlay/usr/lib/dinit/early-filesystems @@ -0,0 +1,17 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +# Mount what the initramfs leaves out. Safe to run twice (already mounted places are skipped). +m() { mountpoint -q "$4" || { mkdir -p "$4"; mount -t "$1" -o "$2" "$3" "$4"; }; } +m proc nosuid,nodev,noexec proc /proc +m sysfs nosuid,nodev,noexec sysfs /sys +m devtmpfs mode=0755,nosuid devtmpfs /dev +m tmpfs mode=0755,nosuid,nodev tmpfs /run +m devpts gid=5,mode=0620,nosuid,noexec devpts /dev/pts +m tmpfs mode=1777,nosuid,nodev tmpfs /dev/shm +m tmpfs mode=1777,nosuid,nodev tmpfs /tmp +# the cgroup v2 hierarchy: elogind tracks user sessions in it +m cgroup2 nsdelegate,nosuid,nodev,noexec cgroup2 /sys/fs/cgroup +# services write their output to /var/log/NAME.log (dinit cannot start them if the directory is missing) +mkdir -p /var/log +[ -d /sys/firmware/efi/efivars ] && m efivarfs nosuid,nodev,noexec efivarfs /sys/firmware/efi/efivars +exit 0 diff --git a/overlay/usr/lib/dinit/mount-fstab b/overlay/usr/lib/dinit/mount-fstab @@ -0,0 +1,7 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +# The live image has no /etc/fstab; an installed system has its partitions and swap there. +[ -s /etc/fstab ] || exit 0 +mount -a; rc=$? +swapon -a +exit $rc diff --git a/overlay/usr/lib/dinit/system-identity b/overlay/usr/lib/dinit/system-identity @@ -0,0 +1,7 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +[ -s /etc/hostname ] && hostname "$(cat /etc/hostname)" +ip link set lo up 2>/dev/null +# a first boot (no machine id yet, e.g. a fresh install or the live image) gets a new one +[ -s /etc/machine-id ] || dbus-uuidgen --ensure=/etc/machine-id 2>/dev/null || true +exit 0 diff --git a/overlay/usr/lib/dinit/udev-trigger b/overlay/usr/lib/dinit/udev-trigger @@ -0,0 +1,6 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +udevadm trigger --type=subsystems --action=add +udevadm trigger --type=devices --action=add +udevadm settle --timeout=30 +exit 0 diff --git a/overlay/usr/lib/dinit/zram b/overlay/usr/lib/dinit/zram @@ -0,0 +1,10 @@ +#!/bin/sh +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin +case "${1:-start}" in + start) + { [ -e /sys/block/zram0 ] || modprobe zram; } || exit 0 + echo zstd > /sys/block/zram0/comp_algorithm && + echo 4G > /sys/block/zram0/disksize && + mkswap /dev/zram0 && swapon /dev/zram0 -p 32767 ;; + stop) swapoff /dev/zram0 2>/dev/null; echo 1 > /sys/block/zram0/reset 2>/dev/null; exit 0 ;; +esac diff --git a/overlay/usr/share/backgrounds/chamesle/default.png b/overlay/usr/share/backgrounds/chamesle/default.png Binary files differ. diff --git a/overlay/usr/share/icons/hicolor/scalable/apps/chamesle-start.svg b/overlay/usr/share/icons/hicolor/scalable/apps/chamesle-start.svg @@ -0,0 +1,11 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"> + <!-- Chamesle start button (placeholder until the real logo): a rounded tile with a C --> + <defs> + <linearGradient id="g" x1="0" y1="0" x2="1" y2="1"> + <stop offset="0" stop-color="#22c55e"/> + <stop offset="1" stop-color="#0ea5e9"/> + </linearGradient> + </defs> + <rect x="4" y="4" width="56" height="56" rx="14" fill="url(#g)"/> + <path d="M42 22.5 A13 13 0 1 0 42 41.5" fill="none" stroke="#ffffff" stroke-width="7" stroke-linecap="round"/> +</svg> diff --git a/tools/in-image.sh b/tools/in-image.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Run a command inside an image tree (chroot) with the host's /dev and a /proc, so it runs with the image's own +# programs and C library whatever the build host runs. +# usage: in-image.sh ROOT COMMAND... (as root, or as root of a user namespace with its own pid namespace) +set -eu +ROOT=${1:?usage: in-image.sh ROOT COMMAND...}; shift +mkdir -p "$ROOT/dev" "$ROOT/proc" "$ROOT/tmp" "$ROOT/var/tmp" +chmod 1777 "$ROOT/tmp" "$ROOT/var/tmp" +# rslave: the host /dev is a shared mount, so without it unmounting the copy would unmount the host /dev/pts too +mount --rbind /dev "$ROOT/dev" +mount --make-rslave "$ROOT/dev" +mount -t proc proc "$ROOT/proc" +unmount() { umount "$ROOT/proc" 2>/dev/null || true; umount -lR "$ROOT/dev" 2>/dev/null || true; } +trap unmount EXIT INT TERM +# the command's own exit status, not the unmounts' (an EXIT trap's status leaks out in dash) +rc=0 +chroot "$ROOT" /usr/bin/env -i PATH=/usr/bin:/usr/sbin:/bin:/sbin HOME=/root TERM="${TERM:-linux}" "$@" || rc=$? +trap - EXIT INT TERM +unmount +exit $rc diff --git a/tools/initrd/build-initrd.sh b/tools/initrd/build-initrd.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# Build Chamesle's initramfs from the system image itself: busybox, cryptsetup (for LUKS installs) and the +# storage/filesystem kernel modules all come from ROOT, so the build host's own C library and tools never matter. +# init (tools/initrd/init) finds the live medium or the installed root, then switch_roots to dinit. +# usage: build-initrd.sh ROOT KVER OUTPUT [BUILD_ID] +# INITRD_MODULES, INITRD_MODDIRS, INITRD_EXCLUDE override the module selection (defaults below) +set -euo pipefail +HERE=$(cd "$(dirname "$0")" && pwd) +ROOT=$(readlink -f "${1:?usage: build-initrd.sh ROOT KVER OUTPUT [BUILD_ID]}"); KVER=${2:?}; OUT=${3:?}; BUILD_ID=${4:-} +W=$(mktemp -d); trap 'rm -rf "$W"' EXIT +R=$W/root +# the image's merged /usr layout: /bin, /sbin -> usr/bin, /lib, /lib64 -> usr/lib +mkdir -p "$R"/usr/bin "$R"/usr/lib "$R"/{proc,sys,dev,mnt,newroot,overlay,etc} +ln -s usr/bin "$R/bin"; ln -s usr/bin "$R/sbin"; ln -s usr/lib "$R/lib"; ln -s usr/lib "$R/lib64" + +# resolve PATH (absolute, inside the image) through symlinks, inside the image +resolve() { + local p=$1 t i + for i in 1 2 3 4 5 6 7 8 9 10; do + [ -L "$ROOT$p" ] || break + t=$(readlink "$ROOT$p"); case "$t" in /*) p=$t ;; *) p=$(dirname "$p")/$t ;; esac + done + [ -e "$ROOT$p" ] && printf '%s\n' "$p" +} +# copy an ELF program or library from the image (by its path in the image), its interpreter and every library it +# needs, to /usr/lib in the initramfs (where the image keeps them, so the loader finds them as usual) +seen=" " +copy_elf() { + local p real lib interp + real=$(resolve "$1") || { echo "initrd: $1 is not in the image" >&2; exit 1; } + case "$seen" in *" $real "*) return 0 ;; esac + seen="$seen$real " + mkdir -p "$R$(dirname "$1")"; cp -L "$ROOT$real" "$R$1" + interp=$(readelf -l "$ROOT$real" 2>/dev/null | sed -n 's/.*Requesting program interpreter: \(.*\)]/\1/p') + [ -z "$interp" ] || copy_elf "$interp" + for lib in $(readelf -d "$ROOT$real" 2>/dev/null | sed -n 's/.*NEEDED.*\[\(.*\)\]/\1/p'); do + p=$(resolve "/usr/lib/$lib") || { echo "initrd: $1 needs $lib, which is not in the image" >&2; exit 1; } + copy_elf "/usr/lib/$lib" + done +} + +echo "== busybox and cryptsetup from the image" +copy_elf /usr/bin/busybox +copy_elf /usr/bin/cryptsetup +# every applet as a link (the image's busybox, run with the image's loader so this works on any build host) +BB() { "$ROOT/usr/lib/ld-linux-x86-64.so.2" --library-path "$ROOT/usr/lib" "$ROOT/usr/bin/busybox" "$@" 2>/dev/null \ + || "$ROOT/usr/bin/busybox" "$@"; } +applets=$(BB --list) +[ -n "$applets" ] || { echo "initrd: cannot list busybox's applets" >&2; exit 1; } +for a in $applets; do [ -e "$R/usr/bin/$a" ] || ln -s busybox "$R/usr/bin/$a"; done +echo "$applets" | grep -x modprobe >/dev/null || { echo "initrd: busybox has no modprobe applet" >&2; exit 1; } +install -m755 "$HERE/init" "$R/init" +[ -z "$BUILD_ID" ] || echo "$BUILD_ID" > "$R/build-id" + +echo "== kernel modules for finding the medium and the root ($KVER)" +MODDIR=$ROOT/usr/lib/modules/$KVER +[ -f "$MODDIR/modules.dep" ] || { echo "initrd: no modules.dep for $KVER in the image" >&2; exit 1; } +INITRD_MODULES=${INITRD_MODULES:-"isofs udf squashfs overlay loop sr_mod cdrom sd_mod usb_storage uas + xhci_pci xhci_hcd ehci_pci ehci_hcd ohci_pci ohci_hcd uhci_hcd ahci libahci nvme nvme_core mmc_block + virtio_blk virtio_scsi virtio_pci virtio virtio_ring scsi_mod scsi_common libata ata_piix ata_generic pata_acpi + vmw_pvscsi mptspi mptsas BusLogic hv_storvsc hv_vmbus vfat fat exfat ext4 xfs btrfs f2fs nls_cp437 nls_ascii nls_utf8 + dm_mod dm_crypt"} +# whole driver directories: the medium may sit behind any controller (QEMU's IDE CD-ROM needs ata_piix, VMware +# pvscsi, Hyper-V storvsc, ...); init loads the ones the hardware asks for by modalias +INITRD_MODDIRS=${INITRD_MODDIRS:-"kernel/drivers/ata/ kernel/drivers/scsi/ kernel/drivers/nvme/host/ kernel/drivers/mmc/host/ + kernel/drivers/usb/storage/ kernel/drivers/usb/host/ kernel/drivers/block/virtio_blk kernel/drivers/cdrom/ + kernel/drivers/virtio/ kernel/drivers/hv/"} +INITRD_EXCLUDE=${INITRD_EXCLUDE:-"scsi_debug null_blk brd ublk_drv zram"} +DEST=$R/usr/lib/modules/$KVER +mkdir -p "$DEST" +wanted=$(awk -v mods="$INITRD_MODULES" -v dirs="$INITRD_MODDIRS" -v excl="$INITRD_EXCLUDE" ' + BEGIN { n = split(mods, a, /[ \t\n]+/); for (i = 1; i <= n; i++) if (a[i] != "") want[a[i]] = 1 + n = split(excl, a, /[ \t\n]+/); for (i = 1; i <= n; i++) if (a[i] != "") skip[a[i]] = 1 + nd = split(dirs, dl, /[ \t\n]+/) } + { split($0, kv, ":"); f = kv[1]; b = f; sub(/.*\//, "", b); sub(/\.ko.*/, "", b); gsub(/-/, "_", b) + if (!(b in want) && !(b in skip)) for (i = 1; i <= nd; i++) if (dl[i] != "" && index(f, dl[i]) == 1) want[b] = 1 + if ((b in want) && !(b in skip)) { print f; m = split(kv[2], d, " "); for (i = 1; i <= m; i++) print d[i] } }' \ + "$MODDIR/modules.dep" | sort -u) +count=0 +for f in $wanted; do + src=$MODDIR/$f; [ -f "$src" ] || continue + out=$DEST/${f%.ko*}.ko; mkdir -p "$(dirname "$out")" + case "$src" in + *.ko) cp "$src" "$out" ;; + *.ko.zst) zstd -dqc "$src" > "$out" ;; + *.ko.xz) xz -dc "$src" > "$out" ;; + *.ko.gz) gzip -dc "$src" > "$out" ;; + *) continue ;; + esac + count=$((count + 1)) +done +cp "$MODDIR"/modules.order "$MODDIR"/modules.builtin "$MODDIR"/modules.builtin.modinfo "$DEST/" 2>/dev/null || true +depmod -b "$R/usr" "$KVER" 2>/dev/null || depmod -b "$R" "$KVER" +[ "$count" -gt 0 ] || { echo "initrd: no kernel modules copied" >&2; exit 1; } +echo " $count kernel modules" + +# zstd-compressed (the kernel unpacks it); GRUB reads a small file much faster through BIOS disk calls +( cd "$R" && find . | sort | cpio -o -H newc -R 0:0 --quiet ) | zstd -q -19 -T0 > "$OUT" +ls -lh "$OUT" diff --git a/tools/initrd/init b/tools/initrd/init @@ -0,0 +1,232 @@ +#!/bin/busybox sh +# Chamesle Linux initramfs init: +# live: find the live medium -> mount /live/rootfs.squashfs -> overlay a tmpfs on it -> switch_root to dinit +# installed: mount root= (unlocking LUKS first) -> switch_root to dinit +# Kernel command line options: +# root=UUID=...|LABEL=...|/dev/... an installed system. A LUKS partition is unlocked first (asks for the +# passphrase) and /dev/mapper/root becomes the root. Always mounted read-write. +# rootfstype=TYPE rootflags=OPTS filesystem type and mount options for root= (default: detected, no options) +# chamesle.iso=PATH prefer this ISO file on the medium's partition (e.g. an ISO on a Ventoy stick) +# chamesle.toram=1 copy the squashfs into RAM first (the stick can then be removed) +# chamesle.label=NAME volume label of the medium (default CHAMESLE; tried via findfs before scanning) +# chamesle.wait=N seconds to wait for the medium to appear (default 60) +# chamesle.debug=1 open a shell just before switching to the real root +# chamesle.shell=1 open a shell before looking for the medium +# init=PATH program to run as PID 1 (default /usr/bin/dinit) +export PATH=/bin:/sbin:/usr/bin:/usr/sbin + +/bin/busybox mkdir -p /proc /sys /dev /mnt /newroot /overlay +/bin/busybox mount -t proc proc /proc +/bin/busybox mount -t sysfs sysfs /sys +/bin/busybox mount -t devtmpfs devtmpfs /dev +/bin/busybox --install -s /bin 2>/dev/null # build-initrd.sh already linked the applets; this covers older initramfs trees +exec </dev/console >/dev/console 2>&1 + +log() { echo "[live] $*"; } +emergency() { + echo "[live] $*" + echo "[live] starting a shell; leave it with 'exit' to try again" + setsid cttyhack sh +} +# A LUKS header always starts with the 6-byte magic "LUKS" 0xba 0xbe (true for both LUKS1 and +# LUKS2), so this needs no more than dd/od -- no blkid dependency for a check this simple. +# od output format varies: busybox uses spaces, GNU may use newlines. Normalize by removing all whitespace. +is_luks() { + [ "$(dd if="$1" bs=6 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n\r')" = "4c554b53babe" ] +} + +LABEL=CHAMESLE ISO_HINT= DEBUG=0 SHELL_FIRST=0 TORAM=0 WAIT=60 INIT=/usr/bin/dinit +ROOT= ROOTFSTYPE= ROOTFLAGS= QUIET=0 +for a in $(cat /proc/cmdline); do + case "$a" in + chamesle.iso=*) ISO_HINT=${a#chamesle.iso=} ;; + chamesle.debug=1) DEBUG=1 ;; + chamesle.shell=1) SHELL_FIRST=1 ;; + chamesle.toram=1) TORAM=1 ;; + chamesle.label=*) LABEL=${a#chamesle.label=} ;; + chamesle.wait=*) WAIT=${a#chamesle.wait=} ;; + init=/*) INIT=${a#init=} ;; + root=*) ROOT=${a#root=} ;; + rootfstype=*) ROOTFSTYPE=${a#rootfstype=} ;; + rootflags=*) ROOTFLAGS=${a#rootflags=} ;; + quiet) QUIET=1 ;; + esac +done + +# Distro kernels ship storage and filesystem drivers as modules (copied into the initramfs by build-initrd.sh): +# load them before scanning for the medium. Missing ones (built in, or not shipped) are skipped silently. +if [ -d "/lib/modules/$(uname -r)" ]; then + for m in usb_storage uas xhci_pci ehci_pci ohci_pci uhci_hcd ahci nvme virtio_pci virtio_blk virtio_scsi \ + libata ata_piix ata_generic pata_acpi scsi_mod mmc_block sd_mod sr_mod isofs udf vfat exfat ext4 xfs btrfs f2fs \ + squashfs loop overlay dm_mod dm_crypt; do + modprobe "$m" 2>/dev/null || FAILED_MODS="${FAILED_MODS:-} $m" + done + [ -n "${FAILED_MODS:-}" ] && log "modules not loaded (built in or not shipped):$FAILED_MODS" + mdev -s 2>/dev/null +else + log "no kernel modules in the initramfs; relying on built-in drivers" +fi + +# Load whatever driver the hardware asks for: every device in sysfs has a modalias, and modprobe resolves it through +# modules.alias. Run again while waiting for the medium: loading a controller driver (xhci, ata_piix, ...) makes new +# devices (and so new modaliases) appear. +load_hw_modules() { + [ -d "/lib/modules/$(uname -r)" ] || return 0 + for f in $(find /sys/devices -name modalias 2>/dev/null); do + read -r alias < "$f" 2>/dev/null || continue + [ -n "$alias" ] && modprobe -q "$alias" 2>/dev/null + done + mdev -s 2>/dev/null + return 0 +} +load_hw_modules + +[ "$SHELL_FIRST" = 1 ] && emergency "chamesle.shell=1" + +# The initramfs carries a build id and so does the ISO's /live directory: with several Chamesle ISOs on one +# Ventoy stick, only the one this kernel came from is accepted (STRICT is dropped after a while, so a renamed +# or hand-assembled medium without a build-id file still boots). +STRICT=1 +[ -s /build-id ] || STRICT=0 +has_root() { + [ -f "$1/live/rootfs.squashfs" ] || return 1 + [ "$STRICT" = 0 ] || [ "$(cat "$1/live/build-id" 2>/dev/null)" = "$(cat /build-id)" ] +} + +# Look for the squashfs on every block device: directly (an ISO written to a stick or a CD) and +# inside ISO files on the device (Ventoy and similar). Sets MEDIUM to the mount point that holds it. +scan_once() { + n=0 + # fast path: the medium by its volume label + ldev=$(findfs "LABEL=$LABEL" 2>/dev/null) && [ -b "$ldev" ] && mkdir -p /mnt/label && + mount -o ro "$ldev" /mnt/label 2>/dev/null && { + if has_root /mnt/label; then MEDIUM=/mnt/label; return 0; fi + umount /mnt/label 2>/dev/null + } + for dev in /dev/sr[0-9]* /dev/sd[a-z] /dev/sd[a-z][0-9]* /dev/vd[a-z] /dev/vd[a-z][0-9]* \ + /dev/nvme[0-9]n[0-9] /dev/nvme[0-9]n[0-9]p[0-9]* /dev/mmcblk[0-9] /dev/mmcblk[0-9]p[0-9]* \ + /dev/mapper/*; do + [ -b "$dev" ] || continue + n=$((n + 1)); mp=/mnt/d$n + mkdir -p "$mp" + mount -o ro "$dev" "$mp" 2>/dev/null || continue + if has_root "$mp"; then MEDIUM=$mp; return 0; fi + k=0 + # Use a function to avoid glob expansion issues when no matches + check_isos() { + for iso in "$@"; do + [ -f "$iso" ] || continue + k=$((k + 1)); imp=/mnt/i$n-$k + mkdir -p "$imp" + if mount -o loop,ro "$iso" "$imp" 2>/dev/null; then + if has_root "$imp"; then MEDIUM=$imp; return 0; fi + umount "$imp" 2>/dev/null + fi + done + return 1 + } + # Build array of ISO paths, skipping non-existent globs + set -- + [ -n "${ISO_HINT:-}" ] && [ -f "$mp$ISO_HINT" ] && set -- "$@" "$mp$ISO_HINT" + for f in "$mp"/[Cc]hamesle*.iso "$mp"/*/[Cc]hamesle*.iso "$mp"/*.iso "$mp"/*/*.iso; do + [ -f "$f" ] && set -- "$@" "$f" + done + check_isos "$@" + [ -n "${MEDIUM:-}" ] && return 0 + umount "$mp" 2>/dev/null + done + return 1 +} + +# findfs knows UUID= and LABEL=; a /dev path is used as it is +find_dev() { + case "$1" in + /dev/*) [ -b "$1" ] && echo "$1" ;; + *) findfs "$1" 2>/dev/null ;; + esac +} + +if [ -n "$ROOT" ]; then + # ---- installed system + i=0 + until DEV=$(find_dev "$ROOT") && [ -n "$DEV" ]; do + i=$((i + 1)) + if [ "$i" -ge "$WAIT" ]; then + emergency "could not find the root partition ($ROOT)" + i=0 + fi + [ "$i" = 1 ] && log "waiting for the root partition ($ROOT)..." + sleep 1 + load_hw_modules + done + if is_luks "$DEV"; then + log "encrypted root partition: enter the passphrase to unlock it" + until [ -e /dev/mapper/root ]; do + cryptsetup open "$DEV" root || log "wrong passphrase, try again" + done + DEV=/dev/mapper/root + fi + until mount ${ROOTFSTYPE:+-t "$ROOTFSTYPE"} -o "rw${ROOTFLAGS:+,$ROOTFLAGS}" "$DEV" /newroot; do + emergency "could not mount $DEV on / (rootfstype=${ROOTFSTYPE:-auto} rootflags=${ROOTFLAGS:-none})" + done +else + while :; do + i=0 + until scan_once; do + i=$((i + 1)) + [ "$i" -ge 15 ] && STRICT=0 + if [ "$i" -ge "$WAIT" ]; then break; fi + [ "$i" = 1 ] && log "waiting for the live medium..." + sleep 1 + load_hw_modules + done + [ -n "${MEDIUM:-}" ] && break + log "filesystems: $(tr -d '\t' </proc/filesystems | grep -E 'iso9660|squashfs|overlay|vfat|ext4' | tr '\n' ' ')" + log "kernel modules loaded: $(cut -d' ' -f1 /proc/modules 2>/dev/null | tr '\n' ' ')" + log "block devices: $(cat /proc/partitions 2>/dev/null | awk 'NR>2 {print $4}' | tr '\n' ' ')" + emergency "could not find the live medium (a device with /live/rootfs.squashfs)" + done + log "medium found: $MEDIUM" + + SQ=$MEDIUM/live/rootfs.squashfs + if [ "$TORAM" = 1 ]; then + log "copying the system into RAM (this takes a moment)..." + # The initramfs root is a ramfs/tmpfs whose df numbers are meaningless (0 on ramfs): use MemAvailable + avail=$(awk '/^MemAvailable:/ {print $2}' /proc/meminfo) + need=$(du -k "$SQ" | awk '{print $1}') + if [ "${avail:-0}" -lt "$((need * 2 + 50000))" ]; then + emergency "not enough RAM for toram (need ${need}KB plus the running system, have ${avail:-0}KB)" + fi + cp "$SQ" /rootfs.squashfs && SQ=/rootfs.squashfs + fi + + mkdir -p /mnt/squash + until mount -t squashfs -o loop,ro "$SQ" /mnt/squash; do + emergency "could not mount $SQ" + done + mount -t tmpfs -o size=75% tmpfs /overlay + mkdir -p /overlay/upper /overlay/work + until mount -t overlay overlay -o lowerdir=/mnt/squash,upperdir=/overlay/upper,workdir=/overlay/work /newroot; do + emergency "could not create the overlay root" + done + # keep the live medium reachable for the installer (it copies the system from here) + mkdir -p /newroot/live-medium + mount --move "$MEDIUM" /newroot/live-medium +fi + +# the image may not carry these mount points (dinit's early-filesystems service mounts /run, /dev/pts, ... itself, but move ours) +mkdir -p /newroot/proc /newroot/sys /newroot/dev /newroot/run +mount --move /proc /newroot/proc +mount --move /sys /newroot/sys +mount --move /dev /newroot/dev +# dinit creates its control socket (/run/dinitctl) as soon as it starts, before any service could mount /run +mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /newroot/run +# tell the system it is the live session (the live services and the display manager's autologin look for it) +[ -n "${MEDIUM:-}" ] && : > /newroot/run/chamesle-live +[ "$DEBUG" = 1 ] && emergency "chamesle.debug=1: about to switch root" +[ -x "/newroot$INIT" ] || emergency "$INIT not found in the system image" +# with "quiet" on the command line dinit prints only errors (no [ OK ] line per service); without it, everything +# (/proc has been moved into the new root by now: QUIET comes from the command line parsed at the start) +INIT_ARGS= +[ "$QUIET" = 1 ] && [ "$INIT" = /usr/bin/dinit ] && [ "$DEBUG" = 0 ] && INIT_ARGS=--quiet +exec switch_root /newroot "$INIT" $INIT_ARGS diff --git a/tools/themes.sh b/tools/themes.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Install the Fluent GTK/Xfwm4 theme and the Fluent icons (vinceliuice, GPL-3.0) into an image: the Windows 11 look. +# Pinned tags, checked against their sha256; the projects' own install scripts do the work (prebuilt CSS, no sassc). +# usage: themes.sh ROOT +set -eu +ROOT=${1:?usage: themes.sh ROOT} +GTK_TAG=2025-04-17 +GTK_SHA256=bedc51e07ca4edaeb3bdd50e9e2a27c10f1b049f460b10e3b5668d11ff2b03cd +ICONS_TAG=2026-07-27 +ICONS_SHA256=24a8aca29a5b652a0e60ff8e5f12b86fe4b9c4c969565fad7c3fa7c1742b3631 +W=$(mktemp -d); trap 'rm -rf "$W"' EXIT +fetch() { # REPO TAG SHA256 + curl -fsSL --retry 5 --retry-all-errors -o "$W/$1.tar.gz" "https://github.com/vinceliuice/$1/archive/refs/tags/$2.tar.gz" + [ "$(sha256sum "$W/$1.tar.gz" | cut -d' ' -f1)" = "$3" ] || { echo "themes: checksum mismatch for $1" >&2; exit 1; } + tar -xzf "$W/$1.tar.gz" -C "$W" +} +fetch Fluent-gtk-theme "$GTK_TAG" "$GTK_SHA256" +fetch Fluent-icon-theme "$ICONS_TAG" "$ICONS_SHA256" +mkdir -p "$ROOT/usr/share/themes" "$ROOT/usr/share/icons" +(cd "$W/Fluent-gtk-theme-$GTK_TAG" && bash install.sh -d "$ROOT/usr/share/themes" >/dev/null) +(cd "$W/Fluent-icon-theme-$ICONS_TAG" && bash install.sh -d "$ROOT/usr/share/icons" >/dev/null) +echo "themes: Fluent GTK/Xfwm4 themes and Fluent icons installed"