chamesle

chamesle.org: the site of Chamesle, a small Linux distribution
git clone https://github.com/tortr-rs/chamesle
Log | Files | Refs | README

commit 70d7760a5abd0fc395368675fa3a48e9c5d17639
parent 278090b6eb4a7edd458f90ec902cf37196ea8f16
Author: torter <koubbamohamedrayan@gmail.com>
Date:   Sun, 25 Oct 2026 22:47:10 -0400

0.6 so far: cachyos kernel with the qr crash screen, ranni and play flavors, a server edition with jiggity in text, steam on the play iso, xfce starts on x11 after the first start

Diffstat:
Mbuild.sh | 44+++++++++++++++++++++++++++++++++-----------
Meditions/base.packages | 4++--
Aeditions/play/edition | 4++++
Aeditions/play/packages | 2++
Aeditions/ranni/edition | 3+++
Aeditions/ranni/packages | 2++
Aeditions/server/edition | 5+++++
Aeditions/server/overlay/etc/X11/xinit/xinitrc | 3+++
Aeditions/server/overlay/etc/dinit.d/boot.d/sshd | 2++
Aeditions/server/overlay/etc/dinit.d/getty-tty1 | 8++++++++
Aeditions/server/overlay/etc/motd | 3+++
Aeditions/server/packages | 23+++++++++++++++++++++++
Aoverlay/usr/lib/chamesle/console-getty | 13+++++++++++++
Aoverlay/usr/lib/chamesle/console-setup | 4++++
Aoverlay/usr/lib/jiggity/account.py | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aoverlay/usr/lib/jiggity/choices.py | 36++++++++++++++++++++++++++++++++++++
Moverlay/usr/lib/jiggity/firstboot.py | 52++++++++--------------------------------------------
Moverlay/usr/lib/jiggity/install.py | 9+++++++--
Moverlay/usr/lib/jiggity/jiggity.py | 35+----------------------------------
Aoverlay/usr/lib/jiggity/text.py | 271+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Moverlay/usr/lib/live-installer/installer.py | 6+++++-
Dtools/kernel/arch-kernel.sh | 143-------------------------------------------------------------------------------
Atools/kernel/kernel.sh | 161+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtools/pkg/chamesle-base/recipe | 6+++---
Atools/pkg/chamesle-play/files/etc/profile.d/play.sh | 5+++++
Atools/pkg/chamesle-play/files/etc/sddm.conf.d/20-play.conf | 2++
Atools/pkg/chamesle-play/files/etc/xdg/play/kdeglobals | 2++
Atools/pkg/chamesle-play/files/etc/xdg/play/kscreenlockerrc | 2++
Atools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/contents/defaults | 14++++++++++++++
Atools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/contents/layouts/org.kde.plasma.desktop-layout.js | 32++++++++++++++++++++++++++++++++
Atools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/metadata.json | 14++++++++++++++
Atools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/Main.qml | 2++
Atools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/assets | 2++
Atools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/aurora-blur.jpg | 0
Atools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/metadata.desktop | 2++
Atools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/theme.conf | 6++++++
Atools/pkg/chamesle-play/files/usr/share/wallpapers/Play/contents/images/3840x2160.jpg | 0
Atools/pkg/chamesle-play/files/usr/share/wallpapers/Play/contents/screenshot.jpg | 0
Atools/pkg/chamesle-play/files/usr/share/wallpapers/Play/metadata.json | 9+++++++++
Atools/pkg/chamesle-play/recipe | 13+++++++++++++
Atools/pkg/chamesle-ranni/files/etc/profile.d/ranni.sh | 6++++++
Atools/pkg/chamesle-ranni/files/etc/sddm.conf.d/20-ranni.conf | 2++
Atools/pkg/chamesle-ranni/files/etc/xdg/ranni/kdeglobals | 2++
Atools/pkg/chamesle-ranni/files/etc/xdg/ranni/kglobalshortcutsrc | 2++
Atools/pkg/chamesle-ranni/files/etc/xdg/ranni/kscreenlockerrc | 2++
Atools/pkg/chamesle-ranni/files/etc/xdg/ranni/kwinrc | 3+++
Atools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/contents/defaults | 14++++++++++++++
Atools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/contents/layouts/org.kde.plasma.desktop-layout.js | 43+++++++++++++++++++++++++++++++++++++++++++
Atools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/metadata.json | 14++++++++++++++
Atools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/Main.qml | 2++
Atools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/assets | 2++
Atools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/dunes-blur.jpg | 0
Atools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/metadata.desktop | 2++
Atools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/theme.conf | 6++++++
Atools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/contents/images/3840x2160.jpg | 0
Atools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/contents/screenshot.jpg | 0
Atools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/metadata.json | 9+++++++++
Atools/pkg/chamesle-ranni/recipe | 13+++++++++++++
Mtools/pkg/chamesle-snapshots/files/usr/bin/chamesle-snapshot | 3++-
Mtools/pkg/chamesle-snapshots/recipe | 2+-
60 files changed, 900 insertions(+), 242 deletions(-)

diff --git a/build.sh b/build.sh @@ -27,7 +27,9 @@ for t in "$APK" mksquashfs xorriso readelf zstd cpio depmod curl; do command -v 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" $(for e in $EDS; do echo "$HERE/editions/$e/packages"; done) | tr ' \t' '\n\n' | grep -v '^$' | sort -u; } +# an edition with desktop-packages=no (server) lists everything itself, without base.packages' desktop parts +BASEPKGS=$HERE/editions/base.packages; [ "$(edval desktop-packages)" = no ] && BASEPKGS= +packages() { sed 's/#.*//' $BASEPKGS $(for e in $EDS; do echo "$HERE/editions/$e/packages"; done) | tr ' \t' '\n\n' | grep -v '^$' | sort -u; } echo "=== [1/5] INSTALLING THE SYSTEM ($EDITION_NAME, from $REPO)" rm -rf "$WORK"; mkdir -p "$ROOT/etc/apk/keys" "$ISO_DIR/live" "$OUT" @@ -52,6 +54,19 @@ rm -rf "$ROOT/tmp/scripts" umount "$ROOT/proc" 2>/dev/null || true; umount -lR "$ROOT/dev" 2>/dev/null || true; trap - EXIT # what the installed system updates from echo "v3 $PUBLIC_REPO" > "$ROOT/etc/apk/repositories" +# flathub apps on the iso (play: steam). this machine's flatpak installs them into the image's system flatpaks +FLATPAKS=$(edval flatpaks) +if [ -n "$FLATPAKS" ]; then + command -v flatpak >/dev/null || { echo "build: flatpaks=$FLATPAKS needs flatpak on this machine" >&2; exit 1; } + export FLATPAK_SYSTEM_DIR=$ROOT/var/lib/flatpak + # a copy from an earlier build saves the download: install then only brings what's new + FLATPAK_SEED=${FLATPAK_SEED:-$HERE/work/flatpak-seed} + [ -d "$FLATPAK_SEED" ] && { mkdir -p "$FLATPAK_SYSTEM_DIR"; cp -a "$FLATPAK_SEED/." "$FLATPAK_SYSTEM_DIR/"; } + flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + flatpak install --system -y --noninteractive flathub $FLATPAKS + flatpak update --system -y --noninteractive + unset FLATPAK_SYSTEM_DIR +fi echo "=== [2/5] CHAMESLE: SERVICES, LOOK AND BRANDING" cp -a "$HERE/overlay/." "$ROOT/" @@ -60,9 +75,9 @@ for e in $EDS; do [ -d "$HERE/editions/$e/overlay" ] && cp -a "$HERE/editions/$e # the installer's slideshow starts with this edition's desktop (the website's picture of it) and how to get around SLIDES=$ROOT/usr/share/live-installer/slideshow SHOT=; for e in $EDITION $BASE; do [ -z "$SHOT" ] && [ -f "$HERE/docs/img/$e.png" ] && SHOT=$HERE/docs/img/$e.png; done -if [ -n "$SHOT" ]; then cp "$SHOT" "$SLIDES/desktop.png"; else rm -f "$SLIDES/desktop.png"; fi +if [ -d "$SLIDES" ] && [ -n "$SHOT" ]; then cp "$SHOT" "$SLIDES/desktop.png"; else rm -f "$SLIDES/desktop.png"; fi TOUR=$(edval tour) -if [ -n "$TOUR" ]; then +if [ -d "$SLIDES" ] && [ -n "$TOUR" ]; then sed -i "s|<p id=\"tour\">[^<]*</p>|<p id=\"tour\">${TOUR//&/\\&}</p>|" "$SLIDES/index.html" fi # xfce's stock wallpapers -> ours, for monitors xfce4-desktop.xml doesn't name @@ -119,6 +134,10 @@ if [ "$LOGIN" = sddm ]; then mkdir -p "$ROOT/etc/sddm.conf.d" printf '# the live session only (the installer removes this file)\n[Autologin]\nUser=live\nSession=%s.desktop\n' "$SESSION" \ > "$ROOT/etc/sddm.conf.d/90-live.conf" +elif [ "$LOGIN" = console ]; then + # no sign-in screen: tty1 logs live in, and Install runs jiggity in text there + echo live > "$ROOT/etc/chamesle/autologin" + rm -f "$ROOT/etc/dinit.d/boot.d/display-manager" elif [ "$LOGIN" = gdm ]; then # gdm has a single config file, the installer takes these lines out again. the session comes from accountsservice sed -i 's/^\[daemon\]$/&\n# the live session only\nAutomaticLoginEnable=True\nAutomaticLogin=live/' "$ROOT/etc/gdm/custom.conf" @@ -131,7 +150,8 @@ fi "$IN" "$ROOT" /usr/bin/xdg-user-dirs-update 2>/dev/null || true # installer icon on the desktop, marked trusted at login or xfce and caja ask first mkdir -p "$ROOT/home/live/Desktop" "$ROOT/home/live/.config/autostart" -install -m755 "$ROOT/usr/share/applications/chamesle-install.desktop" "$ROOT/home/live/Desktop/" +[ -f "$ROOT/usr/share/applications/chamesle-install.desktop" ] && + install -m755 "$ROOT/usr/share/applications/chamesle-install.desktop" "$ROOT/home/live/Desktop/" cat > "$ROOT/home/live/.config/autostart/trust-installer.desktop" <<'EOF' [Desktop Entry] Type=Application @@ -153,7 +173,9 @@ rm -f "$ROOT/etc/machine-id" "$ROOT/var/lib/dbus/machine-id" rm -rf "$ROOT/var/cache/apk"/* echo "=== [4/5] KERNEL AND INITRAMFS" -KVER=$(ls "$ROOT/usr/lib/modules" | sort -V | tail -n1) +# our kernel, not void's fallback next to it, even when void's has the higher version +KVER=$(ls "$ROOT/usr/lib/modules" | grep -- '-cachyos-lts$' | sort -V | tail -n1) +[ -n "$KVER" ] || 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" @@ -186,28 +208,28 @@ if [ ! -f /live/vmlinuz ]; then search --no-floppy --set=root --file /live/vmlin # two choices, like a Windows USB: try it, or install it. Install starts Jiggity alone on the screen, with no desktop menuentry "Try Chamesle" { - linux /live/vmlinuz quiet splash loglevel=3 drm.panic_screen=kmsg + linux /live/vmlinuz quiet splash loglevel=3 drm.panic_screen=qr_code initrd /live/initrd.img } menuentry "Install Chamesle" { - linux /live/vmlinuz chamesle.install=1 quiet splash loglevel=3 drm.panic_screen=kmsg + linux /live/vmlinuz chamesle.install=1 quiet splash loglevel=3 drm.panic_screen=qr_code initrd /live/initrd.img } submenu "More options" { menuentry "Try Chamesle (safe graphics)" { - linux /live/vmlinuz quiet loglevel=3 nomodeset drm.panic_screen=kmsg + linux /live/vmlinuz quiet loglevel=3 nomodeset drm.panic_screen=qr_code initrd /live/initrd.img } menuentry "Install Chamesle (safe graphics)" { - linux /live/vmlinuz chamesle.install=1 quiet loglevel=3 nomodeset drm.panic_screen=kmsg + linux /live/vmlinuz chamesle.install=1 quiet loglevel=3 nomodeset drm.panic_screen=qr_code initrd /live/initrd.img } menuentry "Try Chamesle (copy to RAM)" { - linux /live/vmlinuz chamesle.toram=1 quiet splash loglevel=3 drm.panic_screen=kmsg + linux /live/vmlinuz chamesle.toram=1 quiet splash loglevel=3 drm.panic_screen=qr_code initrd /live/initrd.img } menuentry "Try Chamesle (show boot messages)" { - linux /live/vmlinuz loglevel=4 console=tty0 console=ttyS0,115200 drm.panic_screen=kmsg + linux /live/vmlinuz loglevel=4 console=tty0 console=ttyS0,115200 drm.panic_screen=qr_code initrd /live/initrd.img } } diff --git a/editions/base.packages b/editions/base.packages @@ -7,9 +7,9 @@ util-linux shadow procps-ng psmisc kmod eudev dbus elogind polkit dinit busybox iproute2 iputils NetworkManager openssh curl wget ca-certificates rsync sudo nano glibc-locales tzdata man-db ncurses -# kernel: arch's linux-lts repacked (tools/kernel/arch-kernel.sh), for the blue screen with the log on a crash. +# kernel: cachyos's linux-cachyos-lts repacked (tools/kernel/kernel.sh), with the blue screen and qr code on a crash. # the same LTS series void ships. firmware, microcode -chamesle-kernel linux-firmware intel-ucode +chamesle-kernel-cachyos linux-firmware intel-ucode # sign-in screen, the same on every edition sddm chamesle-sddm diff --git a/editions/play/edition b/editions/play/edition @@ -0,0 +1,4 @@ +name=Play +# a flavor: the kde plasma edition for games +base=kde +flatpaks=com.valvesoftware.Steam diff --git a/editions/play/packages b/editions/play/packages @@ -0,0 +1,2 @@ +# play flavor: steam (from flathub, on the iso), gamemode, controllers, the lofoten aurora +chamesle-play diff --git a/editions/ranni/edition b/editions/ranni/edition @@ -0,0 +1,3 @@ +name=Ranni +# a flavor: the kde plasma edition set up like a mac +base=kde diff --git a/editions/ranni/packages b/editions/ranni/packages @@ -0,0 +1,2 @@ +# ranni flavor: kde plasma with a menu bar, a dock and spotlight-style search, the mongolian dunes +chamesle-ranni diff --git a/editions/server/edition b/editions/server/edition @@ -0,0 +1,5 @@ +name=Server +# no desktop and no sign-in screen: the console, jiggity in text, ssh on. ttywm is startx away +login=console +session=ttywm +desktop-packages=no diff --git a/editions/server/overlay/etc/X11/xinit/xinitrc b/editions/server/overlay/etc/X11/xinit/xinitrc @@ -0,0 +1,3 @@ +#!/bin/sh +# startx: ttywm +exec ttywm-session diff --git a/editions/server/overlay/etc/dinit.d/boot.d/sshd b/editions/server/overlay/etc/dinit.d/boot.d/sshd @@ -0,0 +1 @@ +../sshd +\ No newline at end of file diff --git a/editions/server/overlay/etc/dinit.d/getty-tty1 b/editions/server/overlay/etc/dinit.d/getty-tty1 @@ -0,0 +1,8 @@ +# text login on tty1, with jiggity's text screens first when they're needed +type = process +command = /usr/lib/chamesle/console-getty +depends-on = system-identity +waits-for = console-setup +waits-for = plymouth-quit +restart = true +smooth-recovery = true diff --git a/editions/server/overlay/etc/motd b/editions/server/overlay/etc/motd @@ -0,0 +1,3 @@ + + Chamesle Server. Type startx for windows (ttywm), sudo apk upgrade for updates. + diff --git a/editions/server/packages b/editions/server/packages @@ -0,0 +1,23 @@ +# server edition: everything is listed here, base.packages' desktop parts aren't in it + +# 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 apk-tools plymouth chamesle-plymouth +iproute2 iputils NetworkManager openssh curl wget ca-certificates rsync +sudo nano vim tmux htop glibc-locales tzdata man-db ncurses kbd + +# kernel, firmware, microcode +chamesle-kernel-cachyos linux-firmware intel-ucode + +# disks, filesystems, boot +chamesle-grub grub grub-x86_64-efi grub-i386-efi efibootmgr os-prober +e2fsprogs dosfstools ntfs-3g exfatprogs btrfs-progs xfsprogs cryptsetup lvm2 gptfdisk parted mdadm smartmontools + +# jiggity in text, and dracut for installed systems +python3 python3-parted xkeyboard-config dracut + +# windows when you want them: startx brings up ttywm +xorg-minimal xinit xorg-input-drivers xorg-video-drivers mesa-dri ttywm + +chamesle-base diff --git a/overlay/usr/lib/chamesle/console-getty b/overlay/usr/lib/chamesle/console-getty @@ -0,0 +1,13 @@ +#!/bin/sh +# tty1 on editions without a sign-in screen. agetty sets up the terminal, then: jiggity in text from the usb's +# Install entry, the first start setup once installed, or the login (the live user's, without a password) +if grep -qw chamesle.install=1 /proc/cmdline; then + exec /usr/bin/agetty --noclear --autologin root --login-program /usr/lib/chamesle/console-setup --login-options install tty1 38400 linux +fi +if [ -f /etc/chamesle/firstboot ]; then + exec /usr/bin/agetty --noclear --autologin root --login-program /usr/lib/chamesle/console-setup --login-options firstboot tty1 38400 linux +fi +if [ -f /etc/chamesle/autologin ]; then + exec /usr/bin/agetty --autologin "$(cat /etc/chamesle/autologin)" tty1 38400 linux +fi +exec /usr/bin/agetty tty1 38400 linux diff --git a/overlay/usr/lib/chamesle/console-setup b/overlay/usr/lib/chamesle/console-setup @@ -0,0 +1,4 @@ +#!/bin/sh +# what console-getty runs instead of login: jiggity's text screens +export TERM=linux LANG=en_US.UTF-8 +exec /usr/bin/python3 /usr/lib/jiggity/text.py "$1" diff --git a/overlay/usr/lib/jiggity/account.py b/overlay/usr/lib/jiggity/account.py @@ -0,0 +1,71 @@ +# first start without gtk: the time zones, the network, making the account +import os +import re +import subprocess + +MARK = "/etc/chamesle/firstboot" +GROUPS = "wheel audio video input network storage optical scanner lp plugdev bluetooth users kvm".split() + + +def zones(): + out = [] + try: + for line in open("/usr/share/zoneinfo/zone1970.tab"): + if not line.startswith("#"): + out.append(line.split("\t")[2].strip()) + except OSError: + out = ["UTC"] + return sorted(out) + + +def online(): + r = subprocess.run(["nmcli", "-t", "-f", "STATE", "general"], text=True, stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + return r.stdout.strip() == "connected" + + +def username_from(name): + return re.sub(r"[^a-z0-9_-]", "", name.split(" ")[0].lower()) + + +# what's wrong with a username, or "" +def bad_username(u): + if u and not re.fullmatch(r"[a-z_][a-z0-9_-]{0,31}", u): + return "A username is lowercase letters and numbers, starting with a letter." + if u in ("root", "live", "daemon", "bin", "nobody"): + return "That username is taken by the system. Pick another one." + return "" + + +def make(zone, user, name, pw): + groups = [g.split(":")[0] for g in open("/etc/group")] + subprocess.run(["useradd", "-m", "-s", "/bin/bash", "-c", name, "-G", + ",".join(g for g in GROUPS if g in groups), user]) + subprocess.run(["chpasswd", "-c", "SHA512"], input="%s:%s\n" % (user, pw), text=True) + subprocess.run(["ln", "-sf", "/usr/share/zoneinfo/" + zone, "/etc/localtime"]) + with open("/etc/timezone", "w") as f: + f.write(zone + "\n") + host = re.sub(r"[^a-z0-9-]", "", user.lower())[:20] + "-pc" + with open("/etc/hostname", "w") as f: + f.write(host + "\n") + with open("/etc/hosts", "w") as f: + f.write("127.0.0.1\tlocalhost\n127.0.1.1\t%s\n::1\tlocalhost ip6-localhost ip6-loopback\n" % host) + subprocess.run(["hostname", host]) + remember_session(user) + os.unlink(MARK) + + +# sddm lists wayland sessions first and would pick one (xfce's isn't ready): the edition's own session is the +# last one used, so it's the one that starts +def remember_session(user): + try: + name = open("/etc/chamesle/session").read().strip() + except OSError: + return + for d in ("/usr/share/xsessions", "/usr/share/wayland-sessions"): + path = "%s/%s.desktop" % (d, name) + if os.path.exists(path) and os.path.isdir("/var/lib/sddm"): + with open("/var/lib/sddm/state.conf", "w") as f: + f.write("[Last]\nSession=%s\nUser=%s\n" % (path, user)) + subprocess.run(["chown", "sddm:sddm", "/var/lib/sddm/state.conf"], stderr=subprocess.DEVNULL) + return diff --git a/overlay/usr/lib/jiggity/choices.py b/overlay/usr/lib/jiggity/choices.py @@ -0,0 +1,36 @@ +# what both installers offer: languages, keyboards, the install steps + + +LANGUAGES = [ + ("English (United States)", "en_US"), ("English (United Kingdom)", "en_GB"), ("Français", "fr_FR"), + ("Deutsch", "de_DE"), ("Español", "es_ES"), ("Español (México)", "es_MX"), ("Italiano", "it_IT"), + ("Português (Brasil)", "pt_BR"), ("Português", "pt_PT"), ("Nederlands", "nl_NL"), ("Polski", "pl_PL"), + ("Türkçe", "tr_TR"), ("Русский", "ru_RU"), ("Українська", "uk_UA"), ("العربية", "ar_MA"), ("العربية (مصر)", "ar_EG"), + ("Svenska", "sv_SE"), ("Norsk bokmål", "nb_NO"), ("Dansk", "da_DK"), ("Suomi", "fi_FI"), ("Čeština", "cs_CZ"), + ("Magyar", "hu_HU"), ("Română", "ro_RO"), ("Ελληνικά", "el_GR"), ("日本語", "ja_JP"), ("한국어", "ko_KR"), + ("中文 (简体)", "zh_CN"), ("中文 (繁體)", "zh_TW"), ("हिन्दी", "hi_IN"), ("Bahasa Indonesia", "id_ID"), + ("Tiếng Việt", "vi_VN"), +] +STEPS = ["Getting the drive ready", "Copying files", "Getting files ready for installation", + "Installing the boot menu", "Finishing up"] + + +def keyboards(): + out, section = [], None + try: + lines = open("/usr/share/X11/xkb/rules/base.lst").read().splitlines() + except OSError: + return [("English (US)", "us", "")] + for line in lines: + if line.startswith("!"): + section = line[1:].strip() + continue + if not line.strip(): + continue + name, desc = line.split(None, 1) + if section == "layout": + out.append((desc.strip(), name, "")) + elif section == "variant": + layout, desc = desc.split(":", 1) + out.append((desc.strip(), layout, name)) + return sorted(out, key=lambda k: k[0].lower()) diff --git a/overlay/usr/lib/jiggity/firstboot.py b/overlay/usr/lib/jiggity/firstboot.py @@ -1,6 +1,5 @@ #!/usr/bin/python3 # first boot setup: time zone, wi-fi, user account -import os import re import subprocess import sys @@ -11,27 +10,9 @@ gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GLib sys.path.insert(0, "/usr/lib/jiggity") +import account import ui - -MARK = "/etc/chamesle/firstboot" -GROUPS = "wheel audio video input network storage optical scanner lp plugdev bluetooth users kvm".split() - - -def zones(): - out = [] - try: - for line in open("/usr/share/zoneinfo/zone1970.tab"): - if not line.startswith("#"): - out.append(line.split("\t")[2].strip()) - except OSError: - out = ["UTC"] - return sorted(out) - - -def online(): - r = subprocess.run(["nmcli", "-t", "-f", "STATE", "general"], text=True, stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL) - return r.stdout.strip() == "connected" +from account import zones, online class FirstBoot(ui.SetupWindow): @@ -144,15 +125,11 @@ class FirstBoot(ui.SetupWindow): def on_account(self, entry): if entry is self.name and not self.user_edited: - u = re.sub(r"[^a-z0-9_-]", "", self.name.get_text().split(" ")[0].lower()) - self.user.set_text(u) + self.user.set_text(account.username_from(self.name.get_text())) u, p1, p2 = self.user.get_text(), self.pw1.get_text(), self.pw2.get_text() - note, ok = "", True - if u and not re.fullmatch(r"[a-z_][a-z0-9_-]{0,31}", u): - note, ok = "A username is lowercase letters and numbers, starting with a letter.", False - elif u in ("root", "live", "daemon", "bin", "nobody"): - note, ok = "That username is taken by the system. Pick another one.", False - elif p2 and p1 != p2: + note = account.bad_username(u) + ok = not note + if ok and p2 and p1 != p2: note, ok = "The passwords don't match.", False self.account_note.set_text(note) self.set_button_sensitive("Next", ok and bool(u and p1 and p1 == p2)) @@ -171,21 +148,7 @@ class FirstBoot(ui.SetupWindow): return box, [] def make_account(self): - user, name, pw = self.user.get_text(), self.name.get_text(), self.pw1.get_text() - groups = [g.split(":")[0] for g in open("/etc/group")] - subprocess.run(["useradd", "-m", "-s", "/bin/bash", "-c", name, "-G", - ",".join(g for g in GROUPS if g in groups), user]) - subprocess.run(["chpasswd", "-c", "SHA512"], input="%s:%s\n" % (user, pw), text=True) - subprocess.run(["ln", "-sf", "/usr/share/zoneinfo/" + self.zone, "/etc/localtime"]) - with open("/etc/timezone", "w") as f: - f.write(self.zone + "\n") - host = re.sub(r"[^a-z0-9-]", "", user.lower())[:20] + "-pc" - with open("/etc/hostname", "w") as f: - f.write(host + "\n") - with open("/etc/hosts", "w") as f: - f.write("127.0.0.1\tlocalhost\n127.0.1.1\t%s\n::1\tlocalhost ip6-localhost ip6-loopback\n" % host) - subprocess.run(["hostname", host]) - os.unlink(MARK) + account.make(self.zone, self.user.get_text(), self.name.get_text(), self.pw1.get_text()) GLib.idle_add(Gtk.main_quit) def show_page(self, n): @@ -196,6 +159,7 @@ class FirstBoot(ui.SetupWindow): self.set_button_sensitive("Yes", False) if n == 2: self.set_button_sensitive("Next", False) + self.name.grab_focus() if __name__ == "__main__": diff --git a/overlay/usr/lib/jiggity/install.py b/overlay/usr/lib/jiggity/install.py @@ -1,4 +1,5 @@ # progress(step, percent): 0 partition, 1 copy, 2 configure, 3 bootloader, 4 cleanup +import glob import os import subprocess import time @@ -13,7 +14,7 @@ LIVE_ONLY = ["/etc/sudoers.d/live", "/etc/polkit-1/rules.d/49-live.rules", "/etc "/etc/sddm.conf.d/90-live.conf", "/usr/share/applications/chamesle-install.desktop", "/usr/bin/chamesle-install", "/usr/bin/live-installer", "/usr/lib/live-installer", "/usr/share/live-installer", "/usr/share/icons/live-installer-progress-dot-on.png", "/usr/share/icons/live-installer-progress-dot-off.png", - "/var/lib/AccountsService/users/live", "/usr/bin/jiggity"] + "/var/lib/AccountsService/users/live", "/usr/bin/jiggity", "/etc/chamesle/autologin"] def chroot(*cmd, input=None): @@ -134,12 +135,16 @@ def install(row, passphrase, language, keyboard, progress): set_grub("GRUB_CMDLINE_LINUX", "rd.luks.uuid=%s" % uuid(plan.root)) chroot("dracut", "--force", "--regenerate-all") progress(3, 40) - cmdline = "quiet splash loglevel=3 drm.panic_screen=kmsg" + cmdline = "quiet splash loglevel=3 drm.panic_screen=qr_code" if os.path.exists(T + "/usr/lib/chamesle/init"): cmdline += " init=/usr/lib/chamesle/init" set_grub("GRUB_DISTRIBUTOR", "Chamesle") set_grub("GRUB_CMDLINE_LINUX_DEFAULT", cmdline) set_grub("GRUB_DISABLE_OS_PROBER", "false") + # our kernel first, void's below it for when ours doesn't start + ours = sorted(glob.glob(T + "/boot/vmlinuz-*-cachyos-lts")) + if ours: + set_grub("GRUB_TOP_LEVEL", ours[-1][len(T):]) set_grub("GRUB_GFXMODE", "auto") set_grub("GRUB_GFXPAYLOAD_LINUX", "keep") if os.path.exists(T + "/usr/share/grub/themes/chamesle/theme.txt"): diff --git a/overlay/usr/lib/jiggity/jiggity.py b/overlay/usr/lib/jiggity/jiggity.py @@ -12,40 +12,7 @@ sys.path.insert(0, "/usr/lib/jiggity") import disks import install import ui - -LANGUAGES = [ - ("English (United States)", "en_US"), ("English (United Kingdom)", "en_GB"), ("Français", "fr_FR"), - ("Deutsch", "de_DE"), ("Español", "es_ES"), ("Español (México)", "es_MX"), ("Italiano", "it_IT"), - ("Português (Brasil)", "pt_BR"), ("Português", "pt_PT"), ("Nederlands", "nl_NL"), ("Polski", "pl_PL"), - ("Türkçe", "tr_TR"), ("Русский", "ru_RU"), ("Українська", "uk_UA"), ("العربية", "ar_MA"), ("العربية (مصر)", "ar_EG"), - ("Svenska", "sv_SE"), ("Norsk bokmål", "nb_NO"), ("Dansk", "da_DK"), ("Suomi", "fi_FI"), ("Čeština", "cs_CZ"), - ("Magyar", "hu_HU"), ("Română", "ro_RO"), ("Ελληνικά", "el_GR"), ("日本語", "ja_JP"), ("한국어", "ko_KR"), - ("中文 (简体)", "zh_CN"), ("中文 (繁體)", "zh_TW"), ("हिन्दी", "hi_IN"), ("Bahasa Indonesia", "id_ID"), - ("Tiếng Việt", "vi_VN"), -] -STEPS = ["Getting the drive ready", "Copying files", "Getting files ready for installation", - "Installing the boot menu", "Finishing up"] - - -def keyboards(): - out, section = [], None - try: - lines = open("/usr/share/X11/xkb/rules/base.lst").read().splitlines() - except OSError: - return [("English (US)", "us", "")] - for line in lines: - if line.startswith("!"): - section = line[1:].strip() - continue - if not line.strip(): - continue - name, desc = line.split(None, 1) - if section == "layout": - out.append((desc.strip(), name, "")) - elif section == "variant": - layout, desc = desc.split(":", 1) - out.append((desc.strip(), layout, name)) - return sorted(out, key=lambda k: k[0].lower()) +from choices import LANGUAGES, STEPS, keyboards class Jiggity(ui.SetupWindow): diff --git a/overlay/usr/lib/jiggity/text.py b/overlay/usr/lib/jiggity/text.py @@ -0,0 +1,271 @@ +#!/usr/bin/python3 +# jiggity in text, for editions without a desktop: blue like windows setup used to be +# text.py install from the usb's Install entry +# text.py firstboot the first start: time zone, network, account +import curses +import os +import subprocess +import sys +import threading + +sys.path.insert(0, "/usr/lib/jiggity") +import account +import disks +import install +from choices import LANGUAGES, STEPS, keyboards + +scr = None + + +def frame(title, keys): + scr.bkgd(" ", curses.color_pair(1)) + scr.erase() + h, w = scr.getmaxyx() + scr.addstr(0, 1, " Chamesle Setup", curses.A_BOLD) + scr.hline(1, 1, curses.ACS_HLINE, w - 2) + scr.addstr(3, 4, title[:w - 6], curses.A_BOLD) + scr.attron(curses.color_pair(2)) + scr.hline(h - 1, 0, " ", w) + scr.addstr(h - 1, 2, keys[:w - 4]) + scr.attroff(curses.color_pair(2)) + + +def text(y, s): + h, w = scr.getmaxyx() + words, line = s.split(), "" + for word in words: + if len(line) + len(word) + 1 > w - 10: + scr.addstr(y, 4, line) + y, line = y + 1, "" + line = (line + " " + word).strip() + if line: + scr.addstr(y, 4, line) + return y + 2 + + +# a list to pick from. type to jump. returns the index, or None for esc +def choose(title, note, items, sel=0, disabled=()): + top, typed = 0, "" + while True: + frame(title, "ENTER=Continue ESC=Back Type to search") + y = text(5, note) if note else 5 + h, w = scr.getmaxyx() + rows = h - y - 3 + if sel < top: + top = sel + if sel >= top + rows: + top = sel - rows + 1 + for i in range(top, min(len(items), top + rows)): + attr = curses.color_pair(3) if i == sel else curses.color_pair(1) + if i in disabled: + attr |= curses.A_DIM + scr.addstr(y + i - top, 6, items[i][:w - 12].ljust(w - 12), attr) + k = scr.get_wch() + if k in ("\n", curses.KEY_ENTER) and sel not in disabled: + return sel + if k == "\x1b": + return None + if k == curses.KEY_UP: + sel = max(0, sel - 1) + elif k == curses.KEY_DOWN: + sel = min(len(items) - 1, sel + 1) + elif k == curses.KEY_PPAGE: + sel = max(0, sel - rows) + elif k == curses.KEY_NPAGE: + sel = min(len(items) - 1, sel + rows) + elif isinstance(k, str) and k.isprintable(): + typed += k.lower() + for i, it in enumerate(items): + if typed in it.lower(): + sel = i + break + else: + typed = k.lower() + elif k in (curses.KEY_BACKSPACE, "\x7f"): + typed = typed[:-1] + + +# a line of input. returns the text, or None for esc +def ask(title, note, label, secret=False, value=""): + curses.curs_set(1) + while True: + frame(title, "ENTER=Continue ESC=Back") + y = text(5, note) if note else 5 + scr.addstr(y, 4, label) + x = 6 + len(label) + shown = "*" * len(value) if secret else value + scr.addstr(y, x, shown.ljust(32), curses.color_pair(4)) + scr.move(y, x + len(shown)) + k = scr.get_wch() + if k in ("\n", curses.KEY_ENTER): + curses.curs_set(0) + return value + if k == "\x1b": + curses.curs_set(0) + return None + if k in (curses.KEY_BACKSPACE, "\x7f", "\b"): + value = value[:-1] + elif isinstance(k, str) and k.isprintable() and len(value) < 64: + value += k + + +def say(title, note, keys="ENTER=Continue"): + frame(title, keys) + text(5, note) + scr.refresh() + return scr.get_wch() + + +def yes(title, note): + while True: + k = say(title, note, "Y=Yes N=No") + if k in ("y", "Y"): + return True + if k in ("n", "N", "\x1b"): + return False + + +def run_install(): + lang = choose("Language to install", "", [n for n, c in LANGUAGES]) + if lang is None: + lang = 0 + kbds = keyboards() + us = next((i for i, k in enumerate(kbds) if k[1] == "us" and not k[2]), 0) + kb = choose("Keyboard", "", [k[0] for k in kbds], us) + if kb is None: + kb = us + while True: + rows = disks.scan() + if not rows: + say("No drives found", "Check that the drive is connected, then press ENTER to look again.") + continue + items = [] + for r in rows: + free = " %s free" % disks.size_text(r.free) if r.kind != "drive" else "" + items.append("%s%-40s %9s%s %s" % ("" if r.kind == "drive" else " ", r.label[:40], + disks.size_text(r.total), free, r.type_text)) + off = [i for i, r in enumerate(rows) if not r.usable] + first = next((i for i in range(len(rows)) if i not in off), 0) + i = choose("Where do you want to install Chamesle?", + "Pick a drive to use all of it, or its unallocated space to keep what's on it. Chamesle needs at " + "least %s." % disks.size_text(disks.MIN_SIZE), items, first, off) + if i is None: + continue + row = rows[i] + if row.kind == "drive" and not yes("Erase %s?" % row.label.split(":")[0], + "Everything on this drive will be deleted, and Chamesle will be installed " + "on it. This can't be undone."): + continue + break + passphrase = None + if yes("Encrypt Chamesle?", "With a passphrase you type every time the computer starts. If you forget it, your " + "files can't be recovered."): + while True: + p1 = ask("Encrypt Chamesle", "At least 8 characters.", "Passphrase:", True) + if p1 is None: + break + if len(p1) < 8: + say("Encrypt Chamesle", "The passphrase needs at least 8 characters.") + continue + if ask("Encrypt Chamesle", "Type it again.", "Confirm: ", True) != p1: + say("Encrypt Chamesle", "The passphrases don't match.") + continue + passphrase = p1 + break + + state = {"step": 0, "percent": 0, "error": None, "done": False} + + def work(): + try: + install.install(row, passphrase, LANGUAGES[lang][1], kbds[kb][1:], progress=progress) + except Exception as e: + print("jiggity: the installation failed:", e, file=sys.stderr) + state["error"] = str(e) + state["done"] = True + + def progress(step, percent): + state["step"], state["percent"] = step, percent + + threading.Thread(target=work, daemon=True).start() + scr.timeout(500) + while not state["done"]: + frame("Installing Chamesle", "Please wait") + for i, s in enumerate(STEPS): + if i < state["step"] or (i == state["step"] and state["percent"] >= 100): + line = "[x] " + s + elif i == state["step"]: + line = "[ ] " + s + (" (%d%%)" % state["percent"] if i == 1 else "...") + else: + line = "[ ] " + s + scr.addstr(6 + i, 6, line, curses.A_BOLD if i == state["step"] else 0) + scr.refresh() + try: + scr.get_wch() + except curses.error: + pass + scr.timeout(-1) + if state["error"]: + say("Chamesle couldn't be installed", "%s. The details are in /var/log/jiggity.log. Press ENTER to restart." + % state["error"].rstrip(".")) + else: + say("Chamesle needs to restart to continue", "Take out the USB stick when the screen goes dark. After the " + "restart you'll set up your account. Press ENTER to restart.") + subprocess.run(["reboot"]) + + +def run_firstboot(): + zs = account.zones() + names = [z.replace("_", " ").replace("/", " / ") for z in zs] + while True: + z = choose("Let's start with your time zone", "It sets your clock. Type a city to find yours.", names) + if z is not None: + break + if not account.online() and yes("Not connected", "You need the internet for updates. Set up a network now?"): + curses.endwin() + subprocess.run(["nmtui-connect"]) + scr.refresh() + while True: + name = ask("Who's going to use this PC?", "", "Your name:") or "" + user = ask("Who's going to use this PC?", "Lowercase letters and numbers, starting with a letter.", + "Username:", value=account.username_from(name)) + if not user: + continue + bad = account.bad_username(user) + if bad: + say("Who's going to use this PC?", bad) + continue + pw = ask("Who's going to use this PC?", "", "Password:", True) + if not pw: + continue + if ask("Who's going to use this PC?", "Type it again.", "Confirm: ", True) != pw: + say("Who's going to use this PC?", "The passwords don't match.") + continue + break + frame("Just a moment...", "") + scr.refresh() + account.make(zs[z], user, name, pw) + + +def main(s): + global scr + scr = s + curses.use_default_colors() + curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE) + curses.init_pair(2, curses.COLOR_BLACK, curses.COLOR_WHITE) + curses.init_pair(3, curses.COLOR_BLUE, curses.COLOR_WHITE) + curses.init_pair(4, curses.COLOR_BLACK, curses.COLOR_CYAN) + curses.curs_set(0) + scr.keypad(True) + if sys.argv[1:2] == ["install"]: + run_install() + else: + run_firstboot() + + +if __name__ == "__main__": + # what the install prints goes to the log, not over the screen + log = open("/var/log/jiggity.log", "a", buffering=1) + os.dup2(log.fileno(), 2) + sys.stdout = sys.stderr = log + curses.set_escdelay(25) + curses.wrapper(main) diff --git a/overlay/usr/lib/live-installer/installer.py b/overlay/usr/lib/live-installer/installer.py @@ -583,12 +583,16 @@ class InstallerEngine: if(self.setup.grub_device is not None): self.update_progress(80, False, False, _("Installing bootloader")) self.set_grub_option("GRUB_DISTRIBUTOR", "Chamesle") - cmdline = "quiet splash loglevel=3 drm.panic_screen=kmsg" + cmdline = "quiet splash loglevel=3 drm.panic_screen=qr_code" # dinit with the blue screen when the system can't finish starting if os.path.exists("/target/usr/lib/chamesle/init"): cmdline += " init=/usr/lib/chamesle/init" self.set_grub_option("GRUB_CMDLINE_LINUX_DEFAULT", cmdline) self.set_grub_option("GRUB_DISABLE_OS_PROBER", "false") + # our kernel first, void's below it for when ours doesn't start + ours = sorted(glob("/target/boot/vmlinuz-*-cachyos-lts")) + if ours: + self.set_grub_option("GRUB_TOP_LEVEL", ours[-1][len("/target"):]) self.set_grub_option("GRUB_GFXMODE", "auto") self.set_grub_option("GRUB_GFXPAYLOAD_LINUX", "keep") if os.path.exists("/target/usr/share/grub/themes/chamesle/theme.txt"): diff --git a/tools/kernel/arch-kernel.sh b/tools/kernel/arch-kernel.sh @@ -1,143 +0,0 @@ -#!/bin/bash -# our kernel is arch's linux-lts, repacked as apks: chamesle-kernel and chamesle-kernel-headers -# tools/kernel/arch-kernel.sh the newest linux-lts arch has -# why arch's: it shows a blue screen with the log when the kernel crashes (CONFIG_DRM_PANIC, white on 0x0000aa), -# void's kernel has that switched off. it's the same lts series void ships, so out-of-tree drivers (nvidia, -# broadcom-wl through dkms) build the same way. a kernel doesn't care about the libc, nothing gets compiled -# the packages call void's kernel hooks like void's kernel does: initramfs (dracut), dkms and the boot menu -set -euo pipefail -HERE=$(cd "$(dirname "$0")" && pwd) -TOP=$HERE/../.. -APK=${APK:-apk} -REPO=${REPO:-$TOP/work/repo} -CACHE=${CACHE:-$TOP/work/kernel} -KEY=$(ls "$HOME"/.config/chamesle/chamesle-*.rsa | sort | tail -n1) -MIRROR=${MIRROR:-https://geo.mirror.pkgbuild.com/core/os/x86_64} -ARCH=x86_64 -mkdir -p "$CACHE" "$REPO/$ARCH" - -# a big file in 6 pieces at once: one connection is slow on a phone hotspot -fetch() { - local url=$1 out=$2 n size step i s e - [ -f "$out" ] && return - size=$(curl -sIL "$url" | tr -d '\r' | awk 'tolower($1)=="content-length:"{n=$2} END{print n}') - [ -n "$size" ] || { echo "arch-kernel: can't reach $url" >&2; exit 1; } - n=6 step=$(( (size + 5) / 6 )) - for i in $(seq 0 $((n - 1))); do - s=$((i * step)) e=$((i * step + step - 1)); [ $e -lt $size ] || e=$((size - 1)) - ( for try in 1 2 3 4 5 6 7 8; do - curl -fsSL --range $s-$e -o "$out.$i" "$url" && [ "$(stat -c%s "$out.$i")" = $((e - s + 1)) ] && break - sleep 3 - done ) & - done - wait - for i in $(seq 0 $((n - 1))); do cat "$out.$i"; done > "$out.new" - rm -f "$out".[0-9] - [ "$(stat -c%s "$out.new")" = "$size" ] || { echo "arch-kernel: $url came down broken" >&2; exit 1; } - mv "$out.new" "$out" -} - -# signed by an arch packager: the key has to be the one archlinux.org publishes for that address -verify() { - local f=$1 g fpr email - g=$(mktemp -d) - fpr=$(GNUPGHOME=$g gpg --list-packets "$f.sig" 2>/dev/null | sed -n 's/.*issuer fpr v4 \([0-9A-F]*\).*/\1/p' | head -n1) - GNUPGHOME=$g gpg -q --keyserver hkps://keyserver.ubuntu.com --recv-keys "$fpr" 2>/dev/null - email=$(GNUPGHOME=$g gpg --with-colons --list-keys "$fpr" | awk -F: '$1=="uid"{print $10}' | - grep -o '[^<]*@archlinux\.org' | head -n1) - [ -n "$email" ] || { echo "arch-kernel: $f isn't signed by an arch packager" >&2; exit 1; } - rm -rf "$g"; g=$(mktemp -d) - GNUPGHOME=$g gpg -q --auto-key-locate clear,wkd --locate-keys "$email" >/dev/null 2>&1 - GNUPGHOME=$g gpg --with-colons --list-keys "$email" 2>/dev/null | grep -q "^fpr:*$fpr:" || - { echo "arch-kernel: archlinux.org doesn't list $fpr for $email" >&2; exit 1; } - GNUPGHOME=$g gpg -q --verify "$f.sig" "$f" 2>/dev/null || { echo "arch-kernel: bad signature on $f" >&2; exit 1; } - rm -rf "$g" - echo "$(basename "$f"): signed by $email" -} - -for p in linux-lts linux-lts-headers; do - file=$(curl -fsSL "https://archlinux.org/packages/core/$ARCH/$p/json/" | python3 -c 'import json,sys; print(json.load(sys.stdin)["filename"])') - fetch "$MIRROR/$file" "$CACHE/$file" - [ -f "$CACHE/$file.sig" ] || curl -fsSL -o "$CACHE/$file.sig" "$MIRROR/$file.sig" - verify "$CACHE/$file" - eval "${p//-/_}=\$CACHE/\$file" -done - -W=$TOP/work/kernel/build -rm -rf "$W"; mkdir -p "$W/k" "$W/h" "$W/scripts" -bsdtar -xf "$linux_lts" -C "$W/k" -bsdtar -xf "$linux_lts_headers" -C "$W/h" -KV=$(ls "$W/k/usr/lib/modules") # 6.18.58-1-lts -ver=$(echo "$KV" | sed 's/-\([0-9]*\)-lts$/-r\1/') # 6.18.58-r1 -rm -f "$W"/k/.[A-Z]* "$W"/h/.[A-Z]* -# where void's kernels are and the hooks look: /boot/vmlinuz-VERSION, the config next to it -mkdir -p "$W/k/boot" -mv "$W/k/usr/lib/modules/$KV/vmlinuz" "$W/k/boot/vmlinuz-$KV" -cp "$W/h/usr/lib/modules/$KV/build/.config" "$W/k/boot/config-$KV" -rm -f "$W/k/usr/lib/modules/$KV/pkgbase" "$W/h/usr/lib/modules/$KV/build/../pkgbase" -rm -rf "$W/h/usr/src" "$W/h/usr/share/doc" -# modules.dep and friends in the package: an image built without running scripts can still load modules -depmod -b "$W/k/usr" "$KV" 2>/dev/null || depmod -b "$W/k" "$KV" - -hooks() { # hooks TARGET: what void's kernel package runs, for this kernel - echo "( cd / && kernel_hooks_version=$KV /usr/libexec/xbps-triggers/kernel-hooks run $1 chamesle-kernel $KV no )" -} -# the crash screen shows the log on blue, not arch's qr code to their bug site. on the boot line, so it's set -# before anything can crash: systems installed before this kernel get it added to their grub settings here -panic() { - cat <<'P' -g=/etc/default/grub -if [ -f $g ] && ! grep -q 'drm.panic_screen=' $g; then - sed -i 's/^\(GRUB_CMDLINE_LINUX_DEFAULT="[^"]*\)"/\1 drm.panic_screen=kmsg"/' $g -fi -P -} -cat > "$W/scripts/post-install" <<EOF -#!/bin/sh -$(panic) -depmod -a $KV -$(hooks post-install) -exit 0 -EOF -# an upgrade brings a new kernel version: hooks for it, and the old one's initramfs and menu entry go. -# leftovers of a removed version (dkms modules, depmod's files) are all that's in its modules folder then -cat > "$W/scripts/post-upgrade" <<EOF -#!/bin/sh -$(panic) -depmod -a $KV -$(hooks post-install) -for d in /usr/lib/modules/*-lts; do - v=\${d##*/} - [ "\$v" = $KV ] || [ -e "\$d/modules.order" ] && continue - rm -rf "\$d" /boot/initramfs-\$v.img - ( cd / && kernel_hooks_version=\$v /usr/libexec/xbps-triggers/kernel-hooks run post-remove chamesle-kernel \$v no ) -done -exit 0 -EOF -cat > "$W/scripts/pre-deinstall" <<EOF -#!/bin/sh -$(hooks pre-remove) -exit 0 -EOF -cat > "$W/scripts/post-deinstall" <<EOF -#!/bin/sh -rm -f /boot/initramfs-$KV.img -$(hooks post-remove) -exit 0 -EOF - -pack() { # pack NAME DIR DESC DEPENDS SCRIPTS... - local name=$1 dir=$2 desc=$3 deps=$4 info s; shift 4 - info=(--info "name:$name" --info "version:$ver" --info "arch:$ARCH" --info "description:$desc" - --info "url:https://chamesle.org" --info "license:GPL-2.0-only" - --info "maintainer:Chamesle Linux <packages@chamesle.org>" --info "depends:$deps") - for s in "$@"; do info+=(--script "$s:$W/scripts/$s"); done - unshare --map-root-user --map-auto "$APK" mkpkg --files "$dir" --output "$REPO/$ARCH/$name-$ver.apk" \ - --sign-key "$KEY" "${info[@]}" - echo "built $REPO/$ARCH/$name-$ver.apk" -} -chmod 755 "$W"/scripts/* -# headers first in the depends: dkms builds drivers in the kernel's post-install, against them -pack chamesle-kernel-headers "$W/h" "Headers to build drivers for the Chamesle kernel" "pahole make" -pack chamesle-kernel "$W/k" "The Chamesle kernel: Linux $KV, with a blue screen and the log on a crash" \ - "chamesle-kernel-headers=$ver kmod dracut linux-firmware" post-install post-upgrade pre-deinstall post-deinstall diff --git a/tools/kernel/kernel.sh b/tools/kernel/kernel.sh @@ -0,0 +1,161 @@ +#!/bin/bash +# our kernel is cachyos's linux-cachyos-lts, repacked as apks: chamesle-kernel-cachyos and chamesle-kernel-cachyos-headers +# tools/kernel/kernel.sh the newest linux-cachyos-lts cachyos has +# why cachyos's: tuned for desktops (full preemption, 1000 Hz, sched_ext), built for any x86-64 cpu, and on a crash +# a blue screen with a qr code that phone cameras open as a readable report. the same lts series void ships, so +# out-of-tree drivers (nvidia, broadcom-wl through dkms) build the same way. a kernel doesn't care about the libc +# the packages call void's kernel hooks like void's kernel does: initramfs (dracut), dkms and the boot menu. +# void's own kernel stays installed below it in the boot menu, for when this one doesn't start +set -euo pipefail +HERE=$(cd "$(dirname "$0")" && pwd) +TOP=$HERE/../.. +APK=${APK:-apk} +REPO=${REPO:-$TOP/work/repo} +CACHE=${CACHE:-$TOP/work/kernel} +KEY=$(ls "$HOME"/.config/chamesle/chamesle-*.rsa | sort | tail -n1) +MIRROR=${MIRROR:-https://mirror.cachyos.org/repo/x86_64/cachyos} +# the cachyos packaging key, as their cachyos-keyring lists it trusted +FPR=882DCFE48E2051D48E2562ABF3B607488DB35A47 +ARCH=x86_64 +mkdir -p "$CACHE" "$REPO/$ARCH" + +# a big file in 6 pieces at once: one connection is slow on a phone hotspot +fetch() { + local url=$1 out=$2 n size step i s e + [ -f "$out" ] && return + size=$(curl -sIL "$url" | tr -d '\r' | awk 'tolower($1)=="content-length:"{n=$2} END{print n}') + [ -n "$size" ] || { echo "kernel: can't reach $url" >&2; exit 1; } + n=6 step=$(( (size + 5) / 6 )) + for i in $(seq 0 $((n - 1))); do + s=$((i * step)) e=$((i * step + step - 1)); [ $e -lt $size ] || e=$((size - 1)) + ( for try in 1 2 3 4 5 6 7 8; do + curl -fsSL --range $s-$e -o "$out.$i" "$url" && [ "$(stat -c%s "$out.$i")" = $((e - s + 1)) ] && break + sleep 3 + done ) & + done + wait + for i in $(seq 0 $((n - 1))); do cat "$out.$i"; done > "$out.new" + rm -f "$out".[0-9] + [ "$(stat -c%s "$out.new")" = "$size" ] || { echo "kernel: $url came down broken" >&2; exit 1; } + mv "$out.new" "$out" +} + +verify() { + local f=$1 g + g=$(mktemp -d) + GNUPGHOME=$g gpg -q --keyserver hkps://keyserver.ubuntu.com --recv-keys $FPR 2>/dev/null + GNUPGHOME=$g gpg --status-fd 1 --verify "$f.sig" "$f" 2>/dev/null | grep -q "^\[GNUPG:\] VALIDSIG $FPR " || + { rm -rf "$g"; echo "kernel: $f isn't signed by cachyos" >&2; exit 1; } + rm -rf "$g" + echo "$(basename "$f"): signed by cachyos" +} + +curl -fsSL -o "$CACHE/cachyos.db" "$MIRROR/cachyos.db" +DB=$CACHE/db; rm -rf "$DB"; mkdir -p "$DB"; bsdtar -xf "$CACHE/cachyos.db" -C "$DB" +for p in linux-cachyos-lts linux-cachyos-lts-headers; do + d=$(ls -d "$DB/$p"-[0-9]* | sort -V | tail -n1) + file=$(sed -n '/^%FILENAME%$/{n;p}' "$d/desc") + fetch "$MIRROR/$file" "$CACHE/$file" + [ -f "$CACHE/$file.sig" ] || curl -fsSL -o "$CACHE/$file.sig" "$MIRROR/$file.sig" + verify "$CACHE/$file" + eval "${p//-/_}=\$CACHE/\$file" +done + +W=$TOP/work/kernel/build +rm -rf "$W"; mkdir -p "$W/k" "$W/h" "$W/e" "$W/scripts" +bsdtar -xf "$linux_cachyos_lts" -C "$W/k" +bsdtar -xf "$linux_cachyos_lts_headers" -C "$W/h" +KV=$(ls "$W/k/usr/lib/modules") # 6.18.50-1-cachyos-lts +ver=$(echo "$KV" | sed 's/-\([0-9]*\)-cachyos-lts$/-r\1/') # 6.18.50-r1 +rm -f "$W"/k/.[A-Z]* "$W"/h/.[A-Z]* +# where void's kernels are and the hooks look: /boot/vmlinuz-VERSION, the config next to it +mkdir -p "$W/k/boot" +mv "$W/k/usr/lib/modules/$KV/vmlinuz" "$W/k/boot/vmlinuz-$KV" +cp "$W/h/usr/lib/modules/$KV/build/.config" "$W/k/boot/config-$KV" +rm -f "$W/k/usr/lib/modules/$KV/pkgbase" "$W/h/usr/lib/modules/$KV/build/../pkgbase" +rm -rf "$W/h/usr/src" "$W/h/usr/share/doc" +# modules.dep and friends in the package: an image built without running scripts can still load modules +depmod -b "$W/k/usr" "$KV" 2>/dev/null || depmod -b "$W/k" "$KV" + +hooks() { # hooks TARGET [VERSION]: what void's kernel package runs, for this kernel + echo "( cd / && kernel_hooks_version=${2:-$KV} /usr/libexec/xbps-triggers/kernel-hooks run $1 chamesle-kernel ${2:-$KV} no )" +} +# boot line and boot menu, before the hooks write the menu: the crash screen is the qr code, and this kernel +# is the first entry even when void's kernel has a higher version +grubsettings() { + cat <<P +g=/etc/default/grub +if [ -f \$g ]; then + sed -i 's/drm\.panic_screen=kmsg/drm.panic_screen=qr_code/' \$g + grep -q 'drm.panic_screen=' \$g || sed -i 's/^\(GRUB_CMDLINE_LINUX_DEFAULT="[^"]*\)"/\1 drm.panic_screen=qr_code"/' \$g + sed -i '/^GRUB_TOP_LEVEL=/d' \$g + echo 'GRUB_TOP_LEVEL=/boot/vmlinuz-$KV' >> \$g +fi +P +} +# a removed version leaves modules (dkms, depmod's files) and its initramfs behind, without its vmlinuz: +# those go, and its menu entry with them +cleanup() { + cat <<'P' +for f in /usr/lib/modules/*-lts /boot/initramfs-*-lts.img; do + [ -e "$f" ] || continue + v=${f##*/}; v=${v#initramfs-}; v=${v%.img} + [ -e "/boot/vmlinuz-$v" ] && continue + rm -rf "/usr/lib/modules/$v" "/boot/initramfs-$v.img" + ( cd / && kernel_hooks_version=$v /usr/libexec/xbps-triggers/kernel-hooks run post-remove chamesle-kernel $v no ) +done +P +} +cat > "$W/scripts/post-install" <<EOF +#!/bin/sh +$(grubsettings) +depmod -a $KV +$(hooks post-install) +exit 0 +EOF +cat > "$W/scripts/post-upgrade" <<EOF +#!/bin/sh +$(grubsettings) +depmod -a $KV +$(hooks post-install) +$(cleanup) +exit 0 +EOF +cat > "$W/scripts/pre-deinstall" <<EOF +#!/bin/sh +sed -i '/^GRUB_TOP_LEVEL=/d' /etc/default/grub 2>/dev/null +$(hooks pre-remove) +exit 0 +EOF +cat > "$W/scripts/post-deinstall" <<EOF +#!/bin/sh +rm -f /boot/initramfs-$KV.img +$(hooks post-remove) +exit 0 +EOF +# chamesle-kernel was arch's linux-lts up to 0.5: now empty, it brings the cachyos one and clears arch's away +cat > "$W/scripts/moved" <<EOF +#!/bin/sh +$(cleanup) +exit 0 +EOF + +pack() { # pack NAME VERSION DIR DESC DEPENDS SCRIPTS... + local name=$1 v=$2 dir=$3 desc=$4 deps=$5 info s; shift 5 + info=(--info "name:$name" --info "version:$v" --info "arch:$ARCH" --info "description:$desc" + --info "url:https://chamesle.org" --info "license:GPL-2.0-only" + --info "maintainer:Chamesle Linux <packages@chamesle.org>" --info "depends:$deps") + for s in "$@"; do info+=(--script "${s%%=*}:$W/scripts/${s#*=}"); done + unshare --map-root-user --map-auto "$APK" mkpkg --files "$dir" --output "$REPO/$ARCH/$name-$v.apk" \ + --sign-key "$KEY" "${info[@]}" + echo "built $REPO/$ARCH/$name-$v.apk" +} +chmod 755 "$W"/scripts/* +# headers first in the depends: dkms builds drivers in the kernel's post-install, against them +pack chamesle-kernel-cachyos-headers $ver "$W/h" "Headers to build drivers for the Chamesle kernel" "pahole make" +pack chamesle-kernel-cachyos $ver "$W/k" "The Chamesle kernel: CachyOS's Linux $KV, with a blue screen and a qr code on a crash" \ + "chamesle-kernel-cachyos-headers=$ver kmod dracut linux-firmware" \ + post-install=post-install post-upgrade=post-upgrade pre-deinstall=pre-deinstall post-deinstall=post-deinstall +# above arch's last one, 6.18.58-r1, so upgrades take it +pack chamesle-kernel-headers 6.18.58-r2 "$W/e" "Moved to chamesle-kernel-cachyos-headers" "chamesle-kernel-cachyos-headers" +pack chamesle-kernel 6.18.58-r2 "$W/e" "Moved to chamesle-kernel-cachyos" "chamesle-kernel-cachyos" post-upgrade=moved diff --git a/tools/pkg/chamesle-base/recipe b/tools/pkg/chamesle-base/recipe @@ -1,6 +1,6 @@ name=chamesle-base version=0.5.0 -rel=0 +rel=1 desc="Chamesle system setup: sound, kernel modules at boot, a few small touches" url=https://chamesle.org license=GPL-3.0-or-later @@ -9,10 +9,10 @@ makedeps="" # ncurses-term: the terminal descriptions htop, nano and friends need (xterm-256color, tmux, kitty...) # pipewire: started at login by the links in files/, with wireplumber and the pulseaudio server # chamesle-snapshots: a snapshot before every update, on btrfs installs (nothing happens on older ext4 ones) -# chamesle-kernel: the blue crash screen with the log. void's kernel stays next to it, in the boot menu's advanced options +# chamesle-kernel-cachyos: cachyos's desktop-tuned lts, with the blue crash screen and its qr code. void's kernel stays next to it, in the boot menu's advanced options # chamesle-plymouth: the boot screen, and the blue screen when the system can't finish starting # chamesle-grub: the boot menu. ncurses: clear, reset and tput -depends="kmod sudo fastfetch ncurses ncurses-term pipewire wireplumber chamesle-snapshots chamesle-kernel chamesle-plymouth chamesle-grub" +depends="kmod sudo fastfetch ncurses ncurses-term pipewire wireplumber chamesle-snapshots chamesle-kernel-cachyos chamesle-plymouth chamesle-grub" build() { cp -a . "$pkgdir/" diff --git a/tools/pkg/chamesle-play/files/etc/profile.d/play.sh b/tools/pkg/chamesle-play/files/etc/profile.d/play.sh @@ -0,0 +1,5 @@ +# play's settings come before the kde edition's in /etc/xdg +case ":$XDG_CONFIG_DIRS:" in +*:/etc/xdg/play:*) ;; +*) export XDG_CONFIG_DIRS="/etc/xdg/play:${XDG_CONFIG_DIRS:-/etc/xdg}" ;; +esac diff --git a/tools/pkg/chamesle-play/files/etc/sddm.conf.d/20-play.conf b/tools/pkg/chamesle-play/files/etc/sddm.conf.d/20-play.conf @@ -0,0 +1,2 @@ +[Theme] +Current=chamesle-play diff --git a/tools/pkg/chamesle-play/files/etc/xdg/play/kdeglobals b/tools/pkg/chamesle-play/files/etc/xdg/play/kdeglobals @@ -0,0 +1,2 @@ +[KDE] +LookAndFeelPackage=org.chamesle.play.desktop diff --git a/tools/pkg/chamesle-play/files/etc/xdg/play/kscreenlockerrc b/tools/pkg/chamesle-play/files/etc/xdg/play/kscreenlockerrc @@ -0,0 +1,2 @@ +[Greeter][Wallpaper][org.kde.image][General] +Image=/usr/share/wallpapers/Play/contents/images/3840x2160.jpg diff --git a/tools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/contents/defaults b/tools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/contents/defaults @@ -0,0 +1,14 @@ +[kdeglobals][General] +ColorScheme=BreezeLight + +[kdeglobals][Icons] +Theme=breeze + +[kdeglobals][KDE] +widgetStyle=Breeze + +[plasmarc][Theme] +name=breeze-dark + +[Wallpaper] +Image=Play diff --git a/tools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/contents/layouts/org.kde.plasma.desktop-layout.js b/tools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/contents/layouts/org.kde.plasma.desktop-layout.js @@ -0,0 +1,32 @@ +// play: the chamesle taskbar, with steam pinned next to the files and the browser +var panel = new Panel +panel.location = "bottom" +panel.height = 2 * Math.ceil(gridUnit * 2.4 / 2) +panel.floating = true + +var kickoff = panel.addWidget("org.kde.plasma.kickoff") +kickoff.currentConfigGroup = ["General"] +kickoff.writeConfig("icon", "chamesle-start") + +var tasks = panel.addWidget("org.kde.plasma.icontasks") +tasks.currentConfigGroup = ["General"] +tasks.writeConfig("launchers", ["applications:org.kde.dolphin.desktop", "applications:firefox.desktop", "applications:com.valvesoftware.Steam.desktop", + "applications:org.chamesle.Store.desktop", "applications:org.kde.konsole.desktop"]) + +panel.addWidget("org.kde.plasma.marginsseparator") +panel.addWidget("org.kde.plasma.systemtray") + +// 24-hour time with the date under it: 13:45 and 24 Oct 2026 +var clock = panel.addWidget("org.kde.plasma.digitalclock") +clock.currentConfigGroup = ["Appearance"] +clock.writeConfig("use24hFormat", 2) +clock.writeConfig("dateFormat", "custom") +clock.writeConfig("customDateFormat", "d MMM yyyy") + + +var desktop = desktopsForActivity(currentActivity())[0] +if (desktop) { + desktop.wallpaperPlugin = "org.kde.image" + desktop.currentConfigGroup = ["Wallpaper", "org.kde.image", "General"] + desktop.writeConfig("Image", "file:///usr/share/wallpapers/Play/contents/images/3840x2160.jpg") +} diff --git a/tools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/metadata.json b/tools/pkg/chamesle-play/files/usr/share/plasma/look-and-feel/org.chamesle.play.desktop/metadata.json @@ -0,0 +1,14 @@ +{ + "KPackageStructure": "Plasma/LookAndFeel", + "KPlugin": { + "Authors": [{ "Name": "Chamesle Linux" }], + "Description": "The Chamesle taskbar with Steam on it, and the Lofoten aurora", + "Id": "org.chamesle.play.desktop", + "License": "GPL-3.0-or-later", + "Name": "Play", + "Version": "0.6.0", + "Website": "https://chamesle.org" + }, + "X-Plasma-MainScript": "defaults", + "X-Plasma-Inherit": "org.chamesle.desktop" +} diff --git a/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/Main.qml b/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/Main.qml @@ -0,0 +1 @@ +../chamesle/Main.qml +\ No newline at end of file diff --git a/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/assets b/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/assets @@ -0,0 +1 @@ +../chamesle/assets +\ No newline at end of file diff --git a/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/aurora-blur.jpg b/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/aurora-blur.jpg Binary files differ. diff --git a/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/metadata.desktop b/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/metadata.desktop @@ -0,0 +1 @@ +../chamesle/metadata.desktop +\ No newline at end of file diff --git a/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/theme.conf b/tools/pkg/chamesle-play/files/usr/share/sddm/themes/chamesle-play/theme.conf @@ -0,0 +1,6 @@ +# the chamesle sign-in screen with play's aurora +[General] +background=/usr/share/wallpapers/Play/contents/images/3840x2160.jpg +backgroundBlur=aurora-blur.jpg +font=Inter +clock=24 diff --git a/tools/pkg/chamesle-play/files/usr/share/wallpapers/Play/contents/images/3840x2160.jpg b/tools/pkg/chamesle-play/files/usr/share/wallpapers/Play/contents/images/3840x2160.jpg Binary files differ. diff --git a/tools/pkg/chamesle-play/files/usr/share/wallpapers/Play/contents/screenshot.jpg b/tools/pkg/chamesle-play/files/usr/share/wallpapers/Play/contents/screenshot.jpg Binary files differ. diff --git a/tools/pkg/chamesle-play/files/usr/share/wallpapers/Play/metadata.json b/tools/pkg/chamesle-play/files/usr/share/wallpapers/Play/metadata.json @@ -0,0 +1,9 @@ +{ + "KPlugin": { + "Authors": [{ "Name": "Johannes Groll" }], + "Description": "The northern lights over Lofoten, Norway", + "Id": "Play", + "License": "CC0-1.0", + "Name": "Lofoten aurora" + } +} diff --git a/tools/pkg/chamesle-play/recipe b/tools/pkg/chamesle-play/recipe @@ -0,0 +1,13 @@ +name=chamesle-play +version=0.6.0 +rel=0 +desc="Chamesle Play: KDE Plasma for games, with Steam on the taskbar, GameMode, controllers and the Lofoten aurora" +url=https://chamesle.org +license=GPL-3.0-or-later +source= +makedeps="" +depends="chamesle-kde chamesle-sddm gamemode steam-udev-rules" + +build() { + cp -a . "$pkgdir/" +} diff --git a/tools/pkg/chamesle-ranni/files/etc/profile.d/ranni.sh b/tools/pkg/chamesle-ranni/files/etc/profile.d/ranni.sh @@ -0,0 +1,6 @@ +# ranni's settings come before the kde edition's in /etc/xdg. gtk apps put their menus in the menu bar too +case ":$XDG_CONFIG_DIRS:" in +*:/etc/xdg/ranni:*) ;; +*) export XDG_CONFIG_DIRS="/etc/xdg/ranni:${XDG_CONFIG_DIRS:-/etc/xdg}" ;; +esac +export GTK_MODULES="${GTK_MODULES:+$GTK_MODULES:}appmenu-gtk-module" diff --git a/tools/pkg/chamesle-ranni/files/etc/sddm.conf.d/20-ranni.conf b/tools/pkg/chamesle-ranni/files/etc/sddm.conf.d/20-ranni.conf @@ -0,0 +1,2 @@ +[Theme] +Current=chamesle-ranni diff --git a/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kdeglobals b/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kdeglobals @@ -0,0 +1,2 @@ +[KDE] +LookAndFeelPackage=org.chamesle.ranni.desktop diff --git a/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kglobalshortcutsrc b/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kglobalshortcutsrc @@ -0,0 +1,2 @@ +[services][org.kde.krunner.desktop] +_launch=Meta+Space Alt+Space Alt+F2 Search diff --git a/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kscreenlockerrc b/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kscreenlockerrc @@ -0,0 +1,2 @@ +[Greeter][Wallpaper][org.kde.image][General] +Image=/usr/share/wallpapers/Ranni/contents/images/3840x2160.jpg diff --git a/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kwinrc b/tools/pkg/chamesle-ranni/files/etc/xdg/ranni/kwinrc @@ -0,0 +1,3 @@ +[org.kde.kdecoration2] +ButtonsOnLeft=XIA +ButtonsOnRight= diff --git a/tools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/contents/defaults b/tools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/contents/defaults @@ -0,0 +1,14 @@ +[kdeglobals][General] +ColorScheme=BreezeLight + +[kdeglobals][Icons] +Theme=breeze + +[kdeglobals][KDE] +widgetStyle=Breeze + +[plasmarc][Theme] +name=default + +[Wallpaper] +Image=Ranni diff --git a/tools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/contents/layouts/org.kde.plasma.desktop-layout.js b/tools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/contents/layouts/org.kde.plasma.desktop-layout.js @@ -0,0 +1,43 @@ +// ranni: a menu bar on top with the app's menus, a dock at the bottom +var bar = new Panel +bar.location = "top" +bar.height = 2 * Math.ceil(gridUnit * 1.6 / 2) + +var kickoff = bar.addWidget("org.kde.plasma.kickoff") +kickoff.currentConfigGroup = ["General"] +kickoff.writeConfig("icon", "chamesle-start") + +bar.addWidget("org.kde.plasma.appmenu") +bar.addWidget("org.kde.plasma.panelspacer") +bar.addWidget("org.kde.plasma.systemtray") + +// Sun 25 Oct 13:45 +var clock = bar.addWidget("org.kde.plasma.digitalclock") +clock.currentConfigGroup = ["Appearance"] +clock.writeConfig("use24hFormat", 2) +clock.writeConfig("showDate", true) +clock.writeConfig("dateDisplayFormat", "BesideTime") +clock.writeConfig("dateFormat", "custom") +clock.writeConfig("customDateFormat", "ddd d MMM") + +var dock = new Panel +dock.location = "bottom" +dock.height = 2 * Math.ceil(gridUnit * 3.2 / 2) +dock.floating = true +dock.lengthMode = "fit" +dock.alignment = "center" +dock.hiding = "dodgewindows" + +var tasks = dock.addWidget("org.kde.plasma.icontasks") +tasks.currentConfigGroup = ["General"] +tasks.writeConfig("launchers", ["applications:org.kde.dolphin.desktop", "applications:firefox.desktop", + "applications:org.chamesle.Store.desktop", "applications:org.kde.konsole.desktop", + "applications:systemsettings.desktop"]) +tasks.writeConfig("iconSpacing", 2) + +var desktop = desktopsForActivity(currentActivity())[0] +if (desktop) { + desktop.wallpaperPlugin = "org.kde.image" + desktop.currentConfigGroup = ["Wallpaper", "org.kde.image", "General"] + desktop.writeConfig("Image", "file:///usr/share/wallpapers/Ranni/contents/images/3840x2160.jpg") +} diff --git a/tools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/metadata.json b/tools/pkg/chamesle-ranni/files/usr/share/plasma/look-and-feel/org.chamesle.ranni.desktop/metadata.json @@ -0,0 +1,14 @@ +{ + "KPackageStructure": "Plasma/LookAndFeel", + "KPlugin": { + "Authors": [{ "Name": "Chamesle Linux" }], + "Description": "A menu bar on top, a dock at the bottom and the Mongolian dunes", + "Id": "org.chamesle.ranni.desktop", + "License": "GPL-3.0-or-later", + "Name": "Ranni", + "Version": "0.6.0", + "Website": "https://chamesle.org" + }, + "X-Plasma-MainScript": "defaults", + "X-Plasma-Inherit": "org.chamesle.desktop" +} diff --git a/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/Main.qml b/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/Main.qml @@ -0,0 +1 @@ +../chamesle/Main.qml +\ No newline at end of file diff --git a/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/assets b/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/assets @@ -0,0 +1 @@ +../chamesle/assets +\ No newline at end of file diff --git a/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/dunes-blur.jpg b/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/dunes-blur.jpg Binary files differ. diff --git a/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/metadata.desktop b/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/metadata.desktop @@ -0,0 +1 @@ +../chamesle/metadata.desktop +\ No newline at end of file diff --git a/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/theme.conf b/tools/pkg/chamesle-ranni/files/usr/share/sddm/themes/chamesle-ranni/theme.conf @@ -0,0 +1,6 @@ +# the chamesle sign-in screen with ranni's dunes +[General] +background=/usr/share/wallpapers/Ranni/contents/images/3840x2160.jpg +backgroundBlur=dunes-blur.jpg +font=Inter +clock=24 diff --git a/tools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/contents/images/3840x2160.jpg b/tools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/contents/images/3840x2160.jpg Binary files differ. diff --git a/tools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/contents/screenshot.jpg b/tools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/contents/screenshot.jpg Binary files differ. diff --git a/tools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/metadata.json b/tools/pkg/chamesle-ranni/files/usr/share/wallpapers/Ranni/metadata.json @@ -0,0 +1,9 @@ +{ + "KPlugin": { + "Authors": [{ "Name": "Bernard Gagnon" }], + "Description": "Khongoryn Els, the singing dunes of the Gobi", + "Id": "Ranni", + "License": "CC0-1.0", + "Name": "Mongolian dunes" + } +} diff --git a/tools/pkg/chamesle-ranni/recipe b/tools/pkg/chamesle-ranni/recipe @@ -0,0 +1,13 @@ +name=chamesle-ranni +version=0.6.0 +rel=0 +desc="Chamesle Ranni: KDE Plasma like a Mac, with a menu bar, a dock, search on Super+Space and the Mongolian dunes" +url=https://chamesle.org +license=GPL-3.0-or-later +source= +makedeps="" +depends="chamesle-kde chamesle-sddm appmenu-gtk3-module" + +build() { + cp -a . "$pkgdir/" +} diff --git a/tools/pkg/chamesle-snapshots/files/usr/bin/chamesle-snapshot b/tools/pkg/chamesle-snapshots/files/usr/bin/chamesle-snapshot @@ -65,7 +65,8 @@ take() { [ -z "$(started_from)" ] || { echo "chamesle-snapshot: started from a snapshot, not taking another one" >&2; exit 0; } local k id # the kernel the system boots now, which the snapshot has the modules for - k=$(ls /boot/vmlinuz-* 2>/dev/null | sed 's#.*/vmlinuz-##' | sort -V | tail -n1) + k=$(ls /boot/vmlinuz-*-cachyos-lts 2>/dev/null | sed 's#.*/vmlinuz-##' | sort -V | tail -n1) + [ -n "$k" ] || k=$(ls /boot/vmlinuz-* 2>/dev/null | sed 's#.*/vmlinuz-##' | sort -V | tail -n1) [ -n "$k" ] && [ -f /boot/initramfs-$k.img ] || die "no kernel and initramfs in /boot" mount_top id=$(date +%Y%m%d-%H%M%S) diff --git a/tools/pkg/chamesle-snapshots/recipe b/tools/pkg/chamesle-snapshots/recipe @@ -1,6 +1,6 @@ name=chamesle-snapshots version=0.4.0 -rel=1 +rel=2 desc="A snapshot of the system before every update, bootable from the boot menu" url=https://chamesle.org license=GPL-3.0-or-later