mirror of
https://github.com/blazblue547-afk/aero3.git
synced 2026-12-02 14:24:17 -05:00
Initial AeroOS source
This commit is contained in:
commit
b27732ad89
42 files changed
+3775
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
# Build artifacts
|
||||
/build/
|
||||
/sources/
|
||||
/out/
|
||||
/logs/
|
||||
.agents/
|
||||
.codex/
|
||||
.git-upload/
|
||||
*.iso
|
||||
*.img
|
||||
*.tar.*
|
||||
*.log
|
||||
|
||||
# compositor build
|
||||
desktop/aerowm/build/
|
||||
desktop/aero-session/build/
|
||||
*.o
|
||||
*.so
|
||||
|
||||
# editor
|
||||
.vscode/
|
||||
*.swp
|
||||
@@ -0,0 +1,26 @@
|
||||
AeroOS build system
|
||||
Copyright (c) 2026 AeroOS contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
NOTE: The AeroOS build system (these scripts) is MIT-licensed. The software it
|
||||
compiles (Linux kernel, glibc, GCC, systemd, wlroots, etc.) is distributed
|
||||
under each project's own license (GPL-2.0, LGPL, MIT, etc.). The produced
|
||||
images therefore aggregate software under multiple licenses; consult each
|
||||
upstream project for redistribution terms.
|
||||
@@ -0,0 +1,106 @@
|
||||
# AeroOS
|
||||
|
||||
A **from-scratch** 64-bit (x86-64 / amd64) Linux operating system for desktops and
|
||||
laptops. AeroOS is **not** based on any existing Linux distribution — it is built
|
||||
from upstream source tarballs using the [Linux From Scratch](https://www.linuxfromscratch.org/)
|
||||
methodology (cross-toolchain → temporary tools → chroot → final system → kernel →
|
||||
bootable image).
|
||||
|
||||
It ships a custom Wayland desktop with:
|
||||
|
||||
- **Frutiger Aero** default wallpaper (glossy glass, water, nature, lens-flare era aesthetic)
|
||||
- **Glassmorphism UI** — a custom `wlroots`-based compositor (`aerowm`) with real
|
||||
Gaussian background blur + translucency, plus a glassmorphic GTK theme.
|
||||
- **Subtle lofi** that plays automatically on the home screen / login.
|
||||
|
||||
## Core stack
|
||||
|
||||
| Layer | Choice |
|
||||
|------------------|-------------------------------------------|
|
||||
| Architecture | x86-64 (amd64), 64-bit |
|
||||
| Kernel | Linux 7.1 (latest stable) |
|
||||
| C library | glibc |
|
||||
| Toolchain | GCC + Binutils (cross-compiled) |
|
||||
| Init / services | systemd |
|
||||
| Bootloader | GRUB 2 (UEFI + BIOS) |
|
||||
| Display server | Wayland |
|
||||
| Compositor | `aerowm` (custom, wlroots-based, w/ blur) |
|
||||
| Audio | PipeWire |
|
||||
| Toolkit / theme | GTK 4 + custom glassmorphism CSS |
|
||||
|
||||
## Quick start
|
||||
|
||||
> ⚠️ This performs a **full source build**. It needs a Linux host (Debian/Fedora/Arch/
|
||||
> WSL2 all fine), ~30–60 GB free disk, and **several hours** of CPU time. It does
|
||||
> **not** modify your host system outside `$AEROS_ROOT` (default `./build`).
|
||||
|
||||
```bash
|
||||
# 1. Read & adjust configuration (versions, parallelism, target disk size)
|
||||
$EDITOR config/aeros.conf
|
||||
|
||||
# 2. Check host has the required tools
|
||||
./build.sh check
|
||||
|
||||
# 3. Download all upstream sources (verifies sizes)
|
||||
./build.sh fetch
|
||||
|
||||
# 4. Run the full build (or run individual stages, see below)
|
||||
./build.sh all
|
||||
|
||||
# 5. Result: a bootable hybrid ISO
|
||||
ls -lh out/aeros-*.iso
|
||||
```
|
||||
|
||||
Test it without touching real hardware:
|
||||
|
||||
```bash
|
||||
./build.sh run-qemu # boots out/aeros-*.iso in QEMU with UEFI
|
||||
```
|
||||
|
||||
## Build stages
|
||||
|
||||
Each stage is idempotent and can be run on its own: `./build.sh stage 04`
|
||||
|
||||
| Stage | Script | What it does |
|
||||
|-------|---------------------------------|-----------------------------------------------------|
|
||||
| 00 | `scripts/00-prepare.sh` | Host sanity checks, dir layout, fetch sources |
|
||||
| 01 | `scripts/01-toolchain.sh` | Cross binutils/gcc/glibc/libstdc++ (LFS ch. 5) |
|
||||
| 02 | `scripts/02-temp-tools.sh` | Temporary tools in the new root (LFS ch. 6) |
|
||||
| 03 | `scripts/03-chroot-base.sh` | Final base system inside chroot (LFS ch. 7–8) |
|
||||
| 04 | `scripts/04-kernel.sh` | Configure + build Linux 7.1 |
|
||||
| 05 | `scripts/05-systemd-boot.sh` | systemd setup, GRUB, fstab, users |
|
||||
| 06 | `scripts/06-desktop.sh` | Wayland, wlroots, PipeWire, GTK4, `aerowm` |
|
||||
| 07 | `scripts/07-aero-theme.sh` | Frutiger Aero wallpaper, lofi service, glass theme |
|
||||
| 08 | `scripts/08-image.sh` | squashfs + initramfs + GRUB → hybrid bootable ISO |
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
aero3/
|
||||
├── build.sh # orchestrator (check|fetch|stage NN|all|run-qemu|clean)
|
||||
├── config/
|
||||
│ ├── aeros.conf # build knobs (root dir, jobs, target, hostname…)
|
||||
│ ├── versions.sh # pinned upstream versions + URLs + sha256
|
||||
│ └── kernel/aeros.config # Linux .config fragment/defaults
|
||||
├── scripts/ # the 9 ordered build stages + lib/common.sh
|
||||
├── packages/recipes/ # declarative per-package build recipes
|
||||
├── desktop/
|
||||
│ ├── aerowm/ # custom wlroots compositor (C) with blur
|
||||
│ ├── aero-session/ # session + autostart (lofi, wallpaper)
|
||||
│ └── aero-lofi/ # lofi playback service
|
||||
├── assets/
|
||||
│ ├── wallpaper/ # Frutiger Aero wallpaper (SVG → PNG)
|
||||
│ ├── lofi/ # generated subtle lofi loop
|
||||
│ └── theme/ # glassmorphism GTK4 CSS + GTK theme
|
||||
└── out/ # build artifacts (ISO) — gitignored
|
||||
```
|
||||
|
||||
## Legal / honesty note
|
||||
|
||||
- "From scratch" means no distro base (no Debian/Arch/etc. rootfs). It still
|
||||
compiles **upstream open-source projects** (the kernel, glibc, GCC, wlroots…),
|
||||
which is exactly what LFS does — you cannot hand-write a kernel.
|
||||
- A complete first build takes hours and will surface package-specific issues that
|
||||
need iteration; this repo is the real, runnable build system, not a magic button.
|
||||
|
||||
See `docs/` for the design of the glassmorphism compositor and the Aero theme.
|
||||
@@ -0,0 +1,37 @@
|
||||
set default=0
|
||||
set timeout=8
|
||||
|
||||
insmod iso9660
|
||||
insmod search
|
||||
insmod search_label
|
||||
insmod linux
|
||||
terminal_output console
|
||||
set gfxpayload=text
|
||||
|
||||
menuentry "AeroOS @@VERSION@@ (Live)" {
|
||||
search --no-floppy --set=root --label @@ISO_LABEL@@
|
||||
echo "Loading AeroOS kernel..."
|
||||
linux /boot/vmlinuz-aeros root=live:LABEL=@@ISO_LABEL@@ rd.live.image console=tty0 loglevel=7
|
||||
echo "Loading AeroOS initramfs..."
|
||||
initrd /boot/initrd-aeros.img
|
||||
echo "Booting AeroOS..."
|
||||
boot
|
||||
}
|
||||
menuentry "AeroOS @@VERSION@@ (Live, safe graphics / software render)" {
|
||||
search --no-floppy --set=root --label @@ISO_LABEL@@
|
||||
echo "Loading AeroOS kernel..."
|
||||
linux /boot/vmlinuz-aeros root=live:LABEL=@@ISO_LABEL@@ rd.live.image nomodeset console=tty0 loglevel=7
|
||||
echo "Loading AeroOS initramfs..."
|
||||
initrd /boot/initrd-aeros.img
|
||||
echo "Booting AeroOS..."
|
||||
boot
|
||||
}
|
||||
menuentry "AeroOS @@VERSION@@ (verbose / debug)" {
|
||||
search --no-floppy --set=root --label @@ISO_LABEL@@
|
||||
echo "Loading AeroOS kernel..."
|
||||
linux /boot/vmlinuz-aeros root=live:LABEL=@@ISO_LABEL@@ rd.live.image debug console=tty0 console=ttyS0,115200n8 loglevel=7 ignore_loglevel initcall_debug
|
||||
echo "Loading AeroOS initramfs..."
|
||||
initrd /boot/initrd-aeros.img
|
||||
echo "Booting AeroOS..."
|
||||
boot
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
# AeroOS live initramfs init.
|
||||
# Built-in kernel support is assumed for: iso9660, squashfs, overlay, loop.
|
||||
# Finds the live medium, mounts the squashfs read-only, layers a tmpfs via
|
||||
# overlayfs, then switches root into the real AeroOS system (systemd).
|
||||
/bin/busybox --install -s /bin 2>/dev/null
|
||||
[ -c /dev/console ] && exec </dev/console >/dev/console 2>&1
|
||||
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
mount -t devtmpfs devtmpfs /dev 2>/dev/null
|
||||
|
||||
LABEL="@@ISO_LABEL@@"
|
||||
SQUASH="/run/iso/LiveOS/aeros.squashfs"
|
||||
|
||||
echo "AeroOS: locating live medium (label $LABEL)..."
|
||||
mkdir -p /run/iso /run/sqfs /run/overlay /sysroot
|
||||
|
||||
# wait for the CD/USB to appear, then mount by label
|
||||
dev=""
|
||||
for try in $(seq 1 30); do
|
||||
for d in /dev/sr0 /dev/sr1 $(ls /dev/sd? /dev/sd?? /dev/vd? 2>/dev/null); do
|
||||
[ -b "$d" ] || continue
|
||||
if blkid "$d" 2>/dev/null | grep -q "LABEL=\"$LABEL\""; then dev="$d"; break; fi
|
||||
done
|
||||
[ -n "$dev" ] && break
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
[ -n "$dev" ] || { echo "AeroOS: live medium not found"; exec sh; }
|
||||
echo "AeroOS: live medium = $dev"
|
||||
mount -t iso9660 -o ro "$dev" /run/iso || { echo "iso mount failed"; exec sh; }
|
||||
|
||||
# mount the squashfs (read-only lower layer)
|
||||
mount -t squashfs -o ro,loop "$SQUASH" /run/sqfs || { echo "squashfs mount failed"; exec sh; }
|
||||
|
||||
# writable overlay in RAM
|
||||
mount -t tmpfs tmpfs /run/overlay
|
||||
mkdir -p /run/overlay/upper /run/overlay/work
|
||||
mount -t overlay overlay \
|
||||
-o lowerdir=/run/sqfs,upperdir=/run/overlay/upper,workdir=/run/overlay/work \
|
||||
/sysroot || { echo "overlay mount failed"; exec sh; }
|
||||
|
||||
# move the already-mounted vkfs into the new root and switch
|
||||
mkdir -p /sysroot/run/iso
|
||||
mount --move /run/iso /sysroot/run/iso 2>/dev/null
|
||||
for fs in proc sys dev; do mount --move /$fs /sysroot/$fs 2>/dev/null; done
|
||||
|
||||
echo "AeroOS: switching root -> systemd"
|
||||
exec switch_root /sysroot /sbin/init
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Generate a subtle, seamless lofi loop for the AeroOS home screen.
|
||||
|
||||
Pure standard library (math/struct/wave) so it runs on any host with python3.
|
||||
Synthesizes a mellow jazzy chord progression with soft keys, a quiet kick,
|
||||
brushed hats and gentle vinyl crackle, then writes a 16-bit stereo WAV that
|
||||
loops seamlessly (whole number of bars).
|
||||
|
||||
Usage: generate_lofi.py OUTPUT.wav
|
||||
"""
|
||||
import math
|
||||
import random
|
||||
import struct
|
||||
import sys
|
||||
import wave
|
||||
|
||||
SR = 44100
|
||||
BPM = 72
|
||||
BEAT = 60.0 / BPM
|
||||
BAR = BEAT * 4
|
||||
BARS = 8 # loop length in bars -> seamless
|
||||
DUR = BAR * BARS
|
||||
|
||||
# Jazzy ii-V-I-vi style progression (root freqs, Hz) per 2 bars.
|
||||
# Each chord is a list of semitone offsets from the root.
|
||||
A = 220.0
|
||||
def note(semis, base=A):
|
||||
return base * (2 ** (semis / 12.0))
|
||||
|
||||
CHORDS = [ # (root_semitone_from_A, [chord tones as semitone offsets])
|
||||
(3, [0, 4, 7, 11]), # Cmaj7
|
||||
(0, [0, 3, 7, 10]), # Am7
|
||||
(5, [0, 3, 7, 10]), # Dm7
|
||||
(10, [0, 4, 7, 10]), # G7
|
||||
]
|
||||
|
||||
def soft_clip(x):
|
||||
return math.tanh(x * 1.2)
|
||||
|
||||
def main(out_path):
|
||||
random.seed(7)
|
||||
n = int(DUR * SR)
|
||||
left = [0.0] * n
|
||||
right = [0.0] * n
|
||||
|
||||
chord_len = DUR / len(CHORDS)
|
||||
|
||||
# --- pad / electric-piano-ish chords (detuned sines + slow tremolo) ---
|
||||
for ci, (root, tones) in enumerate(CHORDS):
|
||||
start = int(ci * chord_len * SR)
|
||||
end = int((ci + 1) * chord_len * SR)
|
||||
for t in tones:
|
||||
f = note(root + t, base=A) / 2.0 # one octave down, warm
|
||||
detune = 1.003
|
||||
for i in range(start, end):
|
||||
tt = (i - start) / SR
|
||||
env = min(tt / 0.04, 1.0) * math.exp(-tt * 0.25) # soft pluck
|
||||
trem = 0.92 + 0.08 * math.sin(2 * math.pi * 4.7 * tt)
|
||||
s = (math.sin(2 * math.pi * f * tt)
|
||||
+ 0.5 * math.sin(2 * math.pi * f * detune * tt)
|
||||
+ 0.25 * math.sin(2 * math.pi * f * 2 * tt))
|
||||
s *= 0.085 * env * trem
|
||||
# gentle stereo spread by tone index
|
||||
pan = 0.5 + 0.12 * math.sin(t)
|
||||
left[i] += s * (1 - pan + 0.5)
|
||||
right[i] += s * (pan + 0.5)
|
||||
|
||||
# --- bass (root, one more octave down) ---
|
||||
for ci, (root, _tones) in enumerate(CHORDS):
|
||||
start = int(ci * chord_len * SR)
|
||||
end = int((ci + 1) * chord_len * SR)
|
||||
f = note(root, base=A) / 4.0
|
||||
for i in range(start, end):
|
||||
tt = (i - start) / SR
|
||||
env = min(tt / 0.02, 1.0) * math.exp(-tt * 0.6)
|
||||
s = 0.16 * env * soft_clip(math.sin(2 * math.pi * f * tt))
|
||||
left[i] += s
|
||||
right[i] += s
|
||||
|
||||
# --- drums: soft kick on 1 & 3, brushed hat on offbeats ---
|
||||
total_beats = int(DUR / BEAT)
|
||||
for b in range(total_beats):
|
||||
bt = b * BEAT
|
||||
# kick
|
||||
if b % 2 == 0:
|
||||
ks = int(bt * SR)
|
||||
for i in range(ks, min(ks + int(0.18 * SR), n)):
|
||||
tt = (i - ks) / SR
|
||||
fk = 110 * math.exp(-tt * 24) + 45
|
||||
s = 0.5 * math.exp(-tt * 12) * math.sin(2 * math.pi * fk * tt)
|
||||
left[i] += s; right[i] += s
|
||||
# hat (off-beat)
|
||||
hs = int((bt + BEAT / 2) * SR)
|
||||
for i in range(hs, min(hs + int(0.05 * SR), n)):
|
||||
tt = (i - hs) / SR
|
||||
s = 0.06 * math.exp(-tt * 60) * (random.random() * 2 - 1)
|
||||
left[i] += s; right[i] += s
|
||||
|
||||
# --- vinyl crackle + tape hiss (very subtle) ---
|
||||
for i in range(n):
|
||||
hiss = (random.random() * 2 - 1) * 0.006
|
||||
crackle = 0.0
|
||||
if random.random() < 0.0009:
|
||||
crackle = (random.random() * 2 - 1) * 0.18
|
||||
left[i] += hiss + crackle
|
||||
right[i] += hiss + crackle
|
||||
|
||||
# --- simple one-pole low-pass for that warm muffled lofi tone ---
|
||||
def lowpass(buf, a=0.18):
|
||||
prev = 0.0
|
||||
for i in range(len(buf)):
|
||||
prev = prev + a * (buf[i] - prev)
|
||||
buf[i] = prev
|
||||
lowpass(left); lowpass(right)
|
||||
|
||||
# --- crossfade head/tail so the loop is seamless ---
|
||||
xf = int(0.25 * SR)
|
||||
for i in range(xf):
|
||||
g = i / xf
|
||||
left[i] = left[i] * g + left[n - xf + i] * (1 - g)
|
||||
right[i] = right[i] * g + right[n - xf + i] * (1 - g)
|
||||
|
||||
# --- master gain + soft clip, write 16-bit stereo ---
|
||||
peak = max(1e-6, max(max(abs(x) for x in left), max(abs(x) for x in right)))
|
||||
gain = 0.5 / peak # keep it subtle (headroom)
|
||||
with wave.open(out_path, "wb") as w:
|
||||
w.setnchannels(2)
|
||||
w.setsampwidth(2)
|
||||
w.setframerate(SR)
|
||||
frames = bytearray()
|
||||
for i in range(n):
|
||||
l = int(soft_clip(left[i] * gain) * 30000)
|
||||
r = int(soft_clip(right[i] * gain) * 30000)
|
||||
frames += struct.pack("<hh", max(-32768, min(32767, l)),
|
||||
max(-32768, min(32767, r)))
|
||||
w.writeframes(bytes(frames))
|
||||
print(f"wrote {out_path}: {DUR:.1f}s, {n} frames")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit("usage: generate_lofi.py OUTPUT.wav")
|
||||
main(sys.argv[1])
|
||||
@@ -0,0 +1,114 @@
|
||||
/* AeroGlass — a glassmorphism GTK4 theme for AeroOS.
|
||||
* Translucent frosted surfaces, soft white borders, rounded corners and the
|
||||
* cool cyan Frutiger Aero accent. Pairs with the aerowm compositor, whose
|
||||
* blurred wallpaper backdrop shows through these translucent windows. */
|
||||
|
||||
@define-color aero_accent #29a8e0;
|
||||
@define-color aero_accent_rgb rgb(41,168,224);
|
||||
@define-color aero_glass rgba(255,255,255,0.16);
|
||||
@define-color aero_glass_hi rgba(255,255,255,0.30);
|
||||
@define-color aero_text #0b2a3f;
|
||||
@define-color aero_text_light #eaf7ff;
|
||||
|
||||
* {
|
||||
outline-color: rgba(41,168,224,0.55);
|
||||
}
|
||||
|
||||
window, .background {
|
||||
background-color: rgba(225,245,255,0.10);
|
||||
color: @aero_text_light;
|
||||
}
|
||||
|
||||
/* Frosted top bars / headerbars */
|
||||
headerbar, .titlebar {
|
||||
background: linear-gradient(to bottom,
|
||||
rgba(255,255,255,0.34),
|
||||
rgba(255,255,255,0.14));
|
||||
border-bottom: 1px solid rgba(255,255,255,0.45);
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
|
||||
color: @aero_text_light;
|
||||
border-radius: 14px 14px 0 0;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
/* Generic frosted glass containers */
|
||||
.card, popover > contents, .osd, infobar, .glass {
|
||||
background: rgba(255,255,255,0.16);
|
||||
border: 1px solid rgba(255,255,255,0.40);
|
||||
border-radius: 18px;
|
||||
box-shadow: 0 8px 30px rgba(8,36,63,0.28),
|
||||
inset 0 1px 0 rgba(255,255,255,0.55);
|
||||
color: @aero_text_light;
|
||||
}
|
||||
|
||||
/* Buttons: glossy aqua pills */
|
||||
button {
|
||||
background: linear-gradient(to bottom,
|
||||
rgba(255,255,255,0.40),
|
||||
rgba(255,255,255,0.12));
|
||||
border: 1px solid rgba(255,255,255,0.50);
|
||||
border-radius: 12px;
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
|
||||
color: @aero_text_light;
|
||||
padding: 6px 14px;
|
||||
transition: all 150ms ease;
|
||||
}
|
||||
button:hover {
|
||||
background: linear-gradient(to bottom,
|
||||
rgba(173,224,255,0.55),
|
||||
rgba(41,168,224,0.30));
|
||||
}
|
||||
button:active {
|
||||
background: rgba(41,168,224,0.45);
|
||||
box-shadow: inset 0 2px 6px rgba(8,36,63,0.35);
|
||||
}
|
||||
button.suggested-action {
|
||||
background: linear-gradient(to bottom,
|
||||
rgba(94,200,255,0.85),
|
||||
rgba(41,168,224,0.85));
|
||||
border-color: rgba(255,255,255,0.7);
|
||||
}
|
||||
|
||||
/* Entries */
|
||||
entry, spinbutton, textview text {
|
||||
background: rgba(255,255,255,0.22);
|
||||
border: 1px solid rgba(255,255,255,0.45);
|
||||
border-radius: 10px;
|
||||
color: @aero_text_light;
|
||||
caret-color: @aero_accent_rgb;
|
||||
}
|
||||
entry:focus-within {
|
||||
border-color: @aero_accent_rgb;
|
||||
box-shadow: 0 0 0 2px rgba(41,168,224,0.45);
|
||||
}
|
||||
|
||||
/* Selections, switches, progress */
|
||||
selection { background-color: rgba(41,168,224,0.55); }
|
||||
switch:checked { background: @aero_accent_rgb; }
|
||||
progressbar progress, scale highlight {
|
||||
background: linear-gradient(to right, #7fdcff, #29a8e0);
|
||||
}
|
||||
|
||||
/* Scrollbars: slim translucent */
|
||||
scrollbar slider {
|
||||
background: rgba(255,255,255,0.45);
|
||||
border-radius: 10px;
|
||||
min-width: 8px; min-height: 8px;
|
||||
}
|
||||
|
||||
/* Menus / popovers */
|
||||
menu, .menu, popover {
|
||||
background: rgba(20,60,90,0.35);
|
||||
border-radius: 16px;
|
||||
}
|
||||
menuitem:hover, row:selected {
|
||||
background: rgba(41,168,224,0.40);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: rgba(11,42,63,0.75);
|
||||
border: 1px solid rgba(255,255,255,0.35);
|
||||
border-radius: 10px;
|
||||
color: @aero_text_light;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
[Settings]
|
||||
gtk-application-prefer-dark-theme=true
|
||||
gtk-theme-name=AeroGlass
|
||||
gtk-font-name=DejaVu Sans 11
|
||||
gtk-cursor-theme-size=24
|
||||
gtk-enable-animations=true
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- AeroOS default wallpaper — "Frutiger Aero" aesthetic:
|
||||
glossy sky gradient, soft clouds, sun bloom + lens flare, translucent
|
||||
bubbles/orbs, a glossy green hill and a reflective water band. 1920x1080. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080"
|
||||
viewBox="0 0 1920 1080">
|
||||
<defs>
|
||||
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0%" stop-color="#0a3d8f"/>
|
||||
<stop offset="35%" stop-color="#1f7ed6"/>
|
||||
<stop offset="70%" stop-color="#69c6f5"/>
|
||||
<stop offset="100%" stop-color="#bfeeff"/>
|
||||
</linearGradient>
|
||||
<radialGradient id="sun" cx="74%" cy="20%" r="40%">
|
||||
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.95"/>
|
||||
<stop offset="18%" stop-color="#fff6cf" stop-opacity="0.8"/>
|
||||
<stop offset="45%" stop-color="#bfe9ff" stop-opacity="0.25"/>
|
||||
<stop offset="100%" stop-color="#bfe9ff" stop-opacity="0"/>
|
||||
</radialGradient>
|
||||
<linearGradient id="hill" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0%" stop-color="#9fe04a"/>
|
||||
<stop offset="40%" stop-color="#5fb828"/>
|
||||
<stop offset="100%" stop-color="#2f7d12"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="hillgloss" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.55"/>
|
||||
<stop offset="100%" stop-color="#ffffff" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="water" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0%" stop-color="#bfeeff" stop-opacity="0.9"/>
|
||||
<stop offset="100%" stop-color="#2f9fd6" stop-opacity="0.9"/>
|
||||
</linearGradient>
|
||||
<radialGradient id="orb" cx="35%" cy="30%" r="75%">
|
||||
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.95"/>
|
||||
<stop offset="35%" stop-color="#cfeffe" stop-opacity="0.45"/>
|
||||
<stop offset="80%" stop-color="#8fd6f7" stop-opacity="0.18"/>
|
||||
<stop offset="100%" stop-color="#8fd6f7" stop-opacity="0"/>
|
||||
</radialGradient>
|
||||
<filter id="soft" x="-30%" y="-30%" width="160%" height="160%">
|
||||
<feGaussianBlur stdDeviation="14"/>
|
||||
</filter>
|
||||
<filter id="softer" x="-50%" y="-50%" width="200%" height="200%">
|
||||
<feGaussianBlur stdDeviation="30"/>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
<!-- sky + sun bloom -->
|
||||
<rect width="1920" height="1080" fill="url(#sky)"/>
|
||||
<rect width="1920" height="1080" fill="url(#sun)"/>
|
||||
|
||||
<!-- soft clouds -->
|
||||
<g fill="#ffffff" opacity="0.85" filter="url(#soft)">
|
||||
<ellipse cx="320" cy="180" rx="220" ry="70"/>
|
||||
<ellipse cx="520" cy="210" rx="180" ry="60"/>
|
||||
<ellipse cx="1500" cy="120" rx="260" ry="80"/>
|
||||
<ellipse cx="1180" cy="300" rx="160" ry="48"/>
|
||||
</g>
|
||||
|
||||
<!-- lens-flare specks -->
|
||||
<g fill="#ffffff">
|
||||
<circle cx="1421" cy="216" r="9" opacity="0.9"/>
|
||||
<circle cx="1180" cy="360" r="20" opacity="0.25"/>
|
||||
<circle cx="980" cy="470" r="13" opacity="0.30"/>
|
||||
<circle cx="760" cy="560" r="28" opacity="0.18"/>
|
||||
</g>
|
||||
|
||||
<!-- glossy green hill -->
|
||||
<path d="M0,760 C 420,650 900,720 1280,690 C 1600,665 1800,700 1920,680 L1920,1080 L0,1080 Z"
|
||||
fill="url(#hill)"/>
|
||||
<path d="M0,760 C 420,650 900,720 1280,690 C 1600,665 1800,700 1920,680 L1920,792
|
||||
C 1740,772 1500,800 1180,792 C 820,782 360,742 0,824 Z"
|
||||
fill="url(#hillgloss)" opacity="0.5"/>
|
||||
|
||||
<!-- reflective water band -->
|
||||
<path d="M0,930 C 500,905 1200,945 1920,915 L1920,1080 L0,1080 Z"
|
||||
fill="url(#water)"/>
|
||||
<g stroke="#ffffff" stroke-opacity="0.5" stroke-width="3" fill="none">
|
||||
<path d="M120,985 q 140,-14 280,0"/>
|
||||
<path d="M620,1010 q 160,-14 320,0"/>
|
||||
<path d="M1180,980 q 150,-12 300,0"/>
|
||||
</g>
|
||||
|
||||
<!-- floating translucent bubbles/orbs -->
|
||||
<g>
|
||||
<circle cx="300" cy="520" r="120" fill="url(#orb)"/>
|
||||
<circle cx="1580" cy="430" r="170" fill="url(#orb)"/>
|
||||
<circle cx="980" cy="250" r="70" fill="url(#orb)"/>
|
||||
<circle cx="1300" cy="600" r="60" fill="url(#orb)"/>
|
||||
<circle cx="640" cy="360" r="45" fill="url(#orb)"/>
|
||||
<circle cx="1750" cy="780" r="90" fill="url(#orb)" opacity="0.8"/>
|
||||
<circle cx="170" cy="820" r="55" fill="url(#orb)" opacity="0.8"/>
|
||||
</g>
|
||||
|
||||
<!-- bottom vignette for depth -->
|
||||
<rect y="900" width="1920" height="180" fill="#06243f" opacity="0.18" filter="url(#softer)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
Executable
+129
@@ -0,0 +1,129 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Procedural Frutiger Aero wallpaper -> PNG, using only the Python stdlib.
|
||||
|
||||
Guaranteed to work on any host (no ImageMagick/librsvg/Pillow needed): it draws
|
||||
the scene pixel-by-pixel and encodes a PNG with zlib. The build prefers
|
||||
rsvg-convert on the bundled SVG when available and only falls back to this.
|
||||
|
||||
Usage: gen_wallpaper.py OUTPUT.png [WIDTH HEIGHT]
|
||||
"""
|
||||
import math
|
||||
import struct
|
||||
import sys
|
||||
import zlib
|
||||
|
||||
|
||||
def lerp(a, b, t):
|
||||
return a + (b - a) * t
|
||||
|
||||
|
||||
def clamp(v, lo=0.0, hi=255.0):
|
||||
return max(lo, min(hi, v))
|
||||
|
||||
|
||||
def gen(width, height):
|
||||
# precompute a few orbs (x, y, radius)
|
||||
orbs = [
|
||||
(0.16 * width, 0.48 * height, 0.11 * height),
|
||||
(0.82 * width, 0.40 * height, 0.16 * height),
|
||||
(0.51 * width, 0.23 * height, 0.06 * height),
|
||||
(0.68 * width, 0.56 * height, 0.055 * height),
|
||||
(0.33 * width, 0.33 * height, 0.04 * height),
|
||||
(0.91 * width, 0.72 * height, 0.085 * height),
|
||||
(0.09 * width, 0.76 * height, 0.05 * height),
|
||||
]
|
||||
sun_x, sun_y = 0.74 * width, 0.20 * height
|
||||
hill_y = 0.70 * height
|
||||
water_y = 0.86 * height
|
||||
|
||||
raw = bytearray()
|
||||
for y in range(height):
|
||||
raw.append(0) # PNG filter byte: none
|
||||
fy = y / height
|
||||
for x in range(width):
|
||||
fx = x / width
|
||||
|
||||
# --- sky vertical gradient (deep blue -> pale cyan) ---
|
||||
if fy < 0.35:
|
||||
t = fy / 0.35
|
||||
r = lerp(10, 31, t); g = lerp(61, 126, t); b = lerp(143, 214, t)
|
||||
elif fy < 0.70:
|
||||
t = (fy - 0.35) / 0.35
|
||||
r = lerp(31, 105, t); g = lerp(126, 198, t); b = lerp(214, 245, t)
|
||||
else:
|
||||
r, g, b = 191, 238, 255
|
||||
|
||||
# --- sun bloom (radial) ---
|
||||
d = math.hypot(x - sun_x, y - sun_y) / (0.42 * width)
|
||||
if d < 1.0:
|
||||
glow = (1.0 - d) ** 2
|
||||
r = lerp(r, 255, glow * 0.9)
|
||||
g = lerp(g, 250, glow * 0.9)
|
||||
b = lerp(b, 215, glow * 0.7)
|
||||
|
||||
# --- glossy green hill ---
|
||||
hy = hill_y + 40 * math.sin(fx * math.pi * 1.3)
|
||||
if y > hy:
|
||||
t = clamp((y - hy) / (height - hy)) / 255.0 * 255
|
||||
tt = (y - hy) / max(1, (height - hy))
|
||||
hr = lerp(159, 47, tt); hg = lerp(224, 125, tt); hb = lerp(74, 18, tt)
|
||||
# top gloss highlight
|
||||
gloss = max(0.0, 1.0 - (y - hy) / (0.06 * height))
|
||||
hr = lerp(hr, 255, gloss * 0.5)
|
||||
hg = lerp(hg, 255, gloss * 0.5)
|
||||
hb = lerp(hb, 255, gloss * 0.5)
|
||||
r, g, b = hr, hg, hb
|
||||
|
||||
# --- reflective water band over the lower area ---
|
||||
if y > water_y:
|
||||
tt = (y - water_y) / max(1, (height - water_y))
|
||||
wr = lerp(191, 47, tt); wg = lerp(238, 159, tt); wb = lerp(255, 214, tt)
|
||||
r = lerp(r, wr, 0.85); g = lerp(g, wg, 0.85); b = lerp(b, wb, 0.85)
|
||||
if abs(math.sin((fx * 40) + (y * 0.3))) > 0.97:
|
||||
r = lerp(r, 255, 0.4); g = lerp(g, 255, 0.4); b = lerp(b, 255, 0.4)
|
||||
|
||||
# --- translucent orbs/bubbles ---
|
||||
for ox, oy, orad in orbs:
|
||||
od = math.hypot(x - ox, y - oy) / orad
|
||||
if od < 1.0:
|
||||
# bright rim + soft white core, additive-ish
|
||||
core = (1.0 - od) ** 1.5
|
||||
rim = math.exp(-((od - 0.85) ** 2) / 0.01) * 0.6
|
||||
a = clamp((core * 0.45 + rim) , 0, 1)
|
||||
r = lerp(r, 255, a * 0.8)
|
||||
g = lerp(g, 255, a * 0.85)
|
||||
b = lerp(b, 255, a * 0.9)
|
||||
|
||||
raw.append(int(clamp(r)))
|
||||
raw.append(int(clamp(g)))
|
||||
raw.append(int(clamp(b)))
|
||||
return bytes(raw)
|
||||
|
||||
|
||||
def write_png(path, width, height, raw):
|
||||
def chunk(tag, data):
|
||||
c = tag + data
|
||||
return struct.pack(">I", len(data)) + c + struct.pack(">I", zlib.crc32(c) & 0xffffffff)
|
||||
|
||||
sig = b"\x89PNG\r\n\x1a\n"
|
||||
ihdr = struct.pack(">IIBBBBB", width, height, 8, 2, 0, 0, 0) # 8-bit RGB
|
||||
idat = zlib.compress(raw, 9)
|
||||
with open(path, "wb") as f:
|
||||
f.write(sig)
|
||||
f.write(chunk(b"IHDR", ihdr))
|
||||
f.write(chunk(b"IDAT", idat))
|
||||
f.write(chunk(b"IEND", b""))
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
sys.exit("usage: gen_wallpaper.py OUTPUT.png [WIDTH HEIGHT]")
|
||||
out = sys.argv[1]
|
||||
w = int(sys.argv[2]) if len(sys.argv) > 2 else 1920
|
||||
h = int(sys.argv[3]) if len(sys.argv) > 3 else 1080
|
||||
write_png(out, w, h, gen(w, h))
|
||||
print(f"wrote {out} ({w}x{h})")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,106 @@
|
||||
#!/usr/bin/env bash
|
||||
# build.sh — AeroOS build orchestrator.
|
||||
#
|
||||
# ./build.sh check host requirement check
|
||||
# ./build.sh fetch download all upstream sources
|
||||
# ./build.sh stage NN run a single stage (00..08)
|
||||
# ./build.sh all run every stage in order
|
||||
# ./build.sh run-qemu boot the produced ISO in QEMU (UEFI)
|
||||
# ./build.sh clean remove build tree (keeps downloaded sources)
|
||||
# ./build.sh distclean remove build tree AND sources
|
||||
set -Eeuo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
source scripts/lib/common.sh
|
||||
|
||||
# Stages that must run as root (chroot/mount); others run as the build user.
|
||||
ROOT_STAGES="03 04 05 06 07 08"
|
||||
ALL_STAGES="00 01 02 03 04 05 06 07 08"
|
||||
|
||||
stage_script() {
|
||||
case "$1" in
|
||||
00) echo scripts/00-prepare.sh ;;
|
||||
01) echo scripts/01-toolchain.sh ;;
|
||||
02) echo scripts/02-temp-tools.sh ;;
|
||||
03) echo scripts/03-chroot-base.sh ;;
|
||||
04) echo scripts/04-kernel.sh ;;
|
||||
05) echo scripts/05-systemd-boot.sh ;;
|
||||
06) echo scripts/06-desktop.sh ;;
|
||||
07) echo scripts/07-aero-theme.sh ;;
|
||||
08) echo scripts/08-image.sh ;;
|
||||
*) die "unknown stage: $1 (valid: $ALL_STAGES)" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
needs_root() { [[ " $ROOT_STAGES " == *" $1 "* ]]; }
|
||||
|
||||
run_stage() {
|
||||
local n="$1" script; script="$(stage_script "$n")"
|
||||
step "STAGE $n ($script)"
|
||||
mkdir -p "$AEROS_LOGDIR"
|
||||
local log="$AEROS_LOGDIR/stage-$n.log"
|
||||
if needs_root "$n"; then
|
||||
[[ $EUID -eq 0 ]] || die "stage $n needs root; re-run: sudo ./build.sh stage $n"
|
||||
bash "$script" 2>&1 | tee "$log"
|
||||
else
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
warn "stage $n should run unprivileged; dropping to \$SUDO_USER if set"
|
||||
if [[ -n "${SUDO_USER:-}" ]]; then
|
||||
sudo -u "$SUDO_USER" -E bash "$script" 2>&1 | tee "$log"
|
||||
else
|
||||
die "refusing to build toolchain as root; run as a normal user"
|
||||
fi
|
||||
else
|
||||
bash "$script" 2>&1 | tee "$log"
|
||||
fi
|
||||
fi
|
||||
ok "stage $n complete (log: $log)"
|
||||
}
|
||||
|
||||
run_qemu() {
|
||||
require_cmd qemu-system-x86_64
|
||||
local iso; iso="$(cat "$AEROS_OUT/.last-iso" 2>/dev/null || echo "$AEROS_OUT/$AEROS_ISO_NAME")"
|
||||
[[ -s "$iso" ]] || die "no ISO found; run ./build.sh all first"
|
||||
local ovmf=""
|
||||
for p in /usr/share/OVMF/OVMF_CODE.fd /usr/share/ovmf/OVMF.fd \
|
||||
/usr/share/edk2-ovmf/x64/OVMF_CODE.fd; do
|
||||
[[ -f "$p" ]] && { ovmf="$p"; break; }
|
||||
done
|
||||
log "booting $iso in QEMU"
|
||||
local args=(-m 4096 -smp 4 -enable-kvm -cpu host
|
||||
-device virtio-vga-gl -display gtk,gl=on
|
||||
-device intel-hda -device hda-duplex
|
||||
-cdrom "$iso" -boot d)
|
||||
[[ -n "$ovmf" ]] && args+=(-drive "if=pflash,format=raw,readonly=on,file=$ovmf")
|
||||
qemu-system-x86_64 "${args[@]}" || \
|
||||
qemu-system-x86_64 -m 4096 -smp 4 -vga virtio -cdrom "$iso" -boot d
|
||||
}
|
||||
|
||||
main() {
|
||||
local cmd="${1:-help}"; shift || true
|
||||
case "$cmd" in
|
||||
check) bash scripts/00-prepare.sh check ;;
|
||||
fetch) bash scripts/00-prepare.sh all ;;
|
||||
stage) [[ $# -ge 1 ]] || die "usage: ./build.sh stage NN"; run_stage "$1" ;;
|
||||
all) for s in $ALL_STAGES; do run_stage "$s"; done
|
||||
ok "AeroOS build finished -> $AEROS_OUT/$AEROS_ISO_NAME" ;;
|
||||
run-qemu) run_qemu ;;
|
||||
clean) warn "removing $AEROS_ROOT and $AEROS_OUT"; rm -rf "$AEROS_ROOT" "$AEROS_OUT" "$AEROS_LOGDIR" ;;
|
||||
distclean) warn "removing build tree + sources"; rm -rf "$AEROS_ROOT" "$AEROS_OUT" "$AEROS_LOGDIR" "$AEROS_SOURCES" ;;
|
||||
help|*) cat <<EOF
|
||||
AeroOS build system
|
||||
./build.sh check # verify host has required tools
|
||||
./build.sh fetch # download all upstream sources
|
||||
./build.sh stage NN # run one stage (00..08)
|
||||
./build.sh all # full build -> bootable ISO
|
||||
./build.sh run-qemu # test the ISO in QEMU (UEFI if OVMF present)
|
||||
./build.sh clean # wipe build tree (keep sources)
|
||||
./build.sh distclean # wipe build tree + sources
|
||||
|
||||
Stages: 00 prepare · 01 toolchain · 02 temp-tools · 03 base · 04 kernel
|
||||
05 systemd/boot · 06 desktop+aerowm · 07 aero theme · 08 ISO
|
||||
Note: stages 03-08 need root (chroot); 00-02 run as your normal user.
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
main "$@"
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# config/aeros.conf — top-level build knobs for AeroOS.
|
||||
# Sourced by every stage. Override anything via environment variables.
|
||||
|
||||
# ---- Identity ---------------------------------------------------------------
|
||||
AEROS_NAME="AeroOS"
|
||||
AEROS_VERSION="1.0"
|
||||
AEROS_CODENAME="Frutiger"
|
||||
AEROS_HOSTNAME="aeros"
|
||||
AEROS_DISTRO_ID="aeros"
|
||||
|
||||
# ---- Target architecture ----------------------------------------------------
|
||||
# 64-bit only, AMD64 / x86-64.
|
||||
AEROS_ARCH="x86_64"
|
||||
AEROS_TARGET_TRIPLET="x86_64-aeros-linux-gnu"
|
||||
# Conservative baseline so it boots on any amd64 laptop/desktop (>= 2010).
|
||||
AEROS_MARCH="x86-64-v2"
|
||||
|
||||
# ---- Paths (nothing outside these is touched) -------------------------------
|
||||
AEROS_TOP="${AEROS_TOP:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
|
||||
AEROS_ROOT="${AEROS_ROOT:-$AEROS_TOP/build}" # the new system root (== $LFS)
|
||||
AEROS_SOURCES="${AEROS_SOURCES:-$AEROS_TOP/sources}"
|
||||
AEROS_TOOLS="${AEROS_ROOT}/tools" # cross toolchain lives here
|
||||
AEROS_OUT="${AEROS_OUT:-$AEROS_TOP/out}"
|
||||
AEROS_LOGDIR="${AEROS_LOGDIR:-$AEROS_TOP/logs}"
|
||||
|
||||
# ---- Build performance ------------------------------------------------------
|
||||
AEROS_JOBS="${AEROS_JOBS:-$(nproc)}"
|
||||
MAKEFLAGS="-j${AEROS_JOBS}"
|
||||
export MAKEFLAGS
|
||||
|
||||
# ---- Unprivileged build user (LFS convention) -------------------------------
|
||||
AEROS_BUILD_USER="aerobuild"
|
||||
|
||||
# ---- Default account baked into the live image ------------------------------
|
||||
AEROS_LIVE_USER="aero"
|
||||
AEROS_LIVE_PASS="aero" # change before shipping!
|
||||
AEROS_ROOT_PASS="root" # change before shipping!
|
||||
|
||||
# ---- Locale / time ----------------------------------------------------------
|
||||
AEROS_LOCALE="en_US.UTF-8"
|
||||
AEROS_TIMEZONE="UTC"
|
||||
AEROS_KEYMAP="us"
|
||||
|
||||
# ---- Image -------------------------------------------------------------------
|
||||
AEROS_ISO_LABEL="AEROS_LIVE"
|
||||
AEROS_ISO_NAME="${AEROS_NAME,,}-${AEROS_VERSION}-${AEROS_ARCH}.iso"
|
||||
|
||||
export AEROS_NAME AEROS_VERSION AEROS_CODENAME AEROS_HOSTNAME AEROS_DISTRO_ID
|
||||
export AEROS_ARCH AEROS_TARGET_TRIPLET AEROS_MARCH
|
||||
export AEROS_TOP AEROS_ROOT AEROS_SOURCES AEROS_TOOLS AEROS_OUT AEROS_LOGDIR
|
||||
export AEROS_JOBS AEROS_BUILD_USER
|
||||
export AEROS_LIVE_USER AEROS_LIVE_PASS AEROS_ROOT_PASS
|
||||
export AEROS_LOCALE AEROS_TIMEZONE AEROS_KEYMAP
|
||||
export AEROS_ISO_LABEL AEROS_ISO_NAME
|
||||
@@ -0,0 +1,151 @@
|
||||
# config/kernel/aeros.config — AeroOS kernel config fragment for Linux 7.x, x86-64.
|
||||
#
|
||||
# Applied on top of `make x86_64_defconfig` via scripts/kconfig merge.
|
||||
# Goal: a single bootable kernel for generic amd64 desktops/laptops with the
|
||||
# DRM/KMS drivers a Wayland/wlroots compositor needs, plus squashfs/overlay for
|
||||
# the live ISO. Intentionally builds common GPU + storage + input drivers in.
|
||||
|
||||
# ---- base / 64-bit ----
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_X86_64=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
|
||||
# ---- init / systemd requirements ----
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_DEVTMPFS_MOUNT=y
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_NET_NS=y
|
||||
CONFIG_USER_NS=y
|
||||
CONFIG_PID_NS=y
|
||||
CONFIG_SECCOMP=y
|
||||
CONFIG_SECCOMP_FILTER=y
|
||||
CONFIG_FANOTIFY=y
|
||||
CONFIG_AUTOFS_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_TMPFS_XATTR=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_CRYPTO_USER_API_HASH=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_INOTIFY_USER=y
|
||||
CONFIG_EPOLL=y
|
||||
CONFIG_SIGNALFD=y
|
||||
CONFIG_TIMERFD=y
|
||||
CONFIG_EVENTFD=y
|
||||
|
||||
# ---- live ISO: squashfs + overlay + iso9660 ----
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_SQUASHFS=y
|
||||
CONFIG_SQUASHFS_XATTR=y
|
||||
CONFIG_SQUASHFS_ZSTD=y
|
||||
CONFIG_SQUASHFS_XZ=y
|
||||
CONFIG_ISO9660_FS=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_RD_ZSTD=y
|
||||
CONFIG_RD_GZIP=y
|
||||
|
||||
# ---- filesystems for installed disks ----
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_BTRFS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_FAT_DEFAULT_UTF8=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
|
||||
# ---- UEFI / boot ----
|
||||
CONFIG_EFI=y
|
||||
CONFIG_EFI_STUB=y
|
||||
CONFIG_EFIVAR_FS=y
|
||||
CONFIG_FW_LOADER=y
|
||||
CONFIG_SYSFB_SIMPLEFB=y
|
||||
CONFIG_FB_EFI=y
|
||||
|
||||
# ---- storage controllers (built-in so we boot without initramfs modules) ----
|
||||
CONFIG_ATA=y
|
||||
CONFIG_SATA_AHCI=y
|
||||
CONFIG_BLK_DEV_NVME=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_DEV_SR=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_DM=y
|
||||
|
||||
# ---- USB / HID (laptops, keyboards, mice, touchpads) ----
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_HID=y
|
||||
CONFIG_HID_GENERIC=y
|
||||
CONFIG_USB_HID=y
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
CONFIG_I2C_HID=y
|
||||
CONFIG_MOUSE_PS2=y
|
||||
CONFIG_KEYBOARD_ATKBD=y
|
||||
|
||||
# ---- DRM / KMS GPU drivers (required for Wayland + glassmorphism GL blur) ----
|
||||
CONFIG_DRM=y
|
||||
CONFIG_DRM_FBDEV_EMULATION=y
|
||||
CONFIG_DRM_KMS_HELPER=y
|
||||
CONFIG_DRM_SIMPLEDRM=y
|
||||
CONFIG_DRM_I915=y
|
||||
CONFIG_DRM_XE=y
|
||||
CONFIG_DRM_AMDGPU=y
|
||||
CONFIG_DRM_AMDGPU_SI=y
|
||||
CONFIG_DRM_AMDGPU_CIK=y
|
||||
CONFIG_DRM_NOUVEAU=y
|
||||
CONFIG_DRM_VIRTIO_GPU=y
|
||||
CONFIG_DRM_BOCHS=y
|
||||
CONFIG_DRM_VMWGFX=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
|
||||
# ---- networking (wired + common wifi for laptops) ----
|
||||
CONFIG_NET=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_E1000=y
|
||||
CONFIG_E1000E=y
|
||||
CONFIG_R8169=y
|
||||
CONFIG_IGB=y
|
||||
CONFIG_CFG80211=y
|
||||
CONFIG_MAC80211=y
|
||||
CONFIG_IWLWIFI=m
|
||||
CONFIG_IWLMVM=m
|
||||
CONFIG_ATH9K=m
|
||||
CONFIG_ATH10K=m
|
||||
CONFIG_RTW88=m
|
||||
CONFIG_VIRTIO_NET=y
|
||||
|
||||
# ---- audio (PipeWire backend for lofi playback) ----
|
||||
CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_HDA_INTEL=y
|
||||
CONFIG_SND_HDA_CODEC_REALTEK=y
|
||||
CONFIG_SND_HDA_CODEC_HDMI=y
|
||||
CONFIG_SND_USB_AUDIO=m
|
||||
CONFIG_SND_INTEL_DSP_CONFIG=y
|
||||
|
||||
# ---- power / laptops ----
|
||||
CONFIG_ACPI=y
|
||||
CONFIG_ACPI_BATTERY=y
|
||||
CONFIG_ACPI_AC=y
|
||||
CONFIG_BACKLIGHT_CLASS_DEVICE=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_X86_INTEL_PSTATE=y
|
||||
CONFIG_X86_AMD_PSTATE=y
|
||||
CONFIG_THERMAL=y
|
||||
|
||||
# ---- virtio (so it boots cleanly in QEMU for testing) ----
|
||||
CONFIG_VIRTIO=y
|
||||
CONFIG_VIRTIO_PCI=y
|
||||
CONFIG_VIRTIO_BLK=y
|
||||
CONFIG_VIRTIO_CONSOLE=y
|
||||
@@ -0,0 +1,138 @@
|
||||
#!/usr/bin/env bash
|
||||
# config/versions.sh — pinned upstream sources for AeroOS.
|
||||
#
|
||||
# Format: PKG[name]="version|url"
|
||||
# URLs are verified-reachable at authoring time. Bump versions here only.
|
||||
# Checksums (optional) go in config/checksums.sha256 and are verified on fetch.
|
||||
|
||||
declare -gA PKG
|
||||
|
||||
# ============================ Toolchain (LFS ch.5) ===========================
|
||||
PKG[binutils]="2.45|https://ftp.gnu.org/gnu/binutils/binutils-2.45.tar.xz"
|
||||
PKG[gcc]="15.1.0|https://ftp.gnu.org/gnu/gcc/gcc-15.1.0/gcc-15.1.0.tar.xz"
|
||||
PKG[mpfr]="4.2.1|https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz"
|
||||
PKG[gmp]="6.3.0|https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz"
|
||||
PKG[mpc]="1.3.1|https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz"
|
||||
PKG[glibc]="2.41|https://ftp.gnu.org/gnu/glibc/glibc-2.41.tar.xz"
|
||||
|
||||
# ============================ Kernel =========================================
|
||||
PKG[linux]="7.1|https://www.kernel.org/pub/linux/kernel/v7.x/linux-7.1.tar.xz"
|
||||
|
||||
# ============================ Base system (LFS ch.6-8) =======================
|
||||
PKG[m4]="1.4.20|https://ftp.gnu.org/gnu/m4/m4-1.4.20.tar.xz"
|
||||
PKG[bc]="7.0.3|https://github.com/gavinhoward/bc/releases/download/7.0.3/bc-7.0.3.tar.xz"
|
||||
PKG[ncurses]="6.5|https://invisible-mirror.net/archives/ncurses/ncurses-6.5.tar.gz"
|
||||
PKG[bash]="5.3|https://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz"
|
||||
PKG[coreutils]="9.6|https://ftp.gnu.org/gnu/coreutils/coreutils-9.6.tar.xz"
|
||||
PKG[diffutils]="3.11|https://ftp.gnu.org/gnu/diffutils/diffutils-3.11.tar.xz"
|
||||
PKG[file]="5.46|https://astron.com/pub/file/file-5.46.tar.gz"
|
||||
PKG[findutils]="4.10.0|https://ftp.gnu.org/gnu/findutils/findutils-4.10.0.tar.xz"
|
||||
PKG[gawk]="5.3.1|https://ftp.gnu.org/gnu/gawk/gawk-5.3.1.tar.xz"
|
||||
PKG[grep]="3.11|https://ftp.gnu.org/gnu/grep/grep-3.11.tar.xz"
|
||||
PKG[gzip]="1.13|https://ftp.gnu.org/gnu/gzip/gzip-1.13.tar.xz"
|
||||
PKG[make]="4.4.1|https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz"
|
||||
PKG[patch]="2.7.6|https://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.xz"
|
||||
PKG[sed]="4.9|https://ftp.gnu.org/gnu/sed/sed-4.9.tar.xz"
|
||||
PKG[tar]="1.35|https://ftp.gnu.org/gnu/tar/tar-1.35.tar.xz"
|
||||
PKG[xz]="5.6.3|https://github.com/tukaani-project/xz/releases/download/v5.6.3/xz-5.6.3.tar.xz"
|
||||
PKG[gettext]="0.23.1|https://ftp.gnu.org/gnu/gettext/gettext-0.23.1.tar.xz"
|
||||
PKG[bison]="3.8.2|https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz"
|
||||
PKG[perl]="5.40.1|https://www.cpan.org/src/5.0/perl-5.40.1.tar.xz"
|
||||
PKG[python]="3.13.1|https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz"
|
||||
PKG[texinfo]="7.2|https://ftp.gnu.org/gnu/texinfo/texinfo-7.2.tar.xz"
|
||||
PKG[util-linux]="2.40.4|https://www.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.4.tar.xz"
|
||||
PKG[zlib]="1.3.1|https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz"
|
||||
PKG[bzip2]="1.0.8|https://www.sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
|
||||
PKG[zstd]="1.5.6|https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz"
|
||||
PKG[readline]="8.2.13|https://ftp.gnu.org/gnu/readline/readline-8.2.13.tar.gz"
|
||||
PKG[flex]="2.6.4|https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz"
|
||||
PKG[pkgconf]="2.3.0|https://distfiles.ariadne.space/pkgconf/pkgconf-2.3.0.tar.xz"
|
||||
PKG[openssl]="3.4.0|https://www.openssl.org/source/openssl-3.4.0.tar.gz"
|
||||
PKG[expat]="2.6.4|https://github.com/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.xz"
|
||||
PKG[libffi]="3.4.6|https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz"
|
||||
PKG[elfutils]="0.192|https://sourceware.org/elfutils/ftp/0.192/elfutils-0.192.tar.bz2"
|
||||
PKG[kmod]="33|https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-33.tar.xz"
|
||||
PKG[rsync]="3.4.1|https://www.samba.org/ftp/rsync/src/rsync-3.4.1.tar.gz"
|
||||
PKG[libxcrypt]="4.4.38|https://github.com/besser82/libxcrypt/releases/download/v4.4.38/libxcrypt-4.4.38.tar.xz"
|
||||
PKG[eudev_note]="not used: systemd provides udev"
|
||||
|
||||
# ============================ Init / boot ====================================
|
||||
PKG[systemd]="257|https://github.com/systemd/systemd/archive/v257.tar.gz"
|
||||
PKG[dbus]="1.16.0|https://dbus.freedesktop.org/releases/dbus/dbus-1.16.0.tar.xz"
|
||||
PKG[grub]="2.12|https://ftp.gnu.org/gnu/grub/grub-2.12.tar.xz"
|
||||
PKG[shadow]="4.17.2|https://github.com/shadow-maint/shadow/releases/download/4.17.2/shadow-4.17.2.tar.xz"
|
||||
PKG[libcap]="2.73|https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.73.tar.xz"
|
||||
PKG[util_macros]="1.20.1|https://www.x.org/pub/individual/util/util-macros-1.20.1.tar.xz"
|
||||
|
||||
# ============================ Graphics / Wayland =============================
|
||||
PKG[wayland]="1.23.1|https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.23.1/downloads/wayland-1.23.1.tar.xz"
|
||||
PKG[wayland-protocols]="1.39|https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.39/downloads/wayland-protocols-1.39.tar.xz"
|
||||
PKG[wlroots]="0.18.2|https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/0.18.2/wlroots-0.18.2.tar.gz"
|
||||
PKG[libdrm]="2.4.124|https://dri.freedesktop.org/libdrm/libdrm-2.4.124.tar.xz"
|
||||
PKG[mesa]="24.3.4|https://mesa.freedesktop.org/archive/mesa-24.3.4.tar.xz"
|
||||
PKG[pixman]="0.44.2|https://www.cairographics.org/releases/pixman-0.44.2.tar.gz"
|
||||
PKG[libxkbcommon]="1.7.0|https://xkbcommon.org/download/libxkbcommon-1.7.0.tar.xz"
|
||||
PKG[libinput]="1.27.1|https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.27.1/libinput-1.27.1.tar.gz"
|
||||
PKG[mtdev]="1.1.7|https://bitmath.org/code/mtdev/mtdev-1.1.7.tar.bz2"
|
||||
PKG[libevdev]="1.13.4|https://www.freedesktop.org/software/libevdev/libevdev-1.13.4.tar.xz"
|
||||
PKG[seatd]="0.9.1|https://git.sr.ht/~kennylevinsen/seatd/archive/0.9.1.tar.gz"
|
||||
PKG[libxml2]="2.15.3|https://download.gnome.org/sources/libxml2/2.15/libxml2-2.15.3.tar.xz"
|
||||
PKG[libdisplay-info]="0.2.0|https://gitlab.freedesktop.org/emersion/libdisplay-info/-/archive/0.2.0/libdisplay-info-0.2.0.tar.gz"
|
||||
PKG[cairo]="1.18.2|https://www.cairographics.org/releases/cairo-1.18.2.tar.xz"
|
||||
PKG[pango]="1.54.0|https://download.gnome.org/sources/pango/1.54/pango-1.54.0.tar.xz"
|
||||
PKG[fontconfig]="2.15.0|https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/2.15.0/fontconfig-2.15.0.tar.gz"
|
||||
PKG[freetype]="2.13.3|https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.xz"
|
||||
PKG[harfbuzz]="10.1.0|https://github.com/harfbuzz/harfbuzz/releases/download/10.1.0/harfbuzz-10.1.0.tar.xz"
|
||||
|
||||
# ============================ Pango/cairo text stack (compositor UI) =========
|
||||
PKG[libpng]="1.6.44|https://download.sourceforge.net/libpng/libpng-1.6.44.tar.xz"
|
||||
PKG[fribidi]="1.0.16|https://github.com/fribidi/fribidi/releases/download/v1.0.16/fribidi-1.0.16.tar.xz"
|
||||
PKG[pcre2]="10.44|https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.bz2"
|
||||
PKG[graphene]="1.10.8|https://download.gnome.org/sources/graphene/1.10/graphene-1.10.8.tar.xz"
|
||||
PKG[hwdata]="0.387|https://github.com/vcrhonek/hwdata/archive/v0.387/hwdata-0.387.tar.gz"
|
||||
PKG[dejavu]="2.37|https://download.sourceforge.net/dejavu/dejavu-fonts-ttf-2.37.tar.bz2"
|
||||
|
||||
# ============================ Desktop / toolkit (optional extras) ============
|
||||
PKG[glib]="2.82.4|https://download.gnome.org/sources/glib/2.82/glib-2.82.4.tar.xz"
|
||||
PKG[gtk4]="4.16.7|https://download.gnome.org/sources/gtk/4.16/gtk-4.16.7.tar.xz"
|
||||
PKG[gdk-pixbuf]="2.42.12|https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.12.tar.xz"
|
||||
PKG[librsvg]="2.59.2|https://download.gnome.org/sources/librsvg/2.59/librsvg-2.59.2.tar.xz"
|
||||
PKG[adwaita-icon-theme]="47.0|https://download.gnome.org/sources/adwaita-icon-theme/47/adwaita-icon-theme-47.0.tar.xz"
|
||||
|
||||
# ============================ Audio (lofi playback) ==========================
|
||||
PKG[lua]="5.4.8|https://www.lua.org/ftp/lua-5.4.8.tar.gz"
|
||||
PKG[pipewire]="1.2.7|https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/1.2.7/pipewire-1.2.7.tar.gz"
|
||||
PKG[wireplumber]="0.5.7|https://gitlab.freedesktop.org/pipewire/wireplumber/-/archive/0.5.7/wireplumber-0.5.7.tar.gz"
|
||||
PKG[alsa-lib]="1.2.13|https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.13.tar.bz2"
|
||||
PKG[mpv]="0.39.0|https://github.com/mpv-player/mpv/archive/v0.39.0/mpv-0.39.0.tar.gz"
|
||||
PKG[ffmpeg]="7.1|https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz"
|
||||
PKG[libsndfile]="1.2.2|https://github.com/libsndfile/libsndfile/releases/download/1.2.2/libsndfile-1.2.2.tar.xz"
|
||||
|
||||
# ============================ Build tooling (host-built, in chroot) ==========
|
||||
PKG[meson]="1.6.1|https://github.com/mesonbuild/meson/releases/download/1.6.1/meson-1.6.1.tar.gz"
|
||||
PKG[ninja]="1.12.1|https://github.com/ninja-build/ninja/archive/v1.12.1/ninja-1.12.1.tar.gz"
|
||||
PKG[cmake]="3.31.3|https://github.com/Kitware/CMake/releases/download/v3.31.3/cmake-3.31.3.tar.gz"
|
||||
PKG[gperf]="3.1|https://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz"
|
||||
PKG[jinja2]="3.1.6|https://files.pythonhosted.org/packages/source/J/Jinja2/jinja2-3.1.6.tar.gz"
|
||||
PKG[markupsafe]="3.0.2|https://files.pythonhosted.org/packages/source/M/MarkupSafe/markupsafe-3.0.2.tar.gz"
|
||||
|
||||
# ============================ Live image tooling =============================
|
||||
PKG[busybox]="1.37.0|https://busybox.net/downloads/busybox-1.37.0.tar.bz2"
|
||||
PKG[mtools]="4.0.46|https://ftp.gnu.org/gnu/mtools/mtools-4.0.46.tar.bz2"
|
||||
PKG[squashfs-tools]="4.6.1|https://github.com/plougher/squashfs-tools/archive/4.6.1/squashfs-tools-4.6.1.tar.gz"
|
||||
PKG[libisoburn]="1.5.6|https://files.libburnia-project.org/releases/libisoburn-1.5.6.tar.gz"
|
||||
PKG[libisofs]="1.5.6|https://files.libburnia-project.org/releases/libisofs-1.5.6.tar.gz"
|
||||
PKG[libburn]="1.5.6|https://files.libburnia-project.org/releases/libburn-1.5.6.tar.gz"
|
||||
|
||||
# Helper: echo the version of a package -> "pkg_version coreutils"
|
||||
pkg_version() { local e="${PKG[$1]}"; echo "${e%%|*}"; }
|
||||
# Helper: echo the URL of a package
|
||||
pkg_url() { local e="${PKG[$1]}"; echo "${e#*|}"; }
|
||||
# Helper: echo the tarball basename
|
||||
pkg_tarball() { basename "$(pkg_url "$1")"; }
|
||||
# Helper: echo the expected source dir name (strip extension)
|
||||
pkg_srcdir() {
|
||||
local t; t="$(pkg_tarball "$1")"
|
||||
t="${t%.tar.*}"; t="${t%.tgz}"
|
||||
echo "$t"
|
||||
}
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# aero-lofi — loops the subtle AeroOS lofi track on the PipeWire graph.
|
||||
# Kept intentionally simple: loop a seamless WAV with pw-play (falls back to
|
||||
# paplay / aplay). Volume is held low for a "subtle" background feel.
|
||||
|
||||
TRACK="${AERO_LOFI_TRACK:-/usr/share/aeros/lofi/aero-lofi.wav}"
|
||||
VOL="${AERO_LOFI_VOLUME:-0.35}"
|
||||
|
||||
[ -r "$TRACK" ] || { echo "aero-lofi: no track at $TRACK" >&2; exit 1; }
|
||||
|
||||
player() {
|
||||
if command -v pw-play >/dev/null 2>&1; then
|
||||
pw-play --volume "$VOL" "$TRACK"
|
||||
elif command -v paplay >/dev/null 2>&1; then
|
||||
paplay "$TRACK"
|
||||
elif command -v aplay >/dev/null 2>&1; then
|
||||
aplay -q "$TRACK"
|
||||
else
|
||||
echo "aero-lofi: no audio player available" >&2
|
||||
sleep 3600
|
||||
fi
|
||||
}
|
||||
|
||||
# Loop forever (the track itself is a seamless loop).
|
||||
while :; do
|
||||
player || sleep 2
|
||||
done
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=AeroOS subtle lofi on the home screen
|
||||
After=pipewire.service wireplumber.service
|
||||
Wants=pipewire.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/aero-lofi
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# aero-session — launches the AeroOS glassmorphism desktop.
|
||||
# Sets up the runtime/audio environment, then execs the aerowm compositor.
|
||||
|
||||
# XDG runtime dir (systemd usually provides this; ensure it exists)
|
||||
if [ -z "$XDG_RUNTIME_DIR" ]; then
|
||||
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
||||
mkdir -p "$XDG_RUNTIME_DIR"
|
||||
chmod 700 "$XDG_RUNTIME_DIR"
|
||||
fi
|
||||
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
export XDG_CURRENT_DESKTOP=AeroOS
|
||||
export GTK_THEME=AeroGlass
|
||||
export GDK_BACKEND=wayland
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
export MOZ_ENABLE_WAYLAND=1
|
||||
export AEROWM_WALLPAPER="/usr/share/backgrounds/aeros/frutiger-aero.png"
|
||||
|
||||
# Start the user audio graph (PipeWire) for lofi playback.
|
||||
if command -v pipewire >/dev/null 2>&1; then
|
||||
systemctl --user start pipewire pipewire-pulse wireplumber 2>/dev/null || {
|
||||
pipewire &
|
||||
sleep 0.3
|
||||
pipewire-pulse 2>/dev/null &
|
||||
wireplumber 2>/dev/null &
|
||||
}
|
||||
fi
|
||||
|
||||
# Hand off to the compositor (it autostarts aero-lofi itself).
|
||||
exec aerowm
|
||||
@@ -0,0 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Name=AeroOS (aerowm)
|
||||
Comment=Frutiger Aero glassmorphism desktop
|
||||
Exec=/usr/bin/aero-session
|
||||
Type=Application
|
||||
DesktopNames=AeroOS
|
||||
@@ -0,0 +1,47 @@
|
||||
project('aerowm', 'c',
|
||||
version: '1.0.0',
|
||||
license: 'MIT',
|
||||
default_options: ['c_std=c11', 'warning_level=2', 'werror=false'])
|
||||
|
||||
add_project_arguments(
|
||||
['-DWLR_USE_UNSTABLE',
|
||||
'-Wno-unused-parameter'],
|
||||
language: 'c')
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
wlroots = dependency('wlroots-0.18', required: false)
|
||||
if not wlroots.found()
|
||||
wlroots = dependency('wlroots', version: '>=0.18.0')
|
||||
endif
|
||||
wayland_server = dependency('wayland-server')
|
||||
xkbcommon = dependency('xkbcommon')
|
||||
pixman = dependency('pixman-1')
|
||||
cairo = dependency('cairo')
|
||||
pango = dependency('pango')
|
||||
pangocairo = dependency('pangocairo')
|
||||
glesv2 = dependency('glesv2', required: false)
|
||||
math = cc.find_library('m', required: false)
|
||||
|
||||
# Generate the xdg-shell protocol header from wayland-protocols.
|
||||
wl_protocol_dir = dependency('wayland-protocols').get_variable('pkgdatadir')
|
||||
wl_scanner = find_program('wayland-scanner')
|
||||
|
||||
xdg_shell_h = custom_target('xdg-shell-protocol.h',
|
||||
input: wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml',
|
||||
output: 'xdg-shell-protocol.h',
|
||||
command: [wl_scanner, 'server-header', '@INPUT@', '@OUTPUT@'])
|
||||
|
||||
aerowm_deps = [wlroots, wayland_server, xkbcommon, pixman,
|
||||
cairo, pango, pangocairo, math]
|
||||
if glesv2.found()
|
||||
aerowm_deps += glesv2
|
||||
endif
|
||||
|
||||
executable('aerowm',
|
||||
['src/main.c', 'src/blur.c', 'src/panel.c', 'src/image.c', xdg_shell_h],
|
||||
dependencies: aerowm_deps,
|
||||
install: true)
|
||||
|
||||
install_data('data/aerowm.desktop',
|
||||
install_dir: get_option('datadir') / 'wayland-sessions')
|
||||
@@ -0,0 +1,76 @@
|
||||
/* aerowm — separable box blur (Gaussian approximation) for ARGB32 buffers. */
|
||||
#include "blur.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static inline uint8_t clamp8(int v) { return v < 0 ? 0 : (v > 255 ? 255 : v); }
|
||||
|
||||
/* One horizontal box blur pass using a sliding window (O(n) per row). */
|
||||
static void box_blur_h(const uint32_t *src, uint32_t *dst,
|
||||
int w, int h, int stride, int radius) {
|
||||
const int diam = radius * 2 + 1;
|
||||
for (int y = 0; y < h; y++) {
|
||||
const uint32_t *srow = src + (size_t)y * stride;
|
||||
uint32_t *drow = dst + (size_t)y * stride;
|
||||
int a = 0, r = 0, g = 0, b = 0;
|
||||
/* prime the window with the leftmost pixel repeated for x<0 */
|
||||
for (int i = -radius; i <= radius; i++) {
|
||||
int xi = i < 0 ? 0 : (i >= w ? w - 1 : i);
|
||||
uint32_t p = srow[xi];
|
||||
a += (p >> 24) & 0xff; r += (p >> 16) & 0xff;
|
||||
g += (p >> 8) & 0xff; b += p & 0xff;
|
||||
}
|
||||
for (int x = 0; x < w; x++) {
|
||||
drow[x] = ((uint32_t)(a / diam) << 24) |
|
||||
((uint32_t)(r / diam) << 16) |
|
||||
((uint32_t)(g / diam) << 8) |
|
||||
(uint32_t)(b / diam);
|
||||
int x_out = x - radius;
|
||||
int x_in = x + radius + 1;
|
||||
x_out = x_out < 0 ? 0 : (x_out >= w ? w - 1 : x_out);
|
||||
x_in = x_in < 0 ? 0 : (x_in >= w ? w - 1 : x_in);
|
||||
uint32_t po = srow[x_out], pi = srow[x_in];
|
||||
a += ((pi >> 24) & 0xff) - ((po >> 24) & 0xff);
|
||||
r += ((pi >> 16) & 0xff) - ((po >> 16) & 0xff);
|
||||
g += ((pi >> 8) & 0xff) - ((po >> 8) & 0xff);
|
||||
b += ( pi & 0xff) - ( po & 0xff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Transpose so the same horizontal pass blurs columns; keeps cache friendly. */
|
||||
static void transpose(const uint32_t *src, uint32_t *dst, int w, int h, int stride) {
|
||||
for (int y = 0; y < h; y++)
|
||||
for (int x = 0; x < w; x++)
|
||||
dst[(size_t)x * h + y] = src[(size_t)y * stride + x];
|
||||
}
|
||||
|
||||
void aero_blur_argb32(uint32_t *data, int width, int height, int stride_px,
|
||||
int radius, int passes) {
|
||||
if (radius < 1 || width < 2 || height < 2) return;
|
||||
uint32_t *tmp = malloc((size_t)width * height * sizeof(uint32_t));
|
||||
uint32_t *tA = malloc((size_t)width * height * sizeof(uint32_t));
|
||||
uint32_t *tB = malloc((size_t)width * height * sizeof(uint32_t));
|
||||
if (!tmp || !tA || !tB) { free(tmp); free(tA); free(tB); return; }
|
||||
|
||||
for (int p = 0; p < passes; p++) {
|
||||
/* horizontal */
|
||||
box_blur_h(data, tmp, width, height, stride_px, radius);
|
||||
/* vertical via transpose -> horizontal -> transpose back */
|
||||
transpose(tmp, tA, width, height, stride_px);
|
||||
box_blur_h(tA, tB, height, width, height, radius);
|
||||
for (int y = 0; y < height; y++)
|
||||
for (int x = 0; x < width; x++)
|
||||
data[(size_t)y * stride_px + x] = tB[(size_t)x * height + y];
|
||||
}
|
||||
free(tmp); free(tA); free(tB);
|
||||
}
|
||||
|
||||
uint32_t *aero_blur_copy(const uint32_t *src, int width, int height,
|
||||
int stride_px, int radius, int passes) {
|
||||
uint32_t *out = malloc((size_t)stride_px * height * sizeof(uint32_t));
|
||||
if (!out) return NULL;
|
||||
memcpy(out, src, (size_t)stride_px * height * sizeof(uint32_t));
|
||||
aero_blur_argb32(out, width, height, stride_px, radius, passes);
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/* aerowm — glassmorphism helpers: box/Gaussian blur over ARGB32 buffers.
|
||||
*
|
||||
* Used to pre-blur the wallpaper once at startup so that frosted-glass panels
|
||||
* and window backdrops can show a real, performant blurred image through their
|
||||
* translucent surfaces (the classic "Frutiger Aero" frosted look) without
|
||||
* paying for a full-scene blur every frame.
|
||||
*/
|
||||
#ifndef AEROWM_BLUR_H
|
||||
#define AEROWM_BLUR_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* In-place separable box blur approximating a Gaussian.
|
||||
* data: premultiplied or straight ARGB32 (0xAARRGGBB) row-major.
|
||||
* Runs `passes` box blurs of the given radius (3 passes ≈ Gaussian).
|
||||
*/
|
||||
void aero_blur_argb32(uint32_t *data, int width, int height, int stride_px,
|
||||
int radius, int passes);
|
||||
|
||||
/* Allocate a blurred copy of src (caller frees with free()). */
|
||||
uint32_t *aero_blur_copy(const uint32_t *src, int width, int height,
|
||||
int stride_px, int radius, int passes);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
/* aerowm — image loading + cover-scaling using cairo. */
|
||||
#include "image.h"
|
||||
#include <cairo/cairo.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int aero_image_load_png(const char *path, struct aero_image *out) {
|
||||
cairo_surface_t *s = cairo_image_surface_create_from_png(path);
|
||||
if (cairo_surface_status(s) != CAIRO_STATUS_SUCCESS) {
|
||||
cairo_surface_destroy(s);
|
||||
return -1;
|
||||
}
|
||||
cairo_surface_flush(s);
|
||||
int w = cairo_image_surface_get_width(s);
|
||||
int h = cairo_image_surface_get_height(s);
|
||||
int stride_bytes = cairo_image_surface_get_stride(s);
|
||||
int stride_px = stride_bytes / 4;
|
||||
uint32_t *src = (uint32_t *)cairo_image_surface_get_data(s);
|
||||
|
||||
out->width = w; out->height = h; out->stride = stride_px;
|
||||
out->data = malloc((size_t)stride_px * h * sizeof(uint32_t));
|
||||
if (!out->data) { cairo_surface_destroy(s); return -1; }
|
||||
memcpy(out->data, src, (size_t)stride_px * h * sizeof(uint32_t));
|
||||
cairo_surface_destroy(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aero_image_cover(const struct aero_image *src, int dw, int dh,
|
||||
struct aero_image *out) {
|
||||
cairo_surface_t *dst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, dw, dh);
|
||||
if (cairo_surface_status(dst) != CAIRO_STATUS_SUCCESS) {
|
||||
cairo_surface_destroy(dst); return -1;
|
||||
}
|
||||
cairo_surface_t *ss = cairo_image_surface_create_for_data(
|
||||
(unsigned char *)src->data, CAIRO_FORMAT_ARGB32,
|
||||
src->width, src->height, src->stride * 4);
|
||||
|
||||
double sx = (double)dw / src->width;
|
||||
double sy = (double)dh / src->height;
|
||||
double scale = sx > sy ? sx : sy; /* cover */
|
||||
double ox = (dw - src->width * scale) / 2.0;
|
||||
double oy = (dh - src->height * scale) / 2.0;
|
||||
|
||||
cairo_t *cr = cairo_create(dst);
|
||||
cairo_translate(cr, ox, oy);
|
||||
cairo_scale(cr, scale, scale);
|
||||
cairo_set_source_surface(cr, ss, 0, 0);
|
||||
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_GOOD);
|
||||
cairo_paint(cr);
|
||||
cairo_destroy(cr);
|
||||
cairo_surface_flush(dst);
|
||||
|
||||
int stride_px = cairo_image_surface_get_stride(dst) / 4;
|
||||
out->width = dw; out->height = dh; out->stride = stride_px;
|
||||
out->data = malloc((size_t)stride_px * dh * sizeof(uint32_t));
|
||||
if (out->data)
|
||||
memcpy(out->data, cairo_image_surface_get_data(dst),
|
||||
(size_t)stride_px * dh * sizeof(uint32_t));
|
||||
cairo_surface_destroy(ss);
|
||||
cairo_surface_destroy(dst);
|
||||
return out->data ? 0 : -1;
|
||||
}
|
||||
|
||||
void aero_image_free(struct aero_image *img) {
|
||||
if (img && img->data) { free(img->data); img->data = NULL; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/* aerowm — image loading (PNG via cairo) into a pixman/ARGB buffer. */
|
||||
#ifndef AEROWM_IMAGE_H
|
||||
#define AEROWM_IMAGE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct aero_image {
|
||||
int width, height, stride; /* stride in pixels */
|
||||
uint32_t *data; /* ARGB32, owned */
|
||||
};
|
||||
|
||||
/* Load a PNG. Returns 0 on success. */
|
||||
int aero_image_load_png(const char *path, struct aero_image *out);
|
||||
|
||||
/* Scale-fill (cover) src into a new image of (dw x dh). Returns 0 on success. */
|
||||
int aero_image_cover(const struct aero_image *src, int dw, int dh,
|
||||
struct aero_image *out);
|
||||
|
||||
void aero_image_free(struct aero_image *img);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,584 @@
|
||||
/* aerowm — a small wlroots-based Wayland compositor for AeroOS.
|
||||
*
|
||||
* Adds, on top of a tinywl-style xdg-shell compositor:
|
||||
* - a full-screen Frutiger Aero wallpaper (cover-scaled)
|
||||
* - a pre-blurred copy of the wallpaper used as a frosted backdrop
|
||||
* - a glassmorphism home UI (top bar + welcome card + dock) drawn with cairo
|
||||
* - a live clock that re-renders the glass UI each minute
|
||||
* - autostart of the lofi player + user session
|
||||
*
|
||||
* Targets wlroots 0.18. Build with meson (see ../meson.build).
|
||||
*/
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/backend.h>
|
||||
#include <wlr/interfaces/wlr_buffer.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_compositor.h>
|
||||
#include <wlr/types/wlr_data_device.h>
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
#include <wlr/types/wlr_pointer.h>
|
||||
#include <wlr/types/wlr_scene.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_subcompositor.h>
|
||||
#include <wlr/types/wlr_xcursor_manager.h>
|
||||
#include <wlr/types/wlr_xdg_shell.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#include "image.h"
|
||||
#include "blur.h"
|
||||
#include "panel.h"
|
||||
|
||||
/* ----------------------------------------------------------------- aero_buffer
|
||||
* Minimal wlr_buffer backed by a malloc'd ARGB8888 image, so cairo-rendered
|
||||
* UI and the wallpaper can be placed directly into the wlroots scene graph.
|
||||
*/
|
||||
struct aero_buffer {
|
||||
struct wlr_buffer base;
|
||||
uint32_t *data; /* ARGB8888, owned */
|
||||
size_t stride; /* bytes */
|
||||
};
|
||||
|
||||
static void aero_buffer_destroy(struct wlr_buffer *b) {
|
||||
struct aero_buffer *buf = wl_container_of(b, buf, base);
|
||||
free(buf->data);
|
||||
free(buf);
|
||||
}
|
||||
static bool aero_buffer_begin_ptr(struct wlr_buffer *b, uint32_t flags,
|
||||
void **data, uint32_t *format, size_t *stride) {
|
||||
struct aero_buffer *buf = wl_container_of(b, buf, base);
|
||||
if (flags & WLR_BUFFER_DATA_PTR_ACCESS_WRITE) return false;
|
||||
*data = buf->data; *stride = buf->stride;
|
||||
*format = 0x34325241; /* DRM_FORMAT_ARGB8888 */
|
||||
return true;
|
||||
}
|
||||
static void aero_buffer_end_ptr(struct wlr_buffer *b) { (void)b; }
|
||||
|
||||
static const struct wlr_buffer_impl aero_buffer_impl = {
|
||||
.destroy = aero_buffer_destroy,
|
||||
.begin_data_ptr_access = aero_buffer_begin_ptr,
|
||||
.end_data_ptr_access = aero_buffer_end_ptr,
|
||||
};
|
||||
|
||||
/* Wrap an aero_image (consumes its data) into a wlr_buffer. */
|
||||
static struct aero_buffer *aero_buffer_from_image(struct aero_image *img) {
|
||||
struct aero_buffer *buf = calloc(1, sizeof(*buf));
|
||||
if (!buf) return NULL;
|
||||
wlr_buffer_init(&buf->base, &aero_buffer_impl, img->width, img->height);
|
||||
buf->data = img->data; /* take ownership */
|
||||
buf->stride = (size_t)img->stride * 4;
|
||||
img->data = NULL;
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- server */
|
||||
enum cursor_mode { CURSOR_PASSTHROUGH, CURSOR_MOVE, CURSOR_RESIZE };
|
||||
|
||||
struct aero_server {
|
||||
struct wl_display *wl_display;
|
||||
struct wlr_backend *backend;
|
||||
struct wlr_renderer *renderer;
|
||||
struct wlr_allocator *allocator;
|
||||
struct wlr_scene *scene;
|
||||
struct wlr_scene_output_layout *scene_layout;
|
||||
|
||||
struct wlr_xdg_shell *xdg_shell;
|
||||
struct wl_listener new_xdg_toplevel;
|
||||
struct wl_list toplevels;
|
||||
|
||||
struct wlr_cursor *cursor;
|
||||
struct wlr_xcursor_manager *cursor_mgr;
|
||||
struct wl_listener cursor_motion, cursor_motion_absolute;
|
||||
struct wl_listener cursor_button, cursor_axis, cursor_frame;
|
||||
enum cursor_mode cursor_mode;
|
||||
|
||||
struct wlr_seat *seat;
|
||||
struct wl_listener new_input, request_cursor, request_set_selection;
|
||||
struct wl_list keyboards;
|
||||
|
||||
struct wlr_output_layout *output_layout;
|
||||
struct wl_list outputs;
|
||||
struct wl_listener new_output;
|
||||
|
||||
/* glassmorphism layers */
|
||||
struct wlr_scene_tree *layer_bg; /* sharp wallpaper */
|
||||
struct wlr_scene_tree *layer_apps; /* client windows */
|
||||
struct wlr_scene_tree *layer_ui; /* glass home UI */
|
||||
struct aero_image wallpaper; /* loaded source */
|
||||
struct aero_image blurred_full; /* per-output blurred backdrop */
|
||||
struct wlr_scene_buffer *ui_node;
|
||||
int ui_w, ui_h;
|
||||
struct wl_event_source *clock_timer;
|
||||
};
|
||||
|
||||
struct aero_output {
|
||||
struct wl_list link;
|
||||
struct aero_server *server;
|
||||
struct wlr_output *wlr_output;
|
||||
struct wl_listener frame, destroy;
|
||||
};
|
||||
|
||||
struct aero_toplevel {
|
||||
struct wl_list link;
|
||||
struct aero_server *server;
|
||||
struct wlr_xdg_toplevel *xdg_toplevel;
|
||||
struct wlr_scene_tree *scene_tree;
|
||||
struct wl_listener map, unmap, commit, destroy;
|
||||
struct wl_listener request_move, request_resize;
|
||||
};
|
||||
|
||||
struct aero_keyboard {
|
||||
struct wl_list link;
|
||||
struct aero_server *server;
|
||||
struct wlr_keyboard *wlr_keyboard;
|
||||
struct wl_listener modifiers, key, destroy;
|
||||
};
|
||||
|
||||
/* ----------------------------------------------------------------- helpers */
|
||||
static void spawn(const char *cmd) {
|
||||
if (fork() == 0) {
|
||||
setsid();
|
||||
execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL);
|
||||
_exit(127);
|
||||
}
|
||||
}
|
||||
|
||||
static void focus_toplevel(struct aero_toplevel *toplevel) {
|
||||
if (!toplevel) return;
|
||||
struct aero_server *server = toplevel->server;
|
||||
struct wlr_seat *seat = server->seat;
|
||||
struct wlr_surface *surface = toplevel->xdg_toplevel->base->surface;
|
||||
struct wlr_surface *prev = seat->keyboard_state.focused_surface;
|
||||
if (prev == surface) return;
|
||||
if (prev) {
|
||||
struct wlr_xdg_toplevel *pt = wlr_xdg_toplevel_try_from_wlr_surface(prev);
|
||||
if (pt) wlr_xdg_toplevel_set_activated(pt, false);
|
||||
}
|
||||
struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat);
|
||||
wlr_scene_node_raise_to_top(&toplevel->scene_tree->node);
|
||||
wl_list_remove(&toplevel->link);
|
||||
wl_list_insert(&server->toplevels, &toplevel->link);
|
||||
wlr_xdg_toplevel_set_activated(toplevel->xdg_toplevel, true);
|
||||
if (kb)
|
||||
wlr_seat_keyboard_notify_enter(seat, surface, kb->keycodes,
|
||||
kb->num_keycodes, &kb->modifiers);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------- glass UI build/refresh */
|
||||
static void refresh_clock(struct aero_server *s);
|
||||
|
||||
static void build_ui_for_output(struct aero_server *s, int W, int H) {
|
||||
/* (Re)build the blurred backdrop + glass UI sized to the output. */
|
||||
if (s->blurred_full.data) aero_image_free(&s->blurred_full);
|
||||
|
||||
struct aero_image cover;
|
||||
if (aero_image_cover(&s->wallpaper, W, H, &cover) != 0) return;
|
||||
|
||||
/* background: sharp wallpaper */
|
||||
struct aero_buffer *bgbuf = aero_buffer_from_image(&cover); /* consumes cover */
|
||||
if (bgbuf) {
|
||||
struct wlr_scene_buffer *bg =
|
||||
wlr_scene_buffer_create(s->layer_bg, &bgbuf->base);
|
||||
wlr_scene_node_set_position(&bg->node, 0, 0);
|
||||
wlr_buffer_drop(&bgbuf->base);
|
||||
}
|
||||
|
||||
/* frosted backdrop: blurred cover (re-make cover since consumed) */
|
||||
struct aero_image cover2;
|
||||
if (aero_image_cover(&s->wallpaper, W, H, &cover2) == 0) {
|
||||
s->blurred_full.width = cover2.width;
|
||||
s->blurred_full.height = cover2.height;
|
||||
s->blurred_full.stride = cover2.stride;
|
||||
s->blurred_full.data = aero_blur_copy(cover2.data, cover2.width,
|
||||
cover2.height, cover2.stride, 14, 3);
|
||||
aero_image_free(&cover2);
|
||||
}
|
||||
|
||||
s->ui_w = W; s->ui_h = H;
|
||||
refresh_clock(s);
|
||||
}
|
||||
|
||||
static int clock_tick(void *data) {
|
||||
struct aero_server *s = data;
|
||||
refresh_clock(s);
|
||||
/* re-arm the same timer (every 30s) instead of leaking a new source */
|
||||
if (s->clock_timer)
|
||||
wl_event_source_timer_update(s->clock_timer, 30000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void refresh_clock(struct aero_server *s) {
|
||||
if (!s->blurred_full.data || s->ui_w == 0) return;
|
||||
char ct[64], dt[64];
|
||||
time_t t = time(NULL);
|
||||
struct tm tmv; localtime_r(&t, &tmv);
|
||||
strftime(ct, sizeof ct, "<b>%H:%M</b>", &tmv);
|
||||
strftime(dt, sizeof dt, "%A, %d %B %Y", &tmv);
|
||||
|
||||
struct aero_image ui;
|
||||
if (aero_panel_render(&s->blurred_full, s->ui_w, s->ui_h, ct, dt, &ui) != 0)
|
||||
return;
|
||||
struct aero_buffer *uibuf = aero_buffer_from_image(&ui); /* consumes ui */
|
||||
if (!uibuf) return;
|
||||
if (s->ui_node) {
|
||||
wlr_scene_buffer_set_buffer(s->ui_node, &uibuf->base);
|
||||
} else {
|
||||
s->ui_node = wlr_scene_buffer_create(s->layer_ui, &uibuf->base);
|
||||
wlr_scene_node_set_position(&s->ui_node->node, 0, 0);
|
||||
}
|
||||
wlr_buffer_drop(&uibuf->base);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- output */
|
||||
static void output_frame(struct wl_listener *listener, void *data) {
|
||||
struct aero_output *output = wl_container_of(listener, output, frame);
|
||||
struct wlr_scene *scene = output->server->scene;
|
||||
struct wlr_scene_output *so =
|
||||
wlr_scene_get_scene_output(scene, output->wlr_output);
|
||||
wlr_scene_output_commit(so, NULL);
|
||||
struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
wlr_scene_output_send_frame_done(so, &now);
|
||||
}
|
||||
|
||||
static void output_destroy(struct wl_listener *listener, void *data) {
|
||||
struct aero_output *output = wl_container_of(listener, output, destroy);
|
||||
wl_list_remove(&output->frame.link);
|
||||
wl_list_remove(&output->destroy.link);
|
||||
wl_list_remove(&output->link);
|
||||
free(output);
|
||||
}
|
||||
|
||||
static void server_new_output(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, new_output);
|
||||
struct wlr_output *wlr_output = data;
|
||||
wlr_output_init_render(wlr_output, server->allocator, server->renderer);
|
||||
|
||||
struct wlr_output_state state;
|
||||
wlr_output_state_init(&state);
|
||||
wlr_output_state_set_enabled(&state, true);
|
||||
struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
|
||||
if (mode) wlr_output_state_set_mode(&state, mode);
|
||||
wlr_output_commit_state(wlr_output, &state);
|
||||
wlr_output_state_finish(&state);
|
||||
|
||||
struct aero_output *output = calloc(1, sizeof(*output));
|
||||
output->wlr_output = wlr_output;
|
||||
output->server = server;
|
||||
output->frame.notify = output_frame;
|
||||
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
||||
output->destroy.notify = output_destroy;
|
||||
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
|
||||
wl_list_insert(&server->outputs, &output->link);
|
||||
|
||||
struct wlr_output_layout_output *lo =
|
||||
wlr_output_layout_add_auto(server->output_layout, wlr_output);
|
||||
struct wlr_scene_output *scene_output =
|
||||
wlr_scene_output_create(server->scene, wlr_output);
|
||||
wlr_scene_output_layout_add_output(server->scene_layout, lo, scene_output);
|
||||
|
||||
/* Build the Aero home UI sized to this output. */
|
||||
int W = wlr_output->width, H = wlr_output->height;
|
||||
if (W > 0 && H > 0) build_ui_for_output(server, W, H);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- xdg shell */
|
||||
static void xdg_toplevel_map(struct wl_listener *listener, void *data) {
|
||||
struct aero_toplevel *t = wl_container_of(listener, t, map);
|
||||
wl_list_insert(&t->server->toplevels, &t->link);
|
||||
focus_toplevel(t);
|
||||
}
|
||||
static void xdg_toplevel_unmap(struct wl_listener *listener, void *data) {
|
||||
struct aero_toplevel *t = wl_container_of(listener, t, unmap);
|
||||
wl_list_remove(&t->link);
|
||||
}
|
||||
static void xdg_toplevel_commit(struct wl_listener *listener, void *data) {
|
||||
struct aero_toplevel *t = wl_container_of(listener, t, commit);
|
||||
if (t->xdg_toplevel->base->initial_commit)
|
||||
wlr_xdg_toplevel_set_size(t->xdg_toplevel, 0, 0);
|
||||
}
|
||||
static void xdg_toplevel_destroy(struct wl_listener *listener, void *data) {
|
||||
struct aero_toplevel *t = wl_container_of(listener, t, destroy);
|
||||
wl_list_remove(&t->map.link);
|
||||
wl_list_remove(&t->unmap.link);
|
||||
wl_list_remove(&t->commit.link);
|
||||
wl_list_remove(&t->destroy.link);
|
||||
free(t);
|
||||
}
|
||||
|
||||
static void server_new_xdg_toplevel(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, new_xdg_toplevel);
|
||||
struct wlr_xdg_toplevel *xdg_toplevel = data;
|
||||
|
||||
struct aero_toplevel *t = calloc(1, sizeof(*t));
|
||||
t->server = server;
|
||||
t->xdg_toplevel = xdg_toplevel;
|
||||
/* client windows live in the apps layer (above wallpaper, below glass UI) */
|
||||
t->scene_tree = wlr_scene_xdg_surface_create(server->layer_apps,
|
||||
xdg_toplevel->base);
|
||||
t->scene_tree->node.data = t;
|
||||
xdg_toplevel->base->data = t->scene_tree;
|
||||
|
||||
t->map.notify = xdg_toplevel_map; wl_signal_add(&xdg_toplevel->base->surface->events.map, &t->map);
|
||||
t->unmap.notify = xdg_toplevel_unmap; wl_signal_add(&xdg_toplevel->base->surface->events.unmap, &t->unmap);
|
||||
t->commit.notify = xdg_toplevel_commit; wl_signal_add(&xdg_toplevel->base->surface->events.commit, &t->commit);
|
||||
t->destroy.notify = xdg_toplevel_destroy; wl_signal_add(&xdg_toplevel->events.destroy, &t->destroy);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- input */
|
||||
static void keyboard_handle_modifiers(struct wl_listener *listener, void *data) {
|
||||
struct aero_keyboard *kb = wl_container_of(listener, kb, modifiers);
|
||||
wlr_seat_set_keyboard(kb->server->seat, kb->wlr_keyboard);
|
||||
wlr_seat_keyboard_notify_modifiers(kb->server->seat,
|
||||
&kb->wlr_keyboard->modifiers);
|
||||
}
|
||||
|
||||
static bool handle_keybinding(struct aero_server *server, xkb_keysym_t sym) {
|
||||
switch (sym) {
|
||||
case XKB_KEY_Escape: /* Super+Esc quits compositor */
|
||||
wl_display_terminate(server->wl_display);
|
||||
return true;
|
||||
case XKB_KEY_Return: /* Super+Return: terminal */
|
||||
spawn("foot || alacritty || xterm");
|
||||
return true;
|
||||
case XKB_KEY_d: /* Super+d: launcher */
|
||||
spawn("wofi --show drun || fuzzel || bemenu-run");
|
||||
return true;
|
||||
case XKB_KEY_m: /* Super+m: toggle music */
|
||||
spawn("systemctl --user is-active aero-lofi && systemctl --user stop aero-lofi || systemctl --user start aero-lofi");
|
||||
return true;
|
||||
case XKB_KEY_q: { /* Super+q: close focused window */
|
||||
struct aero_toplevel *t;
|
||||
if (!wl_list_empty(&server->toplevels)) {
|
||||
t = wl_container_of(server->toplevels.next, t, link);
|
||||
wlr_xdg_toplevel_send_close(t->xdg_toplevel);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void keyboard_handle_key(struct wl_listener *listener, void *data) {
|
||||
struct aero_keyboard *kb = wl_container_of(listener, kb, key);
|
||||
struct aero_server *server = kb->server;
|
||||
struct wlr_keyboard_key_event *event = data;
|
||||
uint32_t keycode = event->keycode + 8;
|
||||
const xkb_keysym_t *syms;
|
||||
int nsyms = xkb_state_key_get_syms(kb->wlr_keyboard->xkb_state, keycode, &syms);
|
||||
bool handled = false;
|
||||
uint32_t mods = wlr_keyboard_get_modifiers(kb->wlr_keyboard);
|
||||
if ((mods & WLR_MODIFIER_LOGO) && event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
|
||||
for (int i = 0; i < nsyms; i++)
|
||||
handled |= handle_keybinding(server, syms[i]);
|
||||
if (!handled) {
|
||||
wlr_seat_set_keyboard(server->seat, kb->wlr_keyboard);
|
||||
wlr_seat_keyboard_notify_key(server->seat, event->time_msec,
|
||||
event->keycode, event->state);
|
||||
}
|
||||
}
|
||||
|
||||
static void keyboard_handle_destroy(struct wl_listener *listener, void *data) {
|
||||
struct aero_keyboard *kb = wl_container_of(listener, kb, destroy);
|
||||
wl_list_remove(&kb->modifiers.link);
|
||||
wl_list_remove(&kb->key.link);
|
||||
wl_list_remove(&kb->destroy.link);
|
||||
wl_list_remove(&kb->link);
|
||||
free(kb);
|
||||
}
|
||||
|
||||
static void server_new_keyboard(struct aero_server *server,
|
||||
struct wlr_input_device *device) {
|
||||
struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device);
|
||||
struct aero_keyboard *kb = calloc(1, sizeof(*kb));
|
||||
kb->server = server; kb->wlr_keyboard = wlr_keyboard;
|
||||
|
||||
struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
struct xkb_keymap *keymap = xkb_keymap_new_from_names(ctx, NULL,
|
||||
XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
wlr_keyboard_set_keymap(wlr_keyboard, keymap);
|
||||
xkb_keymap_unref(keymap);
|
||||
xkb_context_unref(ctx);
|
||||
wlr_keyboard_set_repeat_info(wlr_keyboard, 25, 600);
|
||||
|
||||
kb->modifiers.notify = keyboard_handle_modifiers;
|
||||
wl_signal_add(&wlr_keyboard->events.modifiers, &kb->modifiers);
|
||||
kb->key.notify = keyboard_handle_key;
|
||||
wl_signal_add(&wlr_keyboard->events.key, &kb->key);
|
||||
kb->destroy.notify = keyboard_handle_destroy;
|
||||
wl_signal_add(&device->events.destroy, &kb->destroy);
|
||||
|
||||
wlr_seat_set_keyboard(server->seat, wlr_keyboard);
|
||||
wl_list_insert(&server->keyboards, &kb->link);
|
||||
}
|
||||
|
||||
static void server_new_input(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, new_input);
|
||||
struct wlr_input_device *device = data;
|
||||
if (device->type == WLR_INPUT_DEVICE_KEYBOARD)
|
||||
server_new_keyboard(server, device);
|
||||
else if (device->type == WLR_INPUT_DEVICE_POINTER)
|
||||
wlr_cursor_attach_input_device(server->cursor, device);
|
||||
uint32_t caps = WL_SEAT_CAPABILITY_POINTER;
|
||||
if (!wl_list_empty(&server->keyboards)) caps |= WL_SEAT_CAPABILITY_KEYBOARD;
|
||||
wlr_seat_set_capabilities(server->seat, caps);
|
||||
}
|
||||
|
||||
static void cursor_motion_abs(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, cursor_motion_absolute);
|
||||
struct wlr_pointer_motion_absolute_event *e = data;
|
||||
wlr_cursor_warp_absolute(server->cursor, &e->pointer->base, e->x, e->y);
|
||||
wlr_seat_pointer_notify_frame(server->seat);
|
||||
}
|
||||
static void cursor_motion(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, cursor_motion);
|
||||
struct wlr_pointer_motion_event *e = data;
|
||||
wlr_cursor_move(server->cursor, &e->pointer->base, e->delta_x, e->delta_y);
|
||||
wlr_seat_pointer_notify_frame(server->seat);
|
||||
}
|
||||
static void cursor_button(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, cursor_button);
|
||||
struct wlr_pointer_button_event *e = data;
|
||||
wlr_seat_pointer_notify_button(server->seat, e->time_msec, e->button, e->state);
|
||||
}
|
||||
static void cursor_axis(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, cursor_axis);
|
||||
struct wlr_pointer_axis_event *e = data;
|
||||
wlr_seat_pointer_notify_axis(server->seat, e->time_msec, e->orientation,
|
||||
e->delta, e->delta_discrete, e->source, e->relative_direction);
|
||||
}
|
||||
static void cursor_frame(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, cursor_frame);
|
||||
wlr_seat_pointer_notify_frame(server->seat);
|
||||
}
|
||||
static void seat_request_cursor(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, request_cursor);
|
||||
struct wlr_seat_pointer_request_set_cursor_event *e = data;
|
||||
if (e->seat_client == server->seat->pointer_state.focused_client)
|
||||
wlr_cursor_set_surface(server->cursor, e->surface, e->hotspot_x, e->hotspot_y);
|
||||
}
|
||||
static void seat_request_selection(struct wl_listener *listener, void *data) {
|
||||
struct aero_server *server = wl_container_of(listener, server, request_set_selection);
|
||||
struct wlr_seat_request_set_selection_event *e = data;
|
||||
wlr_seat_set_selection(server->seat, e->source, e->serial);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- main */
|
||||
int main(int argc, char *argv[]) {
|
||||
wlr_log_init(WLR_INFO, NULL);
|
||||
const char *startup_cmd = NULL;
|
||||
int c;
|
||||
while ((c = getopt(argc, argv, "s:h")) != -1) {
|
||||
if (c == 's') startup_cmd = optarg;
|
||||
else { printf("usage: %s [-s startup-command]\n", argv[0]); return 0; }
|
||||
}
|
||||
|
||||
struct aero_server server = {0};
|
||||
server.wl_display = wl_display_create();
|
||||
server.backend = wlr_backend_autocreate(
|
||||
wl_display_get_event_loop(server.wl_display), NULL);
|
||||
server.renderer = wlr_renderer_autocreate(server.backend);
|
||||
wlr_renderer_init_wl_display(server.renderer, server.wl_display);
|
||||
server.allocator = wlr_allocator_autocreate(server.backend, server.renderer);
|
||||
|
||||
wlr_compositor_create(server.wl_display, 5, server.renderer);
|
||||
wlr_subcompositor_create(server.wl_display);
|
||||
wlr_data_device_manager_create(server.wl_display);
|
||||
|
||||
server.output_layout = wlr_output_layout_create(server.wl_display);
|
||||
wl_list_init(&server.outputs);
|
||||
server.new_output.notify = server_new_output;
|
||||
wl_signal_add(&server.backend->events.new_output, &server.new_output);
|
||||
|
||||
server.scene = wlr_scene_create();
|
||||
server.scene_layout = wlr_scene_attach_output_layout(server.scene,
|
||||
server.output_layout);
|
||||
/* three stacked layers: wallpaper < apps < glass UI */
|
||||
server.layer_bg = wlr_scene_tree_create(&server.scene->tree);
|
||||
server.layer_apps = wlr_scene_tree_create(&server.scene->tree);
|
||||
server.layer_ui = wlr_scene_tree_create(&server.scene->tree);
|
||||
|
||||
/* load the wallpaper */
|
||||
const char *wp = getenv("AEROWM_WALLPAPER");
|
||||
if (!wp) wp = "/usr/share/backgrounds/aeros/frutiger-aero.png";
|
||||
if (aero_image_load_png(wp, &server.wallpaper) != 0)
|
||||
wlr_log(WLR_ERROR, "could not load wallpaper %s", wp);
|
||||
|
||||
wl_list_init(&server.toplevels);
|
||||
server.xdg_shell = wlr_xdg_shell_create(server.wl_display, 3);
|
||||
server.new_xdg_toplevel.notify = server_new_xdg_toplevel;
|
||||
wl_signal_add(&server.xdg_shell->events.new_toplevel, &server.new_xdg_toplevel);
|
||||
|
||||
server.cursor = wlr_cursor_create();
|
||||
wlr_cursor_attach_output_layout(server.cursor, server.output_layout);
|
||||
server.cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
||||
server.cursor_mode = CURSOR_PASSTHROUGH;
|
||||
server.cursor_motion.notify = cursor_motion;
|
||||
wl_signal_add(&server.cursor->events.motion, &server.cursor_motion);
|
||||
server.cursor_motion_absolute.notify = cursor_motion_abs;
|
||||
wl_signal_add(&server.cursor->events.motion_absolute, &server.cursor_motion_absolute);
|
||||
server.cursor_button.notify = cursor_button;
|
||||
wl_signal_add(&server.cursor->events.button, &server.cursor_button);
|
||||
server.cursor_axis.notify = cursor_axis;
|
||||
wl_signal_add(&server.cursor->events.axis, &server.cursor_axis);
|
||||
server.cursor_frame.notify = cursor_frame;
|
||||
wl_signal_add(&server.cursor->events.frame, &server.cursor_frame);
|
||||
|
||||
wl_list_init(&server.keyboards);
|
||||
server.new_input.notify = server_new_input;
|
||||
wl_signal_add(&server.backend->events.new_input, &server.new_input);
|
||||
server.seat = wlr_seat_create(server.wl_display, "seat0");
|
||||
server.request_cursor.notify = seat_request_cursor;
|
||||
wl_signal_add(&server.seat->events.request_set_cursor, &server.request_cursor);
|
||||
server.request_set_selection.notify = seat_request_selection;
|
||||
wl_signal_add(&server.seat->events.request_set_selection, &server.request_set_selection);
|
||||
|
||||
const char *socket = wl_display_add_socket_auto(server.wl_display);
|
||||
if (!socket) { wlr_backend_destroy(server.backend); return 1; }
|
||||
if (!wlr_backend_start(server.backend)) {
|
||||
wlr_backend_destroy(server.backend);
|
||||
wl_display_destroy(server.wl_display);
|
||||
return 1;
|
||||
}
|
||||
setenv("WAYLAND_DISPLAY", socket, true);
|
||||
wlr_log(WLR_INFO, "AeroOS compositor running on WAYLAND_DISPLAY=%s", socket);
|
||||
|
||||
/* clock updater */
|
||||
struct wl_event_source *timer =
|
||||
wl_event_loop_add_timer(wl_display_get_event_loop(server.wl_display),
|
||||
clock_tick, &server);
|
||||
server.clock_timer = timer;
|
||||
wl_event_source_timer_update(timer, 1000);
|
||||
|
||||
/* autostart: lofi + optional session command */
|
||||
spawn("systemctl --user start aero-lofi.service 2>/dev/null || "
|
||||
"aero-lofi &");
|
||||
if (startup_cmd) spawn(startup_cmd);
|
||||
|
||||
wl_display_run(server.wl_display);
|
||||
|
||||
wl_display_destroy_clients(server.wl_display);
|
||||
wlr_scene_node_destroy(&server.scene->tree.node);
|
||||
wlr_allocator_destroy(server.allocator);
|
||||
wlr_renderer_destroy(server.renderer);
|
||||
wlr_backend_destroy(server.backend);
|
||||
wl_display_destroy(server.wl_display);
|
||||
aero_image_free(&server.wallpaper);
|
||||
aero_image_free(&server.blurred_full);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/* aerowm — glassmorphism home UI (top bar, welcome card, dock) via cairo/pango.
|
||||
*
|
||||
* Glassmorphism recipe used here:
|
||||
* 1. clip to the rounded panel rectangle
|
||||
* 2. paint the pre-blurred wallpaper inside it (the "frost")
|
||||
* 3. lay a translucent white gradient over it (the "glass")
|
||||
* 4. add a 1px top highlight + subtle outer border (the "edge light")
|
||||
* 5. draw content (text/icons) on top
|
||||
*/
|
||||
#include "panel.h"
|
||||
#include <cairo/cairo.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
static void rounded_rect(cairo_t *cr, double x, double y, double w, double h, double r) {
|
||||
const double d = 3.14159265358979323846 / 180.0;
|
||||
cairo_new_sub_path(cr);
|
||||
cairo_arc(cr, x + w - r, y + r, r, -90 * d, 0 * d);
|
||||
cairo_arc(cr, x + w - r, y + h - r, r, 0 * d, 90 * d);
|
||||
cairo_arc(cr, x + r, y + h - r, r, 90 * d, 180 * d);
|
||||
cairo_arc(cr, x + r, y + r, r, 180 * d, 270 * d);
|
||||
cairo_close_path(cr);
|
||||
}
|
||||
|
||||
/* Paint one frosted-glass tile at (x,y,w,h) using the blurred backdrop. */
|
||||
static void glass_tile(cairo_t *cr, cairo_surface_t *blur_surf,
|
||||
double x, double y, double w, double h, double radius,
|
||||
double tint_top, double tint_bot) {
|
||||
cairo_save(cr);
|
||||
rounded_rect(cr, x, y, w, h, radius);
|
||||
cairo_clip(cr);
|
||||
|
||||
/* 1+2: frosted backdrop (blurred wallpaper, aligned to screen space) */
|
||||
cairo_set_source_surface(cr, blur_surf, 0, 0);
|
||||
cairo_paint(cr);
|
||||
|
||||
/* 3: translucent white gradient = the glass body */
|
||||
cairo_pattern_t *g = cairo_pattern_create_linear(x, y, x, y + h);
|
||||
cairo_pattern_add_color_stop_rgba(g, 0.0, 1, 1, 1, tint_top);
|
||||
cairo_pattern_add_color_stop_rgba(g, 1.0, 1, 1, 1, tint_bot);
|
||||
cairo_set_source(cr, g);
|
||||
cairo_paint(cr);
|
||||
cairo_pattern_destroy(g);
|
||||
|
||||
/* a faint aero cyan sheen down the left to evoke Frutiger glass */
|
||||
cairo_pattern_t *sheen = cairo_pattern_create_linear(x, y, x + w, y);
|
||||
cairo_pattern_add_color_stop_rgba(sheen, 0.0, 0.55, 0.85, 1.0, 0.18);
|
||||
cairo_pattern_add_color_stop_rgba(sheen, 0.4, 0.55, 0.85, 1.0, 0.0);
|
||||
cairo_set_source(cr, sheen);
|
||||
cairo_paint(cr);
|
||||
cairo_pattern_destroy(sheen);
|
||||
cairo_restore(cr);
|
||||
|
||||
/* 4: edge light — bright 1px inner top, soft outer border */
|
||||
cairo_save(cr);
|
||||
rounded_rect(cr, x + 0.5, y + 0.5, w - 1, h - 1, radius);
|
||||
cairo_set_line_width(cr, 1.0);
|
||||
cairo_set_source_rgba(cr, 1, 1, 1, 0.55);
|
||||
cairo_stroke(cr);
|
||||
cairo_restore(cr);
|
||||
}
|
||||
|
||||
static void draw_text(cairo_t *cr, const char *markup, const char *font,
|
||||
double x, double y, double max_w, PangoAlignment align,
|
||||
double r, double g, double b, double a) {
|
||||
PangoLayout *layout = pango_cairo_create_layout(cr);
|
||||
PangoFontDescription *desc = pango_font_description_from_string(font);
|
||||
pango_layout_set_font_description(layout, desc);
|
||||
pango_font_description_free(desc);
|
||||
pango_layout_set_markup(layout, markup, -1);
|
||||
if (max_w > 0) { pango_layout_set_width(layout, (int)(max_w * PANGO_SCALE));
|
||||
pango_layout_set_alignment(layout, align); }
|
||||
cairo_move_to(cr, x, y);
|
||||
cairo_set_source_rgba(cr, r, g, b, a);
|
||||
pango_cairo_show_layout(cr, layout);
|
||||
g_object_unref(layout);
|
||||
}
|
||||
|
||||
int aero_panel_render(const struct aero_image *blurred, int W, int H,
|
||||
const char *clock_text, const char *date_text,
|
||||
struct aero_image *out) {
|
||||
cairo_surface_t *dst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, W, H);
|
||||
if (cairo_surface_status(dst) != CAIRO_STATUS_SUCCESS) return -1;
|
||||
|
||||
cairo_surface_t *blur_surf = cairo_image_surface_create_for_data(
|
||||
(unsigned char *)blurred->data, CAIRO_FORMAT_ARGB32,
|
||||
blurred->width, blurred->height, blurred->stride * 4);
|
||||
|
||||
cairo_t *cr = cairo_create(dst);
|
||||
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_set_source_rgba(cr, 0, 0, 0, 0); /* fully transparent base */
|
||||
cairo_paint(cr);
|
||||
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
|
||||
|
||||
const double M = 16; /* screen margin */
|
||||
const double barH = 40;
|
||||
|
||||
/* ---- top bar -------------------------------------------------------- */
|
||||
glass_tile(cr, blur_surf, M, M, W - 2 * M, barH, 14, 0.42, 0.20);
|
||||
draw_text(cr, "<b>✦ AeroOS</b>", "Sans 13", M + 18, M + 9, 0,
|
||||
PANGO_ALIGN_LEFT, 1, 1, 1, 0.95);
|
||||
if (clock_text)
|
||||
draw_text(cr, clock_text, "Sans 13", W - 2 * M - 160, M + 9, 144,
|
||||
PANGO_ALIGN_RIGHT, 1, 1, 1, 0.95);
|
||||
|
||||
/* ---- centered welcome card ----------------------------------------- */
|
||||
double cw = 460, ch = 200;
|
||||
double cx = (W - cw) / 2.0, cy = (H - ch) / 2.0 - 30;
|
||||
glass_tile(cr, blur_surf, cx, cy, cw, ch, 22, 0.34, 0.16);
|
||||
draw_text(cr, "<span size='28000' weight='bold'>Welcome to AeroOS</span>",
|
||||
"Sans", cx, cy + 34, cw, PANGO_ALIGN_CENTER, 1, 1, 1, 0.97);
|
||||
draw_text(cr, "<span size='12000'>Frutiger Aero • glassmorphism • lofi</span>",
|
||||
"Sans", cx, cy + 84, cw, PANGO_ALIGN_CENTER, 0.92, 0.97, 1.0, 0.9);
|
||||
if (date_text)
|
||||
draw_text(cr, date_text, "Sans 11", cx, cy + 130, cw,
|
||||
PANGO_ALIGN_CENTER, 1, 1, 1, 0.8);
|
||||
draw_text(cr, "<span size='10000'>♪ lofi is playing — press Super+Return for a terminal</span>",
|
||||
"Sans", cx, cy + 158, cw, PANGO_ALIGN_CENTER, 0.85, 0.95, 1.0, 0.85);
|
||||
|
||||
/* ---- bottom dock hint ---------------------------------------------- */
|
||||
double dw = 360, dh = 56;
|
||||
glass_tile(cr, blur_surf, (W - dw) / 2.0, H - dh - M, dw, dh, 18, 0.40, 0.18);
|
||||
|
||||
cairo_destroy(cr);
|
||||
cairo_surface_flush(dst);
|
||||
|
||||
int stride_px = cairo_image_surface_get_stride(dst) / 4;
|
||||
out->width = W; out->height = H; out->stride = stride_px;
|
||||
out->data = malloc((size_t)stride_px * H * sizeof(uint32_t));
|
||||
if (out->data)
|
||||
memcpy(out->data, cairo_image_surface_get_data(dst),
|
||||
(size_t)stride_px * H * sizeof(uint32_t));
|
||||
|
||||
cairo_surface_destroy(blur_surf);
|
||||
cairo_surface_destroy(dst);
|
||||
return out->data ? 0 : -1;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/* aerowm — glassmorphism panel/cards rendered with cairo + pango. */
|
||||
#ifndef AEROWM_PANEL_H
|
||||
#define AEROWM_PANEL_H
|
||||
|
||||
#include "image.h"
|
||||
|
||||
/* Render the AeroOS home-screen glass UI onto a transparent ARGB buffer the
|
||||
* size of the output. `blurred` is a full-screen pre-blurred wallpaper used to
|
||||
* give panels a real frosted backdrop. The result is composited on top of the
|
||||
* sharp wallpaper by the compositor.
|
||||
*
|
||||
* Draws:
|
||||
* - a frosted top bar with the AeroOS mark + live clock
|
||||
* - a centered translucent "welcome" glass card
|
||||
* - a frosted dock hint at the bottom
|
||||
*/
|
||||
int aero_panel_render(const struct aero_image *blurred,
|
||||
int out_w, int out_h,
|
||||
const char *clock_text,
|
||||
const char *date_text,
|
||||
struct aero_image *out);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
# AeroOS design notes
|
||||
|
||||
## What "from scratch" means here
|
||||
AeroOS is built with the **Linux From Scratch** method: a cross toolchain is
|
||||
compiled, then every package is built from upstream source into a clean root
|
||||
filesystem. There is **no Debian/Arch/Fedora base**. The only pre-existing thing
|
||||
reused is the host's compiler to bootstrap the cross-compiler (standard LFS).
|
||||
|
||||
Pipeline: `cross toolchain → temporary tools → chroot → final base → kernel →
|
||||
systemd/boot → Wayland desktop → Aero theme → live ISO`.
|
||||
|
||||
## Glassmorphism: how the frosted glass is actually produced
|
||||
A full per-frame screen blur is expensive and hard to wire into the wlroots
|
||||
scene graph. `aerowm` instead uses a **pre-blurred wallpaper** technique that is
|
||||
both authentic and cheap:
|
||||
|
||||
1. The wallpaper is cover-scaled to the output (`image.c`).
|
||||
2. A **blurred copy** is produced once with a separable box blur run 3× to
|
||||
approximate a Gaussian (`blur.c`, O(n) sliding-window per row).
|
||||
3. The glass UI (`panel.c`) is drawn with cairo: for each panel it **clips to a
|
||||
rounded rect, paints the blurred wallpaper inside it**, lays a translucent
|
||||
white gradient + a cyan sheen on top, then a 1px edge highlight. That is the
|
||||
frosted-glass look.
|
||||
4. Layers are stacked in the scene graph: `wallpaper (sharp) < apps < glass UI`.
|
||||
|
||||
Result: real frosted translucency where the blurred background shows through the
|
||||
panels, the welcome card and the dock — the classic Frutiger Aero glass.
|
||||
|
||||
The CPU-rendered cairo buffers are handed to wlroots via a tiny custom
|
||||
`wlr_buffer` (`aero_buffer` in `main.c`) so they live directly in the scene
|
||||
graph and are composited by the (software/pixman) renderer.
|
||||
|
||||
## Why the pixman renderer
|
||||
The baseline uses wlroots' **pixman software renderer** (`-Drenderers=pixman`),
|
||||
which removes the Mesa + LLVM dependency for a first bootable image. The blur is
|
||||
CPU-side anyway. Hardware GL acceleration (Mesa) can be added later by switching
|
||||
wlroots to the GLES2 renderer and building mesa in `chroot-desktop.sh`.
|
||||
|
||||
## Audio / lofi
|
||||
`assets/lofi/generate_lofi.py` synthesizes a seamless ~27s lofi loop (jazzy
|
||||
keys + soft kick/hat + vinyl crackle + warm low-pass) using only the Python
|
||||
stdlib. It plays through **PipeWire** via `pw-play` in a loop, started by the
|
||||
`aero-lofi` user service that the compositor autostarts. Toggle with `Super+M`.
|
||||
|
||||
## Keybindings (aerowm)
|
||||
| Keys | Action |
|
||||
|----------------|---------------------------------|
|
||||
| `Super+Return` | terminal (`foot`/`alacritty`) |
|
||||
| `Super+D` | launcher (`wofi`/`fuzzel`) |
|
||||
| `Super+Q` | close focused window |
|
||||
| `Super+M` | toggle lofi |
|
||||
| `Super+Esc` | quit the compositor |
|
||||
|
||||
## Live ISO
|
||||
A busybox initramfs (`assets/live/init`) finds the medium by label, mounts the
|
||||
`LiveOS/aeros.squashfs`, layers a tmpfs via overlayfs and `switch_root`s into
|
||||
systemd. squashfs/overlay/iso9660/loop are built **into** the kernel
|
||||
(`config/kernel/aeros.config`) so the initramfs needs no modules. The hybrid
|
||||
BIOS+UEFI ISO is produced by `grub-mkrescue` (GRUB + xorriso + mtools, all
|
||||
built in-tree).
|
||||
|
||||
## Extending
|
||||
- Add a package: add it to `config/versions.sh`, add a `p_<name>` recipe to the
|
||||
relevant `packages/chroot-*.sh`, and a `once` line.
|
||||
- Swap the wallpaper: replace `assets/wallpaper/frutiger-aero.svg` (or change
|
||||
`gen_wallpaper.py`).
|
||||
- Replace the lofi track: drop a WAV at
|
||||
`/usr/share/aeros/lofi/aero-lofi.wav` or tweak the generator.
|
||||
Executable
+179
@@ -0,0 +1,179 @@
|
||||
#!/bin/bash
|
||||
# packages/chroot-base.sh — runs INSIDE the AeroOS chroot (no host access).
|
||||
# Builds the final base system (LFS ch. 8 essentials) from /sources.
|
||||
set -Eeuo pipefail
|
||||
export LC_ALL=POSIX MAKEFLAGS="${MAKEFLAGS:--j4}"
|
||||
# Many gnulib-based packages (coreutils, tar, findutils, gawk, sed, diffutils…)
|
||||
# refuse to ./configure as root unless this is set. The chroot build *is* root,
|
||||
# so allow it globally.
|
||||
export FORCE_UNSAFE_CONFIGURE=1
|
||||
SRC=/sources
|
||||
STAMPS=/root/.base-stamps; mkdir -p "$STAMPS"
|
||||
|
||||
say(){ printf '\n\e[1;36m== %s ==\e[0m\n' "$*"; }
|
||||
once(){ local n="$1"; shift; [[ -f "$STAMPS/$n" ]] && { echo "skip $n"; return; }; "$@"; touch "$STAMPS/$n"; }
|
||||
|
||||
# find <stem> -> path to first matching tarball in /sources
|
||||
find_tb(){ local m; shopt -s nocaseglob nullglob
|
||||
local a=("$SRC/$1"-[0-9]*.tar.*) b=("$SRC/$1"*.tar.*)
|
||||
shopt -u nocaseglob nullglob
|
||||
m="${a[0]:-${b[0]:-}}"
|
||||
[[ -n "$m" ]] || { echo "MISSING SOURCE: $1" >&2; return 1; }; echo "$m"; }
|
||||
# unp <stem> -> extracts, cds into the dir, echoes nothing
|
||||
unp(){ local tb d; tb=$(find_tb "$1"); cd /tmp; rm -rf bld-"$1"; mkdir bld-"$1"
|
||||
tar -xf "$tb" -C bld-"$1" --strip-components=1; cd bld-"$1"; }
|
||||
# std <stem> [configure args...] : standard autotools install
|
||||
std(){ local stem="$1"; shift; unp "$stem"
|
||||
./configure --prefix=/usr "$@"; make; make install; cd /; }
|
||||
|
||||
# ---- final glibc adjustments / locales -------------------------------------
|
||||
p_glibc(){ unp glibc
|
||||
# same OPEN_TREE_CLONE/-Werror fix as the cross glibc (see 01-toolchain.sh):
|
||||
# keep the linux/mount.h include, just guard the conflicting macros so we get
|
||||
# neither the macro-redefinition error nor a struct mount_attr double-def.
|
||||
sed -i -E 's@^#define (OPEN_TREE_CLONE|OPEN_TREE_CLOEXEC|FSOPEN_CLOEXEC)([ \t].*)?$@#ifndef \1\n#define \1\2\n#endif@' \
|
||||
sysdeps/unix/sysv/linux/sys/mount.h
|
||||
# glibc's post-install test-installation.pl links test programs with -lnsl
|
||||
# -lnss_dns etc., but glibc 2.34+ ships those deprecated compat libs without
|
||||
# .so linker symlinks, so the test (not the install) fails. Neuter it.
|
||||
echo 'exit 0;' > scripts/test-installation.pl
|
||||
mkdir -v build; cd build
|
||||
echo "rootsbindir=/usr/sbin" > configparms
|
||||
../configure --prefix=/usr --disable-werror --enable-kernel=5.4 \
|
||||
--enable-stack-protector=strong --disable-nscd libc_cv_slibdir=/usr/lib
|
||||
make; make install
|
||||
localedef -i C -f UTF-8 C.UTF-8 || true
|
||||
localedef -i en_US -f UTF-8 en_US.UTF-8 || true
|
||||
cd /; }
|
||||
|
||||
p_zlib(){ std zlib; rm -fv /usr/lib/libz.a; }
|
||||
p_bzip2(){ unp bzip2; make -f Makefile-libbz2_so; make clean
|
||||
make; make PREFIX=/usr install; cp -av libbz2.so.* /usr/lib
|
||||
ln -sfv libbz2.so.1.0 /usr/lib/libbz2.so; cp -v bzip2-shared /usr/bin/bzip2; cd /; }
|
||||
p_xz(){ std xz; rm -v /usr/lib/liblzma.la; }
|
||||
p_zstd(){ unp zstd; make prefix=/usr; make prefix=/usr install; rm -v /usr/lib/libzstd.a; cd /; }
|
||||
p_readline(){ unp readline
|
||||
./configure --prefix=/usr --with-curses --disable-static
|
||||
make SHLIB_LIBS="-lncursesw"
|
||||
make SHLIB_LIBS="-lncursesw" install
|
||||
cd /; }
|
||||
p_m4(){ std m4; }
|
||||
p_bc(){ unp bc
|
||||
CC='gcc -std=c99' ./configure --prefix=/usr -G -O3
|
||||
make; make install; cd /; }
|
||||
p_ncurses(){ std ncurses --mandir=/usr/share/man --with-shared --without-debug \
|
||||
--without-normal --without-cxx-binding --enable-pc-files --with-pkg-config-libdir=/usr/lib/pkgconfig
|
||||
ln -sfv libncursesw.so /usr/lib/libncurses.so; }
|
||||
p_bison(){ std bison; }
|
||||
p_flex(){ std flex --disable-static; }
|
||||
# bash 5.3 bundles readline 8.3 and uses 8.3-only hooks; link its bundled
|
||||
# readline rather than the older system readline (8.2.x) to avoid undefined
|
||||
# references like rl_completion_rewrite_hook.
|
||||
p_bash(){ std bash --without-bash-malloc; ln -sfv bash /bin/sh; }
|
||||
p_coreutils(){ unp coreutils; FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr --enable-no-install-program=kill,uptime
|
||||
make; make install; mv -v /usr/bin/chroot /usr/sbin 2>/dev/null || true; cd /; }
|
||||
p_diffutils(){ std diffutils; }
|
||||
p_gawk(){ std gawk; }
|
||||
p_findutils(){ std findutils --localstatedir=/var/lib/locate; }
|
||||
p_grep(){ std grep; }
|
||||
p_gzip(){ std gzip; }
|
||||
p_make(){ std make; }
|
||||
p_patch(){ std patch; }
|
||||
p_sed(){ std sed; }
|
||||
p_tar(){ std tar; }
|
||||
p_texinfo(){ std texinfo; }
|
||||
p_file(){ std file; rm -v /usr/lib/libmagic.la 2>/dev/null||true; }
|
||||
p_pkgconf(){ std pkgconf
|
||||
ln -sfv pkgconf /usr/bin/pkg-config 2>/dev/null || true; }
|
||||
p_gettext(){ std gettext --disable-shared; cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin 2>/dev/null||true; }
|
||||
p_perl(){ unp perl
|
||||
sh Configure -des -Dprefix=/usr -Dvendorprefix=/usr -Duseshrplib \
|
||||
-Dprivlib=/usr/lib/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl
|
||||
make; make install; cd /; }
|
||||
p_python(){ std python --enable-shared --without-ensurepip; }
|
||||
p_openssl(){ unp openssl; ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic
|
||||
make; make MANSUFFIX=ssl install; cd /; }
|
||||
p_kmod(){ std kmod --with-xz --with-zstd --with-openssl --disable-manpages
|
||||
for t in depmod insmod modinfo modprobe rmmod; do ln -sfv kmod /usr/bin/$t; done; }
|
||||
p_libcap(){ unp libcap; make prefix=/usr lib=lib; make prefix=/usr lib=lib install; cd /; }
|
||||
p_libxcrypt(){ std libxcrypt --enable-hashes=strong,glibc \
|
||||
--enable-obsolete-api=no --disable-static --disable-failure-tokens; }
|
||||
p_util_linux(){ unp util-linux
|
||||
./configure --libdir=/usr/lib --runstatedir=/run --disable-chfn-chsh \
|
||||
--disable-login --disable-nologin --disable-su --disable-setpriv \
|
||||
--disable-runuser --disable-pylibmount --disable-static \
|
||||
--disable-liblastlog2 \
|
||||
--without-python ADJTIME_PATH=/var/lib/hwclock/adjtime --docdir=/usr/share/doc/util-linux
|
||||
make; make install; cd /; }
|
||||
p_elfutils(){ std elfutils --disable-debuginfod --enable-libdebuginfod=dummy; }
|
||||
p_rsync(){ unp rsync
|
||||
./configure --prefix=/usr --with-included-popt --disable-md2man \
|
||||
--disable-roll-simd \
|
||||
--disable-openssl --disable-xxhash --disable-zstd --disable-lz4 \
|
||||
--disable-acl-support --disable-xattr-support --disable-iconv
|
||||
make; make install; cd /; }
|
||||
p_expat(){ std expat --without-docbook; }
|
||||
p_libffi(){ std libffi --disable-static --with-gcc-arch=native; }
|
||||
|
||||
# ---- final GCC (the system compiler) ---------------------------------------
|
||||
p_gcc(){ unp gcc
|
||||
tar -xf "$(find_tb mpfr)"; mv "$(ls -d mpfr-*)" mpfr
|
||||
tar -xf "$(find_tb gmp)"; mv "$(ls -d gmp-*)" gmp
|
||||
tar -xf "$(find_tb mpc)"; mv "$(ls -d mpc-*)" mpc
|
||||
case "$(uname -m)" in x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64;; esac
|
||||
mkdir -v build; cd build
|
||||
../configure --prefix=/usr LD=ld --enable-languages=c,c++ \
|
||||
--enable-default-pie --enable-default-ssp --enable-host-pie \
|
||||
--disable-multilib --disable-bootstrap --disable-fixincludes \
|
||||
--disable-libsanitizer --with-system-zlib
|
||||
make; make install
|
||||
ln -sfv ../usr/bin/cpp /usr/lib 2>/dev/null || true
|
||||
ln -sfv gcc /usr/bin/cc
|
||||
cd /; }
|
||||
|
||||
say "AeroOS final base system"
|
||||
# ---- bootstrap tools glibc (and others) need at build time --------------
|
||||
# glibc's configure requires bison + python; python wants zlib/bzip2/xz/
|
||||
# openssl/libffi modules, and openssl's Configure needs perl. Build these
|
||||
# against the existing (stage-01) glibc before rebuilding the final glibc.
|
||||
once b-m4 p_m4
|
||||
once b-zlib p_zlib
|
||||
once b-bzip2 p_bzip2
|
||||
once b-xz p_xz
|
||||
once b-bison p_bison
|
||||
once b-perl p_perl
|
||||
once b-openssl p_openssl
|
||||
once b-libffi p_libffi
|
||||
once b-python p_python
|
||||
once b-texinfo p_texinfo
|
||||
# ---- final glibc --------------------------------------------------------
|
||||
once b-glibc p_glibc
|
||||
# ---- remaining base system ----------------------------------------------
|
||||
once b-zstd p_zstd
|
||||
once b-readline-ncurses p_readline
|
||||
once b-bc p_bc
|
||||
once b-ncurses p_ncurses
|
||||
once b-bash p_bash
|
||||
once b-coreutils p_coreutils
|
||||
once b-diffutils p_diffutils
|
||||
once b-file p_file
|
||||
once b-findutils p_findutils
|
||||
once b-gawk p_gawk
|
||||
once b-grep p_grep
|
||||
once b-gzip p_gzip
|
||||
once b-make p_make
|
||||
once b-patch p_patch
|
||||
once b-sed p_sed
|
||||
once b-tar p_tar
|
||||
once b-flex p_flex
|
||||
once b-pkgconf p_pkgconf
|
||||
once b-gettext p_gettext
|
||||
once b-expat p_expat
|
||||
once b-libcap p_libcap
|
||||
once b-libxcrypt p_libxcrypt
|
||||
once b-util-linux p_util_linux
|
||||
once b-gcc p_gcc
|
||||
once b-kmod p_kmod
|
||||
once b-elfutils p_elfutils
|
||||
once b-rsync p_rsync
|
||||
echo "AeroOS base system build complete."
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# packages/chroot-buildtools.sh — bootstrap ninja + meson inside the chroot.
|
||||
# Needed by systemd and the whole Wayland/desktop stack. No pip required.
|
||||
set -Eeuo pipefail
|
||||
export LC_ALL=POSIX MAKEFLAGS="${MAKEFLAGS:--j4}"
|
||||
SRC=/sources; STAMPS=/root/.base-stamps; mkdir -p "$STAMPS"
|
||||
once(){ local n="$1"; shift; [[ -f "$STAMPS/$n" ]] && { echo "skip $n"; return; }; "$@"; touch "$STAMPS/$n"; }
|
||||
find_tb(){ local m; shopt -s nocaseglob nullglob; local a=("$SRC/$1"-[0-9]*.tar.*) b=("$SRC/$1"*.tar.*); shopt -u nocaseglob nullglob; m="${a[0]:-${b[0]:-}}"; [[ -n "$m" ]] || { echo "MISSING SOURCE: $1" >&2; return 1; }; echo "$m"; }
|
||||
unp(){ cd /tmp; rm -rf bld-"$1"; mkdir bld-"$1"; tar -xf "$(find_tb "$1")" -C bld-"$1" --strip-components=1; cd bld-"$1"; }
|
||||
|
||||
t_ninja(){ unp ninja; python3 configure.py --bootstrap; install -m755 ninja /usr/bin/ninja; cd /; }
|
||||
t_meson(){ unp meson
|
||||
# meson runs directly from source; install to /opt and symlink (no pip needed)
|
||||
rm -rf /opt/meson; mkdir -p /opt/meson; cp -a . /opt/meson/
|
||||
ln -sfv /opt/meson/meson.py /usr/bin/meson; chmod +x /opt/meson/meson.py; cd /; }
|
||||
t_gperf(){ unp gperf; ./configure --prefix=/usr; make; make install; cd /; }
|
||||
t_python_modules(){ local site
|
||||
site="$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')"
|
||||
mkdir -p "$site"
|
||||
unp markupsafe; cp -a src/markupsafe "$site/"; cd /
|
||||
unp jinja2; cp -a src/jinja2 "$site/"; cd /
|
||||
python3 -c 'import jinja2; print("jinja2", jinja2.__version__)'
|
||||
}
|
||||
|
||||
once t-ninja t_ninja
|
||||
once t-meson t_meson
|
||||
once t-gperf t_gperf
|
||||
once t-python-modules t_python_modules
|
||||
echo "build tools ready: $(ninja --version), meson $(meson --version)"
|
||||
Executable
+139
@@ -0,0 +1,139 @@
|
||||
#!/bin/bash
|
||||
# packages/chroot-desktop.sh — Wayland + wlroots + cairo/pango + PipeWire +
|
||||
# the AeroOS aerowm compositor. Runs INSIDE the chroot.
|
||||
#
|
||||
# Uses wlroots' pixman (software) renderer so we don't need Mesa/LLVM for the
|
||||
# baseline image; hardware GL accel can be layered in later via mesa.
|
||||
set -Eeuo pipefail
|
||||
export LC_ALL=POSIX MAKEFLAGS="${MAKEFLAGS:--j4}"
|
||||
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig
|
||||
export LD_LIBRARY_PATH="/usr/lib:/usr/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
SRC=/sources; STAMPS=/root/.base-stamps; mkdir -p "$STAMPS"
|
||||
say(){ printf '\n\e[1;36m== %s ==\e[0m\n' "$*"; }
|
||||
ldconfig 2>/dev/null || true
|
||||
once(){ local n="$1"; shift; [[ -f "$STAMPS/$n" ]] && { echo "skip $n"; return; }; "$@"; ldconfig 2>/dev/null || true; touch "$STAMPS/$n"; }
|
||||
find_tb(){ local m; shopt -s nocaseglob nullglob; local a=("$SRC/$1"-[0-9]*.tar.*) b=("$SRC/$1"*.tar.*) c=()
|
||||
[[ "$1" == seatd ]] && c=("$SRC"/0.9.1.tar.*)
|
||||
shopt -u nocaseglob nullglob
|
||||
m="${a[0]:-${b[0]:-${c[0]:-}}}"
|
||||
[[ -n "$m" ]] || { echo "MISSING SOURCE: $1" >&2; return 1; }; echo "$m"; }
|
||||
unp(){ cd /tmp; rm -rf bld-"$1"; mkdir bld-"$1"; tar -xf "$(find_tb "$1")" -C bld-"$1" --strip-components=1; cd bld-"$1"; }
|
||||
# meson helper: mz <stem> [opts...]
|
||||
mz(){ local s="$1"; shift; unp "$s"; meson setup build --prefix=/usr --libdir=lib --buildtype=release --wrap-mode=nodownload "$@"; ninja -C build; ninja -C build install; cd /; }
|
||||
# autotools helper
|
||||
az(){ local s="$1"; shift; unp "$s"; ./configure --prefix=/usr "$@"; make; make install; cd /; }
|
||||
|
||||
# ---- core libs ----
|
||||
p_libpng(){ az libpng; }
|
||||
p_pcre2(){ az pcre2 --enable-unicode --enable-pcre2-16 --enable-pcre2-32 --enable-jit; }
|
||||
p_fribidi(){ mz fribidi; }
|
||||
p_freetype(){ az freetype --enable-freetype-config --disable-static; }
|
||||
p_fontconfig(){ mz fontconfig --sysconfdir=/etc --localstatedir=/var \
|
||||
-Ddoc=disabled -Dtests=disabled; }
|
||||
p_harfbuzz(){ mz harfbuzz -Dgraphite2=disabled; }
|
||||
p_pixman(){ mz pixman; }
|
||||
p_glib(){ mz glib -Dintrospection=disabled -Dman-pages=disabled; }
|
||||
p_graphene(){ mz graphene -Dtests=false -Dintrospection=disabled; }
|
||||
p_cairo(){ mz cairo -Dtests=disabled -Dxlib=disabled -Dxcb=disabled; }
|
||||
p_pango(){ mz pango -Dintrospection=disabled; }
|
||||
p_dejavu(){ unp dejavu; install -d /usr/share/fonts/dejavu
|
||||
cp -v ttf/*.ttf /usr/share/fonts/dejavu/; fc-cache -f || true; cd /; }
|
||||
p_hwdata(){ unp hwdata; ./configure --prefix=/usr --disable-blacklist; make 2>/dev/null||true; make install; cd /; }
|
||||
p_libffi(){ az libffi --disable-static; }
|
||||
|
||||
# ---- input / session ----
|
||||
p_libxkbcommon(){ mz libxkbcommon -Denable-x11=false -Denable-wayland=false \
|
||||
-Denable-docs=false -Denable-xkbregistry=false; }
|
||||
p_libdrm(){ mz libdrm -Dvalgrind=disabled -Dintel=disabled -Dnouveau=disabled \
|
||||
-Dradeon=disabled -Damdgpu=disabled 2>/dev/null || mz libdrm; }
|
||||
p_seatd(){ mz seatd -Dlibseat-logind=systemd -Dserver=enabled \
|
||||
-Dexamples=disabled -Dman-pages=disabled; }
|
||||
p_mtdev(){ az mtdev --disable-static; }
|
||||
p_libevdev(){ az libevdev --disable-static; }
|
||||
p_libinput(){ mz libinput -Ddebug-gui=false -Dtests=false -Ddocumentation=false \
|
||||
-Dlibwacom=false; }
|
||||
|
||||
# ---- wayland ----
|
||||
p_libxml2(){ unp libxml2
|
||||
sed -i "s/run_command('git', 'describe', check: false)/run_command('false', check: false)/" meson.build
|
||||
meson setup build --prefix=/usr --libdir=lib --buildtype=release --wrap-mode=nodownload \
|
||||
-Dpython=disabled -Ddocs=disabled -Dreadline=disabled -Dhistory=disabled
|
||||
ninja -C build; ninja -C build install; cd /; }
|
||||
p_wayland(){ mz wayland -Ddocumentation=false -Dtests=false; }
|
||||
p_wayland_protocols(){ mz wayland-protocols -Dtests=false; }
|
||||
p_libdisplay_info(){ mz libdisplay-info; }
|
||||
p_wlroots(){ unp wlroots
|
||||
meson setup build --prefix=/usr --libdir=lib --buildtype=release --wrap-mode=nodownload \
|
||||
-Drenderers=[] -Dallocators=[] -Dbackends=drm,libinput -Dexamples=false \
|
||||
-Dxwayland=disabled -Dsession=enabled -Dcolor-management=disabled -Dlibliftoff=disabled
|
||||
ninja -C build; ninja -C build install; cd /; }
|
||||
|
||||
# ---- audio (PipeWire; lofi played via pw-play) ----
|
||||
p_alsa(){ az alsa-lib; }
|
||||
p_libsndfile(){ mz libsndfile -Dtests=false || az libsndfile; }
|
||||
p_lua(){ unp lua
|
||||
make linux MYCFLAGS="-fPIC" INSTALL_TOP=/usr
|
||||
make INSTALL_TOP=/usr INSTALL_MAN=/usr/share/man/man1 install
|
||||
install -d /usr/lib/pkgconfig
|
||||
cat > /usr/lib/pkgconfig/lua-5.4.pc <<'EOF'
|
||||
prefix=/usr
|
||||
libdir=${prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: Lua
|
||||
Description: Lua language engine
|
||||
Version: 5.4.8
|
||||
Libs: -L${libdir} -llua -lm -ldl
|
||||
Cflags: -I${includedir}
|
||||
EOF
|
||||
ln -sf lua-5.4.pc /usr/lib/pkgconfig/lua5.4.pc
|
||||
ln -sf lua-5.4.pc /usr/lib/pkgconfig/lua54.pc
|
||||
ln -sf lua-5.4.pc /usr/lib/pkgconfig/lua.pc
|
||||
cd /; }
|
||||
p_pipewire(){ mz pipewire -Dsystemd=enabled -Dsession-managers=[] \
|
||||
-Dman=disabled -Ddocs=disabled -Dexamples=disabled -Dtests=disabled \
|
||||
-Djack=disabled -Dv4l2=disabled -Dpipewire-jack=disabled \
|
||||
-Dreadline=disabled; }
|
||||
p_wireplumber(){ mz wireplumber -Dsystemd=enabled -Ddoc=disabled -Dtests=false \
|
||||
-Ddbus-tests=false -Dsystem-lua=true -Dsystem-lua-version=5.4; }
|
||||
|
||||
# ---- the AeroOS compositor ----
|
||||
p_aerowm(){ cd /usr/src/aerowm
|
||||
rm -rf build
|
||||
meson setup build --prefix=/usr --buildtype=release
|
||||
ninja -C build; ninja -C build install; cd /; }
|
||||
|
||||
say "AeroOS desktop stack (Wayland + wlroots + cairo/pango + PipeWire)"
|
||||
once d-libffi p_libffi
|
||||
once d-libpng p_libpng
|
||||
once d-pcre2 p_pcre2
|
||||
once d-fribidi p_fribidi
|
||||
once d-freetype p_freetype
|
||||
once d-fontconfig p_fontconfig
|
||||
once d-harfbuzz p_harfbuzz
|
||||
once d-freetype2 p_freetype # rebuild w/ harfbuzz for autohinting
|
||||
once d-pixman p_pixman
|
||||
once d-glib p_glib
|
||||
once d-graphene p_graphene
|
||||
once d-cairo p_cairo
|
||||
once d-pango p_pango
|
||||
once d-dejavu p_dejavu
|
||||
once d-hwdata p_hwdata
|
||||
once d-libxkbcommon p_libxkbcommon
|
||||
once d-libdrm p_libdrm
|
||||
once d-seatd p_seatd
|
||||
once d-mtdev p_mtdev
|
||||
once d-libevdev p_libevdev
|
||||
once d-libinput p_libinput
|
||||
once d-libxml2 p_libxml2
|
||||
once d-wayland p_wayland
|
||||
once d-wayland-proto p_wayland_protocols
|
||||
once d-libdisplay-info p_libdisplay_info
|
||||
once d-wlroots p_wlroots
|
||||
once d-alsa p_alsa
|
||||
once d-libsndfile p_libsndfile
|
||||
once d-pipewire p_pipewire
|
||||
once d-lua p_lua
|
||||
once d-wireplumber p_wireplumber
|
||||
once d-aerowm p_aerowm
|
||||
echo "AeroOS desktop stack complete."
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
# packages/chroot-imagetools.sh — build the tools needed to make the live ISO:
|
||||
# static busybox (for the initramfs), squashfs-tools, mtools, xorriso (libburnia)
|
||||
# and grub's x86_64-efi target. Runs INSIDE the chroot.
|
||||
set -Eeuo pipefail
|
||||
export LC_ALL=POSIX MAKEFLAGS="${MAKEFLAGS:--j4}"
|
||||
SRC=/sources; STAMPS=/root/.base-stamps; mkdir -p "$STAMPS"
|
||||
once(){ local n="$1"; shift; [[ -f "$STAMPS/$n" ]] && { echo "skip $n"; return; }; "$@"; touch "$STAMPS/$n"; }
|
||||
find_tb(){ local m; shopt -s nocaseglob nullglob; local a=("$SRC/$1"-[0-9]*.tar.*) b=("$SRC/$1"*.tar.*); shopt -u nocaseglob nullglob; m="${a[0]:-${b[0]:-}}"; [[ -n "$m" ]] || { echo "MISSING SOURCE: $1" >&2; return 1; }; echo "$m"; }
|
||||
unp(){ cd /tmp; rm -rf bld-"$1"; mkdir bld-"$1"; tar -xf "$(find_tb "$1")" -C bld-"$1" --strip-components=1; cd bld-"$1"; }
|
||||
|
||||
i_busybox(){ unp busybox
|
||||
make defconfig >/dev/null
|
||||
sed -i \
|
||||
-e 's/^# CONFIG_STATIC is not set$/CONFIG_STATIC=y/' \
|
||||
-e 's/^CONFIG_STATIC=.*/CONFIG_STATIC=y/' \
|
||||
-e 's/^CONFIG_TC=y$/# CONFIG_TC is not set/' \
|
||||
-e 's/^CONFIG_FEATURE_TC_INGRESS=y$/# CONFIG_FEATURE_TC_INGRESS is not set/' \
|
||||
.config
|
||||
set +o pipefail
|
||||
yes "" 2>/dev/null | make oldconfig >/dev/null 2>&1
|
||||
local oldconfig_status="${PIPESTATUS[1]}"
|
||||
set -o pipefail
|
||||
(( oldconfig_status == 0 ))
|
||||
make
|
||||
install -Dm755 busybox /usr/bin/busybox-static
|
||||
cd /; }
|
||||
i_squashfs(){ unp squashfs-tools; cd squashfs-tools 2>/dev/null || true
|
||||
make GZIP_SUPPORT=1 XZ_SUPPORT=1 ZSTD_SUPPORT=1
|
||||
make GZIP_SUPPORT=1 XZ_SUPPORT=1 ZSTD_SUPPORT=1 \
|
||||
INSTALL_PREFIX=/usr INSTALL_MANPAGES_DIR= install
|
||||
cd /; }
|
||||
i_libburn(){ unp libburn
|
||||
sed -i 's/^static void catch_int ()$/static void catch_int (int signum)/' test/poll.c
|
||||
./configure --prefix=/usr --disable-static
|
||||
make; make install; cd /; }
|
||||
i_libisofs(){ unp libisofs; ./configure --prefix=/usr --disable-static; make; make install; cd /; }
|
||||
i_libisoburn(){ unp libisoburn; ./configure --prefix=/usr --disable-static; make; make install; cd /; }
|
||||
i_mtools(){ unp mtools; ./configure --prefix=/usr; make; make install; cd /; }
|
||||
i_grub_efi(){ unp grub
|
||||
: > grub-core/extra_deps.lst
|
||||
./configure --prefix=/usr --sysconfdir=/etc --disable-werror \
|
||||
--with-platform=efi --target=x86_64
|
||||
make; make install; cd /; }
|
||||
|
||||
echo "== image tools =="
|
||||
once i-busybox i_busybox
|
||||
once i-squashfs i_squashfs
|
||||
once i-libburn i_libburn
|
||||
once i-libisofs i_libisofs
|
||||
once i-libisoburn i_libisoburn
|
||||
once i-mtools i_mtools
|
||||
once i-grub-efi i_grub_efi
|
||||
echo "image tools ready"
|
||||
Executable
+140
@@ -0,0 +1,140 @@
|
||||
#!/bin/bash
|
||||
# packages/chroot-systemd.sh — systemd, D-Bus, shadow, GRUB + system config.
|
||||
# Runs INSIDE the chroot.
|
||||
set -Eeuo pipefail
|
||||
export LC_ALL=POSIX MAKEFLAGS="${MAKEFLAGS:--j4}"
|
||||
SRC=/sources; STAMPS=/root/.base-stamps; mkdir -p "$STAMPS"
|
||||
say(){ printf '\n\e[1;36m== %s ==\e[0m\n' "$*"; }
|
||||
once(){ local n="$1"; shift; [[ -f "$STAMPS/$n" ]] && { echo "skip $n"; return; }; "$@"; touch "$STAMPS/$n"; }
|
||||
find_tb(){ local m; shopt -s nocaseglob nullglob; local a=("$SRC/$1"-[0-9]*.tar.*) b=("$SRC/$1"*.tar.*) c=()
|
||||
[[ "$1" == systemd ]] && c=("$SRC"/v[0-9]*.tar.*)
|
||||
shopt -u nocaseglob nullglob
|
||||
m="${a[0]:-${b[0]:-${c[0]:-}}}"
|
||||
[[ -n "$m" ]] || { echo "MISSING SOURCE: $1" >&2; return 1; }; echo "$m"; }
|
||||
unp(){ cd /tmp; rm -rf bld-"$1"; mkdir bld-"$1"; tar -xf "$(find_tb "$1")" -C bld-"$1" --strip-components=1; cd bld-"$1"; }
|
||||
|
||||
p_shadow(){ unp shadow
|
||||
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
|
||||
find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; 2>/dev/null || true
|
||||
sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD YESCRYPT:' \
|
||||
-e 's:/var/spool/mail:/var/mail:' -i etc/login.defs
|
||||
touch /usr/bin/passwd
|
||||
./configure --sysconfdir=/etc --disable-static --with-{b,yes}crypt \
|
||||
--without-libbsd --with-group-name-max-length=32
|
||||
make; make exec_prefix=/usr install; make -C man install-man || true
|
||||
pwconv; grpconv
|
||||
echo "root:${AEROS_ROOT_PASS:-root}" | chpasswd
|
||||
cd /; }
|
||||
|
||||
p_dbus(){ unp dbus
|
||||
meson setup build --prefix=/usr --libdir=lib --sysconfdir=/etc --localstatedir=/var \
|
||||
-Druntime_dir=/run \
|
||||
-Dsystem_pid_file=/run/dbus/pid \
|
||||
-Dsystem_socket=/run/dbus/system_bus_socket \
|
||||
-Dsystemd=enabled \
|
||||
-Dsystemd_system_unitdir=/usr/lib/systemd/system \
|
||||
-Dsystemd_user_unitdir=/usr/lib/systemd/user \
|
||||
-Dmodular_tests=disabled -Dinstalled_tests=false \
|
||||
-Dxml_docs=disabled -Ddoxygen_docs=disabled -Dducktype_docs=disabled -Dqt_help=disabled \
|
||||
-Dselinux=disabled -Dapparmor=disabled -Dlibaudit=disabled \
|
||||
-Dx11_autolaunch=disabled -Dlaunchd=disabled
|
||||
ninja -C build
|
||||
ninja -C build install
|
||||
cd /; }
|
||||
|
||||
p_systemd(){ unp systemd
|
||||
sed -i "s/'-Werror=override-init'/'-Wno-error=override-init'/" meson.build
|
||||
cp -f /usr/include/linux/input-event-codes.h src/basic/linux/input-event-codes.h
|
||||
meson setup build --prefix=/usr --libdir=lib --buildtype=release \
|
||||
-Dmode=release -Dlink-udev-shared=true \
|
||||
-Ddefault-dnssec=no -Dfirstboot=true -Dinstall-tests=false \
|
||||
-Dldconfig=true -Dsysusers=true -Drpmmacrosdir=no \
|
||||
-Dhomed=disabled -Duserdb=true -Dman=disabled \
|
||||
-Dpamconfdir=no -Dnss-systemd=true \
|
||||
-Ddbus=disabled -Dglib=disabled
|
||||
ninja -C build
|
||||
ninja -C build install
|
||||
# enable getty + basic targets
|
||||
systemctl preset-all 2>/dev/null || true
|
||||
cd /; }
|
||||
|
||||
p_grub(){ unp grub
|
||||
: > grub-core/extra_deps.lst
|
||||
# BIOS + UEFI (x86_64-efi) targets
|
||||
./configure --prefix=/usr --sysconfdir=/etc --disable-efiemu --enable-grub-mkfont=no \
|
||||
--with-platform=pc --disable-werror || ./configure --prefix=/usr --sysconfdir=/etc --disable-werror
|
||||
make; make install
|
||||
cd /; rm -rf /tmp/bld-grub; unp grub
|
||||
: > grub-core/extra_deps.lst
|
||||
./configure --prefix=/usr --sysconfdir=/etc --with-platform=efi \
|
||||
--target=x86_64 --program-prefix="" --disable-werror || true
|
||||
make 2>/dev/null && make install 2>/dev/null || echo "grub-efi optional build skipped"
|
||||
cd /; }
|
||||
|
||||
configure_system(){
|
||||
say "Base system configuration"
|
||||
# hostname
|
||||
echo "${AEROS_HOSTNAME:-aeros}" > /etc/hostname
|
||||
# hosts
|
||||
cat > /etc/hosts <<EOF
|
||||
127.0.0.1 localhost ${AEROS_HOSTNAME:-aeros}
|
||||
::1 localhost ip6-localhost ip6-loopback
|
||||
EOF
|
||||
# os-release branding
|
||||
cat > /etc/os-release <<EOF
|
||||
NAME="${AEROS_NAME:-AeroOS}"
|
||||
PRETTY_NAME="${AEROS_NAME:-AeroOS} ${AEROS_VERSION:-1.0} (${AEROS_CODENAME:-Frutiger})"
|
||||
ID=${AEROS_DISTRO_ID:-aeros}
|
||||
VERSION_ID=${AEROS_VERSION:-1.0}
|
||||
VERSION_CODENAME=${AEROS_CODENAME:-frutiger}
|
||||
HOME_URL="https://aeros.example"
|
||||
ANSI_COLOR="1;36"
|
||||
EOF
|
||||
cat > /etc/lsb-release <<EOF
|
||||
DISTRIB_ID=${AEROS_DISTRO_ID:-aeros}
|
||||
DISTRIB_RELEASE=${AEROS_VERSION:-1.0}
|
||||
DISTRIB_CODENAME=${AEROS_CODENAME:-Frutiger}
|
||||
DISTRIB_DESCRIPTION="${AEROS_NAME:-AeroOS}"
|
||||
EOF
|
||||
# locale
|
||||
cat > /etc/locale.conf <<EOF
|
||||
LANG=${AEROS_LOCALE:-en_US.UTF-8}
|
||||
EOF
|
||||
# vconsole / time
|
||||
echo "KEYMAP=${AEROS_KEYMAP:-us}" > /etc/vconsole.conf
|
||||
ln -sfv "/usr/share/zoneinfo/${AEROS_TIMEZONE:-UTC}" /etc/localtime
|
||||
# fstab (live image overlays root; this is for installed systems)
|
||||
cat > /etc/fstab <<EOF
|
||||
# <file system> <mount point> <type> <options> <dump> <pass>
|
||||
/dev/sda2 / ext4 defaults,noatime 0 1
|
||||
/dev/sda1 /boot/efi vfat umask=0077 0 2
|
||||
tmpfs /tmp tmpfs nosuid,nodev 0 0
|
||||
EOF
|
||||
# default target = graphical (lands on the Aero home screen)
|
||||
systemctl set-default graphical.target 2>/dev/null || \
|
||||
ln -sfv /usr/lib/systemd/system/graphical.target /etc/systemd/system/default.target
|
||||
# enable networking + resolved
|
||||
systemctl enable systemd-networkd systemd-resolved 2>/dev/null || true
|
||||
ln -sfv /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf 2>/dev/null || true
|
||||
cat > /etc/systemd/network/20-wired.network <<EOF
|
||||
[Match]
|
||||
Name=en* eth*
|
||||
[Network]
|
||||
DHCP=yes
|
||||
EOF
|
||||
# ld cache
|
||||
cat > /etc/ld.so.conf <<EOF
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
EOF
|
||||
ldconfig || true
|
||||
}
|
||||
|
||||
say "AeroOS init + boot layer"
|
||||
once s-shadow p_shadow
|
||||
once s-systemd p_systemd
|
||||
once s-dbus p_dbus
|
||||
once s-grub p_grub
|
||||
once s-config configure_system
|
||||
echo "systemd/boot layer complete."
|
||||
Executable
+135
@@ -0,0 +1,135 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/00-prepare.sh — host checks, directory layout, source download.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
|
||||
HOST_TOOLS=(bash ld bison gawk gcc g++ grep gzip m4 make patch perl
|
||||
python3 sed tar makeinfo xz find)
|
||||
|
||||
check_host() {
|
||||
step "Host requirements"
|
||||
local missing=()
|
||||
for cmd in "${HOST_TOOLS[@]}"; do
|
||||
command -v "$cmd" >/dev/null 2>&1 || missing+=("$cmd")
|
||||
done
|
||||
# need at least one downloader
|
||||
if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then
|
||||
missing+=("curl-or-wget")
|
||||
fi
|
||||
|
||||
if ((${#missing[@]})); then
|
||||
warn "Missing host build tools: ${missing[*]}"
|
||||
cat <<EOF
|
||||
Install them, e.g. on Debian/Ubuntu/WSL2:
|
||||
sudo apt-get install build-essential bison gawk texinfo \\
|
||||
gettext python3 m4 patch xz-utils wget curl libssl-dev \\
|
||||
flex meson ninja-build cmake pkg-config gperf
|
||||
On Fedora:
|
||||
sudo dnf groupinstall "Development Tools" && sudo dnf install bison flex \\
|
||||
texinfo gettext openssl-devel meson ninja-build cmake
|
||||
EOF
|
||||
die "host is missing required tools"
|
||||
fi
|
||||
|
||||
# version sanity (LFS host requirements)
|
||||
local kver gccver
|
||||
gccver=$(gcc -dumpversion | cut -d. -f1)
|
||||
(( gccver >= 9 )) || warn "GCC $gccver is old; >= 9 recommended"
|
||||
kver=$(uname -r)
|
||||
log "host kernel: $kver, gcc: $(gcc -dumpversion)"
|
||||
|
||||
# disk space
|
||||
local avail_gb
|
||||
avail_gb=$(df -BG --output=avail "$AEROS_TOP" | tail -1 | tr -dc '0-9')
|
||||
(( avail_gb >= 30 )) || warn "only ${avail_gb}G free under $AEROS_TOP; >= 30G recommended"
|
||||
ok "host looks usable (${avail_gb}G free)"
|
||||
}
|
||||
|
||||
make_layout() {
|
||||
step "Directory layout"
|
||||
mkdir -pv "$AEROS_ROOT" "$AEROS_SOURCES" "$AEROS_OUT" "$AEROS_LOGDIR"
|
||||
mkdir -pv "$AEROS_ROOT"/{etc,var,tools} "$AEROS_ROOT"/usr/{bin,lib,sbin}
|
||||
for d in bin lib sbin; do
|
||||
[[ -e "$AEROS_ROOT/$d" ]] || ln -sv "usr/$d" "$AEROS_ROOT/$d"
|
||||
done
|
||||
case "$AEROS_ARCH" in
|
||||
x86_64) mkdir -pv "$AEROS_ROOT/usr/lib64"
|
||||
[[ -e "$AEROS_ROOT/lib64" ]] || ln -sv usr/lib64 "$AEROS_ROOT/lib64" ;;
|
||||
esac
|
||||
ok "layout ready at $AEROS_ROOT"
|
||||
}
|
||||
|
||||
# Build a list of mirror candidates for a URL (handles slow/blocked hosts).
|
||||
mirror_candidates() {
|
||||
local url="$1"
|
||||
# GNU: ftp.gnu.org is often slow/blocked; ftpmirror picks a fast mirror.
|
||||
case "$url" in
|
||||
https://ftp.gnu.org/gnu/*)
|
||||
echo "${url/https:\/\/ftp.gnu.org\/gnu\//https://ftpmirror.gnu.org/}"
|
||||
echo "${url/https:\/\/ftp.gnu.org\/gnu\//https://mirrors.kernel.org/gnu/}"
|
||||
;;
|
||||
esac
|
||||
echo "$url" # original tried last
|
||||
}
|
||||
|
||||
# download_one <url> <dest> : try mirrors with curl, then wget; hard timeouts
|
||||
# (--speed-limit/--speed-time aborts a stalled transfer instead of hanging).
|
||||
download_one() {
|
||||
local url="$1" dest="$2" cand
|
||||
while read -r cand; do
|
||||
[[ -n "$cand" ]] || continue
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
if curl -fL --retry 2 --retry-delay 2 --connect-timeout 15 \
|
||||
--max-time 900 --speed-time 30 --speed-limit 1024 \
|
||||
-o "$dest" "$cand"; then return 0; fi
|
||||
fi
|
||||
if command -v wget >/dev/null 2>&1; then
|
||||
if wget -q --tries=2 --connect-timeout=15 --read-timeout=30 \
|
||||
-O "$dest" "$cand"; then return 0; fi
|
||||
fi
|
||||
warn " mirror failed: $cand"
|
||||
done < <(mirror_candidates "$url")
|
||||
return 1
|
||||
}
|
||||
|
||||
fetch_sources() {
|
||||
step "Fetch upstream sources"
|
||||
mkdir -p "$AEROS_SOURCES"
|
||||
command -v curl >/dev/null 2>&1 || command -v wget >/dev/null 2>&1 \
|
||||
|| die "need curl or wget to fetch sources"
|
||||
local fails=0
|
||||
for name in "${!PKG[@]}"; do
|
||||
[[ "${PKG[$name]}" == *"|http"* ]] || continue # skip note entries
|
||||
local url tb dest
|
||||
url="$(pkg_url "$name")"
|
||||
tb="$(pkg_tarball "$name")"
|
||||
dest="$AEROS_SOURCES/$tb"
|
||||
if [[ -s "$dest" ]]; then ok "have $tb"; continue; fi
|
||||
log "download $name -> $tb"
|
||||
if download_one "$url" "$dest.part"; then
|
||||
mv "$dest.part" "$dest"
|
||||
else
|
||||
warn "FAILED: $name ($url)"; rm -f "$dest.part"; ((fails++))
|
||||
fi
|
||||
done
|
||||
# optional checksum verification
|
||||
if [[ -f "$AEROS_TOP/config/checksums.sha256" ]]; then
|
||||
log "verifying checksums"
|
||||
( cd "$AEROS_SOURCES" && sha256sum -c "$AEROS_TOP/config/checksums.sha256" ) \
|
||||
|| die "checksum verification failed"
|
||||
else
|
||||
warn "no config/checksums.sha256 — skipping integrity check"
|
||||
warn "generate one with: (cd sources && sha256sum * > ../config/checksums.sha256)"
|
||||
fi
|
||||
(( fails == 0 )) || die "$fails source(s) failed to download"
|
||||
ok "all sources present in $AEROS_SOURCES"
|
||||
}
|
||||
|
||||
main() {
|
||||
case "${1:-all}" in
|
||||
check) check_host ;;
|
||||
fetch) fetch_sources ;;
|
||||
all) check_host; make_layout; fetch_sources ;;
|
||||
*) die "usage: 00-prepare.sh [check|fetch|all]" ;;
|
||||
esac
|
||||
}
|
||||
main "$@"
|
||||
Executable
+112
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/01-toolchain.sh — cross toolchain in $AEROS_TOOLS (LFS ch. 5).
|
||||
# Builds: binutils (pass1) -> gcc (pass1) -> linux headers -> glibc -> libstdc++.
|
||||
# Run as the unprivileged build user with write access to $AEROS_ROOT.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
deny_root
|
||||
|
||||
export LFS="$AEROS_ROOT"
|
||||
export LC_ALL=POSIX
|
||||
export AEROS_TGT="$AEROS_TARGET_TRIPLET"
|
||||
export PATH="$AEROS_TOOLS/bin:/usr/bin:/bin"
|
||||
export CONFIG_SITE="$LFS/usr/share/config.site"
|
||||
WORK="$AEROS_SOURCES/work-toolchain"
|
||||
mkdir -p "$WORK"; cd "$WORK"
|
||||
|
||||
# ---------------------------------------------------------------- binutils p1
|
||||
build_binutils_pass1() {
|
||||
local d; d="$(cd "$WORK" && unpack binutils)"; cd "$WORK/$d"
|
||||
mkdir -v build; cd build
|
||||
../configure --prefix="$AEROS_TOOLS" \
|
||||
--with-sysroot="$LFS" --target="$AEROS_TGT" \
|
||||
--disable-nls --enable-gprofng=no --disable-werror \
|
||||
--enable-new-dtags --enable-default-hash-style=gnu
|
||||
make
|
||||
make install
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- gcc pass1
|
||||
build_gcc_pass1() {
|
||||
local d; d="$(cd "$WORK" && unpack gcc)"; cd "$WORK/$d"
|
||||
( cd "$WORK/$d"; tar -xf "$AEROS_SOURCES/$(pkg_tarball mpfr)"; mv -v "$(pkg_srcdir mpfr)" mpfr
|
||||
tar -xf "$AEROS_SOURCES/$(pkg_tarball gmp)"; mv -v "$(pkg_srcdir gmp)" gmp
|
||||
tar -xf "$AEROS_SOURCES/$(pkg_tarball mpc)"; mv -v "$(pkg_srcdir mpc)" mpc )
|
||||
case "$AEROS_ARCH" in
|
||||
x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 ;;
|
||||
esac
|
||||
mkdir -v build; cd build
|
||||
../configure --target="$AEROS_TGT" --prefix="$AEROS_TOOLS" \
|
||||
--with-glibc-version=2.41 --with-sysroot="$LFS" --with-newlib \
|
||||
--without-headers --enable-default-pie --enable-default-ssp \
|
||||
--disable-nls --disable-shared --disable-multilib \
|
||||
--disable-threads --disable-libatomic --disable-libgomp \
|
||||
--disable-libquadmath --disable-libssp --disable-libvtv \
|
||||
--disable-libstdcxx --enable-languages=c,c++
|
||||
make
|
||||
make install
|
||||
# full internal headers (limits.h)
|
||||
local gccsrc="$WORK/$d"
|
||||
cat "$gccsrc"/gcc/limitx.h "$gccsrc"/gcc/glimits.h "$gccsrc"/gcc/limity.h > \
|
||||
"$(dirname "$("$AEROS_TGT"-gcc -print-libgcc-file-name)")/include/limits.h"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- linux headers
|
||||
build_linux_headers() {
|
||||
local d; d="$(cd "$WORK" && unpack linux)"; cd "$WORK/$d"
|
||||
make mrproper
|
||||
make headers
|
||||
find usr/include -type f ! -name '*.h' -delete
|
||||
mkdir -p "$LFS/usr"
|
||||
cp -rv usr/include "$LFS/usr"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- glibc
|
||||
build_glibc() {
|
||||
local d; d="$(cd "$WORK" && unpack glibc)"; cd "$WORK/$d"
|
||||
case "$AEROS_ARCH" in
|
||||
x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 "$LFS/lib64"
|
||||
ln -sfv ../lib/ld-linux-x86-64.so.2 "$LFS/lib64/ld-lsb-x86-64.so.3" ;;
|
||||
esac
|
||||
# glibc <= 2.41 unconditionally redefines OPEN_TREE_CLONE (and a couple of
|
||||
# siblings) *after* including <linux/mount.h>. Linux >= 7.x defines
|
||||
# OPEN_TREE_CLONE with different macro text, so -Werror aborts. Keep the
|
||||
# include (so linux/mount.h's guard coordinates struct mount_attr) and just
|
||||
# guard the conflicting macros with #ifndef.
|
||||
sed -i -E 's@^#define (OPEN_TREE_CLONE|OPEN_TREE_CLOEXEC|FSOPEN_CLOEXEC)([ \t].*)?$@#ifndef \1\n#define \1\2\n#endif@' \
|
||||
sysdeps/unix/sysv/linux/sys/mount.h
|
||||
mkdir -v build; cd build
|
||||
echo "rootsbindir=/usr/sbin" > configparms
|
||||
../configure --prefix=/usr --host="$AEROS_TGT" --build="$(../scripts/config.guess)" \
|
||||
--enable-kernel=5.4 --with-headers="$LFS/usr/include" \
|
||||
--disable-nscd libc_cv_slibdir=/usr/lib
|
||||
make
|
||||
make DESTDIR="$LFS" install
|
||||
sed '/RTLDLIST=/s@/usr@@g' -i "$LFS/usr/bin/ldd"
|
||||
# sanity check
|
||||
echo 'int main(){}' > /tmp/aeros-dummy.c
|
||||
"$AEROS_TGT"-gcc /tmp/aeros-dummy.c -o /tmp/aeros-dummy
|
||||
readelf -l /tmp/aeros-dummy | grep -q 'ld-linux' \
|
||||
&& ok "glibc toolchain links correctly" || die "toolchain sanity check FAILED"
|
||||
rm -f /tmp/aeros-dummy*
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- libstdc++
|
||||
build_libstdcxx() {
|
||||
local d; d="$(cd "$WORK" && unpack gcc)"; cd "$WORK/$d"
|
||||
mkdir -v build-libstdcxx; cd build-libstdcxx
|
||||
../libstdc++-v3/configure --host="$AEROS_TGT" --build="$(../config.guess)" \
|
||||
--prefix=/usr --disable-multilib --disable-nls \
|
||||
--disable-libstdcxx-pch \
|
||||
--with-gxx-include-dir="/tools/$AEROS_TGT/include/c++/15.1.0"
|
||||
make
|
||||
make DESTDIR="$LFS" install
|
||||
rm -v "$LFS"/usr/lib/lib{stdc++{,exp,fs},supc++}.la 2>/dev/null || true
|
||||
}
|
||||
|
||||
step "AeroOS cross-toolchain → $AEROS_TOOLS"
|
||||
once tc-binutils-pass1 build_binutils_pass1
|
||||
once tc-gcc-pass1 build_gcc_pass1
|
||||
once tc-linux-headers build_linux_headers
|
||||
once tc-glibc build_glibc
|
||||
once tc-libstdcxx build_libstdcxx
|
||||
ok "cross-toolchain complete"
|
||||
Executable
+108
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/02-temp-tools.sh — temporary tools in $AEROS_ROOT (LFS ch. 6).
|
||||
# Cross-compiled against the stage-01 toolchain; gives us enough to chroot.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
deny_root
|
||||
|
||||
export LFS="$AEROS_ROOT"
|
||||
export LC_ALL=POSIX
|
||||
export AEROS_TGT="$AEROS_TARGET_TRIPLET"
|
||||
export PATH="$AEROS_TOOLS/bin:/usr/bin:/bin"
|
||||
export CONFIG_SITE="$LFS/usr/share/config.site"
|
||||
WORK="$AEROS_SOURCES/work-temp"
|
||||
mkdir -p "$WORK"
|
||||
|
||||
# generic cross autotools temp-tool: _xtool <pkg> <configure-args...>
|
||||
_xtool() {
|
||||
local pkg="$1"; shift
|
||||
local d; d="$(cd "$WORK" && unpack "$pkg")"; cd "$WORK/$d"
|
||||
[[ -x ./configure ]] || die "$pkg: no configure script"
|
||||
./configure --prefix=/usr --host="$AEROS_TGT" --build="$(build-aux/config.guess 2>/dev/null || ./config.guess 2>/dev/null || echo x86_64-pc-linux-gnu)" "$@"
|
||||
make
|
||||
make DESTDIR="$LFS" install
|
||||
}
|
||||
|
||||
t_m4() { _xtool m4; }
|
||||
t_ncurses() { local d; d="$(cd "$WORK" && unpack ncurses)"; cd "$WORK/$d"
|
||||
mkdir build; pushd build; ../configure AWK=gawk >/dev/null; make -C include; make -C progs tic; popd
|
||||
./configure --prefix=/usr --host="$AEROS_TGT" --build="$(./config.guess)" \
|
||||
--mandir=/usr/share/man --with-manpage-format=normal \
|
||||
--with-shared --without-normal --without-cxx-binding \
|
||||
--without-debug --without-ada --disable-stripping AWK=gawk
|
||||
make
|
||||
make DESTDIR="$LFS" TIC_PATH="$(pwd)/build/progs/tic" install
|
||||
ln -sv libncursesw.so "$LFS/usr/lib/libncurses.so"
|
||||
sed -e 's/^#if.*XOPEN.*$/#if 1/' -i "$LFS/usr/include/curses.h"; }
|
||||
t_bash() { _xtool bash --without-bash-malloc bash_cv_strtold_broken=no
|
||||
ln -sv bash "$LFS/bin/sh"; }
|
||||
t_coreutils() { _xtool coreutils --enable-install-program=hostname \
|
||||
--enable-no-install-program=kill,uptime gl_cv_macro_MB_CUR_MAX_good=y
|
||||
mkdir -pv "$LFS/usr/sbin"; }
|
||||
t_diffutils() { _xtool diffutils gl_cv_func_strcasecmp_works=y; }
|
||||
t_file() { local d; d="$(cd "$WORK" && unpack file)"; cd "$WORK/$d"
|
||||
mkdir build; pushd build
|
||||
../configure --disable-bzlib --disable-libseccomp \
|
||||
--disable-xzlib --disable-zlib; make; popd
|
||||
./configure --prefix=/usr --host="$AEROS_TGT" --build="$(./config.guess)"
|
||||
make FILE_COMPILE="$(pwd)/build/src/file"
|
||||
make DESTDIR="$LFS" install; rm -v "$LFS/usr/lib/libmagic.la"; }
|
||||
t_findutils() { _xtool findutils --localstatedir=/var/lib/locate; }
|
||||
t_gawk() { local d; d="$(cd "$WORK" && unpack gawk)"; cd "$WORK/$d"
|
||||
sed -i 's/extras//' Makefile.in; _xtool_done=1
|
||||
./configure --prefix=/usr --host="$AEROS_TGT" --build="$(./config.guess)"
|
||||
make; make DESTDIR="$LFS" install; }
|
||||
t_grep() { _xtool grep; }
|
||||
t_gzip() { _xtool gzip; }
|
||||
t_make() { _xtool make; }
|
||||
t_patch() { _xtool patch; }
|
||||
t_sed() { _xtool sed; }
|
||||
t_tar() { _xtool tar; }
|
||||
t_xz() { _xtool xz; rm -v "$LFS"/usr/lib/liblzma.la; }
|
||||
|
||||
t_binutils2() { local d; d="$(cd "$WORK" && unpack binutils)"; cd "$WORK/$d"
|
||||
sed '6031s/$add_dir//' -i ltmain.sh
|
||||
mkdir build; cd build
|
||||
../configure --prefix=/usr --build="$(../config.guess)" \
|
||||
--host="$AEROS_TGT" --disable-nls --enable-shared \
|
||||
--enable-gprofng=no --disable-werror \
|
||||
--enable-64-bit-bfd --enable-new-dtags \
|
||||
--enable-default-hash-style=gnu
|
||||
make; make DESTDIR="$LFS" install
|
||||
rm -v "$LFS"/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la} 2>/dev/null || true; }
|
||||
|
||||
t_gcc2() { local d; d="$(cd "$WORK" && unpack gcc)"; cd "$WORK/$d"
|
||||
tar -xf "$AEROS_SOURCES/$(pkg_tarball mpfr)"; mv "$(pkg_srcdir mpfr)" mpfr
|
||||
tar -xf "$AEROS_SOURCES/$(pkg_tarball gmp)"; mv "$(pkg_srcdir gmp)" gmp
|
||||
tar -xf "$AEROS_SOURCES/$(pkg_tarball mpc)"; mv "$(pkg_srcdir mpc)" mpc
|
||||
case "$AEROS_ARCH" in x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64;; esac
|
||||
sed '/thread_header =/s/@.*@/gthr-posix.h/' -i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
|
||||
mkdir build; cd build
|
||||
../configure --build="$(../config.guess)" --host="$AEROS_TGT" \
|
||||
--target="$AEROS_TGT" LDFLAGS_FOR_TARGET=-L$PWD/$AEROS_TGT/libgcc \
|
||||
--prefix=/usr --with-build-sysroot="$LFS" --enable-default-pie \
|
||||
--enable-default-ssp --disable-nls --disable-multilib \
|
||||
--disable-libatomic --disable-libgomp --disable-libquadmath \
|
||||
--disable-libsanitizer --disable-libssp --disable-libvtv \
|
||||
--enable-languages=c,c++
|
||||
make; make DESTDIR="$LFS" install
|
||||
ln -sfv gcc "$LFS/usr/bin/cc"; }
|
||||
|
||||
step "Temporary tools (cross-compiled into $AEROS_ROOT)"
|
||||
once tt-m4 t_m4
|
||||
once tt-ncurses t_ncurses
|
||||
once tt-bash t_bash
|
||||
once tt-coreutils t_coreutils
|
||||
once tt-diffutils t_diffutils
|
||||
once tt-file t_file
|
||||
once tt-findutils t_findutils
|
||||
once tt-gawk t_gawk
|
||||
once tt-grep t_grep
|
||||
once tt-gzip t_gzip
|
||||
once tt-make t_make
|
||||
once tt-patch t_patch
|
||||
once tt-sed t_sed
|
||||
once tt-tar t_tar
|
||||
once tt-xz t_xz
|
||||
once tt-binutils2 t_binutils2
|
||||
once tt-gcc2 t_gcc2
|
||||
ok "temporary tools complete — system is now chroot-ready"
|
||||
Executable
+120
@@ -0,0 +1,120 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/03-chroot-base.sh — own the tree, enter chroot, build base system.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
require_root
|
||||
|
||||
LFS="$AEROS_ROOT"
|
||||
|
||||
# Guard: stage 03 chowns the tree to root, which makes the unprivileged
|
||||
# stages 01/02 unable to write to it. Refuse to proceed (and chown) unless
|
||||
# stage 02 actually finished, otherwise a premature run wedges the build.
|
||||
if ! stamped tt-gcc2; then
|
||||
die "stage 02 (temporary tools) is not complete — refusing to chroot.
|
||||
Run it first: ./build.sh stage 02
|
||||
(If a previous root run already chowned the tree, restore it first:
|
||||
sudo chown -R \"\${SUDO_USER:-\$USER}\":\"\${SUDO_USER:-\$USER}\" \"$LFS\")"
|
||||
fi
|
||||
|
||||
prepare_chroot() {
|
||||
step "Take ownership + essential files/dirs"
|
||||
chown -R root:root "$LFS"/{usr,lib,var,etc,bin,sbin,tools}
|
||||
case "$AEROS_ARCH" in x86_64) chown -R root:root "$LFS/lib64" 2>/dev/null || true;; esac
|
||||
|
||||
mkdir -pv "$LFS"/{boot,home,mnt,opt,srv}
|
||||
mkdir -pv "$LFS"/etc/{opt,sysconfig}
|
||||
mkdir -pv "$LFS"/lib/firmware
|
||||
mkdir -pv "$LFS"/media/{floppy,cdrom}
|
||||
mkdir -pv "$LFS"/usr/{,local/}{include,src}
|
||||
mkdir -pv "$LFS"/usr/lib/locale
|
||||
mkdir -pv "$LFS"/usr/local/{bin,lib,sbin}
|
||||
mkdir -pv "$LFS"/usr/{,local/}share/{color,dict,doc,info,locale,man}
|
||||
mkdir -pv "$LFS"/usr/{,local/}share/{misc,terminfo,zoneinfo}
|
||||
mkdir -pv "$LFS"/usr/{,local/}share/man/man{1..8}
|
||||
mkdir -pv "$LFS"/var/{cache,local,log,mail,opt,spool}
|
||||
mkdir -pv "$LFS"/var/lib/{color,misc,locate}
|
||||
ln -sfv /run "$LFS/var/run"
|
||||
ln -sfv /run/lock "$LFS/var/lock"
|
||||
install -dv -m 0750 "$LFS/root"
|
||||
install -dv -m 1777 "$LFS/tmp" "$LFS/var/tmp"
|
||||
|
||||
# minimal /etc/passwd & group so chroot processes resolve ids
|
||||
cat > "$LFS/etc/passwd" <<'EOF'
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
bin:x:1:1:bin:/dev/null:/usr/bin/false
|
||||
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
|
||||
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
|
||||
systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/usr/bin/false
|
||||
systemd-journal-remote:x:74:74:systemd Journal Remote:/:/usr/bin/false
|
||||
systemd-journal-upload:x:75:75:systemd Journal Upload:/:/usr/bin/false
|
||||
systemd-network:x:76:76:systemd Network Management:/:/usr/bin/false
|
||||
systemd-resolve:x:77:77:systemd Resolver:/:/usr/bin/false
|
||||
systemd-timesync:x:78:78:systemd Time Synchronization:/:/usr/bin/false
|
||||
systemd-coredump:x:79:79:systemd Core Dumper:/:/usr/bin/false
|
||||
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false
|
||||
systemd-oom:x:81:81:systemd Out Of Memory Daemon:/:/usr/bin/false
|
||||
nobody:x:65534:65534:Unprivileged User:/dev/null:/usr/bin/false
|
||||
EOF
|
||||
cat > "$LFS/etc/group" <<'EOF'
|
||||
root:x:0:
|
||||
bin:x:1:daemon
|
||||
sys:x:2:
|
||||
kmem:x:3:
|
||||
tape:x:4:
|
||||
tty:x:5:
|
||||
daemon:x:6:
|
||||
floppy:x:7:
|
||||
disk:x:8:
|
||||
lp:x:9:
|
||||
dialout:x:10:
|
||||
audio:x:11:
|
||||
video:x:12:
|
||||
utmp:x:13:
|
||||
cdrom:x:15:
|
||||
adm:x:16:
|
||||
messagebus:x:18:
|
||||
systemd-journal:x:23:
|
||||
input:x:24:
|
||||
mail:x:34:
|
||||
kvm:x:61:
|
||||
render:x:62:
|
||||
seat:x:63:
|
||||
systemd-journal-gateway:x:73:
|
||||
systemd-journal-remote:x:74:
|
||||
systemd-journal-upload:x:75:
|
||||
systemd-network:x:76:
|
||||
systemd-resolve:x:77:
|
||||
systemd-timesync:x:78:
|
||||
systemd-coredump:x:79:
|
||||
uuidd:x:80:
|
||||
systemd-oom:x:81:
|
||||
wheel:x:97:
|
||||
users:x:999:
|
||||
nogroup:x:65534:
|
||||
EOF
|
||||
echo "aeros" > "$LFS/etc/hostname"
|
||||
touch "$LFS"/var/log/{btmp,lastlog,faillog,wtmp}
|
||||
chgrp -v utmp "$LFS/var/log/lastlog" 2>/dev/null || true
|
||||
chmod -v 664 "$LFS/var/log/lastlog"; chmod -v 600 "$LFS/var/log/btmp"
|
||||
ok "chroot scaffolding ready"
|
||||
}
|
||||
|
||||
run_inner() {
|
||||
step "Mounting virtual kernel filesystems"
|
||||
mount_vkfs
|
||||
mkdir -p "$LFS/sources"
|
||||
mountpoint -q "$LFS/sources" || mount --bind "$AEROS_SOURCES" "$LFS/sources"
|
||||
install -m755 "$AEROS_TOP/packages/chroot-base.sh" "$LFS/root/build-base.sh"
|
||||
|
||||
step "Entering chroot to build base system (this is the long part)"
|
||||
in_chroot "MAKEFLAGS='-j${AEROS_JOBS}' /root/build-base.sh"
|
||||
|
||||
step "Unmounting"
|
||||
mountpoint -q "$LFS/sources" && umount -l "$LFS/sources" || true
|
||||
umount_vkfs
|
||||
}
|
||||
|
||||
trap 'mountpoint -q "$LFS/sources" && umount -l "$LFS/sources"; umount_vkfs 2>/dev/null || true' EXIT
|
||||
|
||||
prepare_chroot
|
||||
run_inner
|
||||
ok "base system complete"
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/04-kernel.sh — configure + build Linux 7.1 and install into chroot.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
require_root
|
||||
|
||||
LFS="$AEROS_ROOT"
|
||||
KVER="$(pkg_version linux)"
|
||||
|
||||
trap 'mountpoint -q "$LFS/sources" && umount -l "$LFS/sources"; umount_vkfs 2>/dev/null || true' EXIT
|
||||
|
||||
step "Linux kernel $KVER (x86-64)"
|
||||
mount_vkfs
|
||||
mkdir -p "$LFS/sources"
|
||||
mountpoint -q "$LFS/sources" || mount --bind "$AEROS_SOURCES" "$LFS/sources"
|
||||
install -Dm644 "$AEROS_TOP/config/kernel/aeros.config" "$LFS/root/aeros.config"
|
||||
|
||||
[[ -x "$LFS/usr/bin/bc" ]] || die "stage 04 requires bc inside the chroot; run: sudo ./build.sh stage 03"
|
||||
[[ -x "$LFS/usr/bin/rsync" ]] || die "stage 04 requires rsync inside the chroot; run: sudo ./build.sh stage 03"
|
||||
|
||||
# Inner build: defconfig + merge our fragment + build + modules_install + install
|
||||
cat > "$LFS/root/build-kernel.sh" <<INNER
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
export MAKEFLAGS="-j${AEROS_JOBS}"
|
||||
cd /tmp; rm -rf linux-src; mkdir linux-src
|
||||
tar -xf "/sources/$(pkg_tarball linux)" -C linux-src --strip-components=1
|
||||
cd linux-src
|
||||
make mrproper
|
||||
make x86_64_defconfig
|
||||
# merge AeroOS options on top of defconfig
|
||||
scripts/kconfig/merge_config.sh -m .config /root/aeros.config
|
||||
make olddefconfig
|
||||
# build kernel image + modules
|
||||
make
|
||||
make modules_install
|
||||
# install kernel + map + config to /boot
|
||||
install -Dm644 arch/x86/boot/bzImage /boot/vmlinuz-aeros-${KVER}
|
||||
install -Dm644 System.map /boot/System.map-${KVER}
|
||||
install -Dm644 .config /boot/config-${KVER}
|
||||
# kernel headers for building DKMS/userspace later
|
||||
make headers_install INSTALL_HDR_PATH=/usr
|
||||
echo "kernel ${KVER} installed to /boot"
|
||||
INNER
|
||||
chmod +x "$LFS/root/build-kernel.sh"
|
||||
|
||||
in_chroot "/root/build-kernel.sh"
|
||||
|
||||
mountpoint -q "$LFS/sources" && umount -l "$LFS/sources" || true
|
||||
umount_vkfs
|
||||
ok "kernel $KVER built and installed"
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/05-systemd-boot.sh — build systemd/dbus/shadow/grub + configure system.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
require_root
|
||||
LFS="$AEROS_ROOT"
|
||||
|
||||
trap 'mountpoint -q "$LFS/sources" && umount -l "$LFS/sources"; umount_vkfs 2>/dev/null || true' EXIT
|
||||
|
||||
step "systemd / D-Bus / shadow / GRUB"
|
||||
mount_vkfs
|
||||
mkdir -p "$LFS/sources"
|
||||
mountpoint -q "$LFS/sources" || mount --bind "$AEROS_SOURCES" "$LFS/sources"
|
||||
|
||||
install -m755 "$AEROS_TOP/packages/chroot-buildtools.sh" "$LFS/root/build-tools.sh"
|
||||
install -m755 "$AEROS_TOP/packages/chroot-systemd.sh" "$LFS/root/build-systemd.sh"
|
||||
|
||||
[[ -f "$LFS/usr/include/crypt.h" && -e "$LFS/usr/lib/libcrypt.so" ]] || \
|
||||
die "stage 05 requires libxcrypt inside the chroot; run: sudo ./build.sh stage 03"
|
||||
|
||||
# pass branding/config env into the chroot build
|
||||
ENVS="AEROS_NAME='$AEROS_NAME' AEROS_VERSION='$AEROS_VERSION' \
|
||||
AEROS_CODENAME='$AEROS_CODENAME' AEROS_DISTRO_ID='$AEROS_DISTRO_ID' \
|
||||
AEROS_HOSTNAME='$AEROS_HOSTNAME' AEROS_LOCALE='$AEROS_LOCALE' \
|
||||
AEROS_TIMEZONE='$AEROS_TIMEZONE' AEROS_KEYMAP='$AEROS_KEYMAP' \
|
||||
AEROS_ROOT_PASS='$AEROS_ROOT_PASS' MAKEFLAGS='-j${AEROS_JOBS}'"
|
||||
|
||||
in_chroot "$ENVS /root/build-tools.sh"
|
||||
in_chroot "$ENVS /root/build-systemd.sh"
|
||||
|
||||
mountpoint -q "$LFS/sources" && umount -l "$LFS/sources" || true
|
||||
umount_vkfs
|
||||
ok "init + boot layer complete"
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/06-desktop.sh — copy compositor source into the tree, build the
|
||||
# Wayland/wlroots desktop stack + aerowm inside the chroot.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
require_root
|
||||
LFS="$AEROS_ROOT"
|
||||
|
||||
trap 'mountpoint -q "$LFS/sources" && umount -l "$LFS/sources"; umount_vkfs 2>/dev/null || true' EXIT
|
||||
|
||||
step "Wayland desktop + aerowm compositor"
|
||||
mount_vkfs
|
||||
mkdir -p "$LFS/sources"
|
||||
mountpoint -q "$LFS/sources" || mount --bind "$AEROS_SOURCES" "$LFS/sources"
|
||||
|
||||
# stage compositor source into /usr/src/aerowm inside the new system
|
||||
log "installing aerowm source into /usr/src/aerowm"
|
||||
rm -rf "$LFS/usr/src/aerowm"
|
||||
mkdir -p "$LFS/usr/src/aerowm"
|
||||
cp -a "$AEROS_TOP/desktop/aerowm/." "$LFS/usr/src/aerowm/"
|
||||
|
||||
install -m755 "$AEROS_TOP/packages/chroot-buildtools.sh" "$LFS/root/build-tools.sh"
|
||||
install -m755 "$AEROS_TOP/packages/chroot-desktop.sh" "$LFS/root/build-desktop.sh"
|
||||
|
||||
ENVS="MAKEFLAGS='-j${AEROS_JOBS}'"
|
||||
in_chroot "$ENVS /root/build-tools.sh" # ensure ninja/meson exist
|
||||
in_chroot "$ENVS /root/build-desktop.sh"
|
||||
|
||||
mountpoint -q "$LFS/sources" && umount -l "$LFS/sources" || true
|
||||
umount_vkfs
|
||||
ok "desktop stack + compositor built"
|
||||
Executable
+125
@@ -0,0 +1,125 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/07-aero-theme.sh — Frutiger Aero wallpaper, subtle lofi service,
|
||||
# glassmorphism theme, session launcher, autologin to the home screen.
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
require_root
|
||||
LFS="$AEROS_ROOT"
|
||||
|
||||
trap 'umount_vkfs 2>/dev/null || true' EXIT
|
||||
|
||||
# ---------------------------------------------------------------- wallpaper
|
||||
make_wallpaper() {
|
||||
step "Wallpaper (Frutiger Aero)"
|
||||
local dst="$LFS/usr/share/backgrounds/aeros"
|
||||
install -d "$dst"
|
||||
local svg="$AEROS_TOP/assets/wallpaper/frutiger-aero.svg"
|
||||
local png="$dst/frutiger-aero.png"
|
||||
if command -v rsvg-convert >/dev/null 2>&1; then
|
||||
rsvg-convert -w 1920 -h 1080 "$svg" -o "$png" && ok "rasterized SVG via rsvg-convert"
|
||||
elif command -v inkscape >/dev/null 2>&1; then
|
||||
inkscape "$svg" --export-type=png -w 1920 -h 1080 -o "$png" && ok "via inkscape"
|
||||
elif command -v convert >/dev/null 2>&1; then
|
||||
convert -background none -resize 1920x1080 "$svg" "$png" && ok "via ImageMagick"
|
||||
else
|
||||
warn "no SVG rasterizer found — using stdlib procedural generator"
|
||||
python3 "$AEROS_TOP/assets/wallpaper/gen_wallpaper.py" "$png" 1920 1080
|
||||
fi
|
||||
# also keep the SVG source on the system
|
||||
install -m644 "$svg" "$dst/frutiger-aero.svg"
|
||||
ok "wallpaper installed -> /usr/share/backgrounds/aeros/frutiger-aero.png"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- lofi
|
||||
make_lofi() {
|
||||
step "Subtle lofi loop"
|
||||
local dst="$LFS/usr/share/aeros/lofi"
|
||||
install -d "$dst"
|
||||
if [[ ! -s "$dst/aero-lofi.wav" ]]; then
|
||||
python3 "$AEROS_TOP/assets/lofi/generate_lofi.py" "$dst/aero-lofi.wav"
|
||||
fi
|
||||
install -m644 "$AEROS_TOP/assets/lofi/generate_lofi.py" "$dst/generate_lofi.py"
|
||||
ok "lofi track -> /usr/share/aeros/lofi/aero-lofi.wav"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- theme
|
||||
make_theme() {
|
||||
step "Glassmorphism theme (AeroGlass)"
|
||||
install -d "$LFS/usr/share/themes/AeroGlass/gtk-4.0"
|
||||
install -m644 "$AEROS_TOP/assets/theme/AeroGlass/gtk-4.0/gtk.css" \
|
||||
"$LFS/usr/share/themes/AeroGlass/gtk-4.0/gtk.css"
|
||||
install -d "$LFS/etc/gtk-4.0" "$LFS/etc/gtk-3.0"
|
||||
install -m644 "$AEROS_TOP/assets/theme/settings.ini" "$LFS/etc/gtk-4.0/settings.ini"
|
||||
install -m644 "$AEROS_TOP/assets/theme/settings.ini" "$LFS/etc/gtk-3.0/settings.ini"
|
||||
# system-wide env so toolkits pick the theme + wayland
|
||||
cat >> "$LFS/etc/environment" <<'EOF'
|
||||
GTK_THEME=AeroGlass
|
||||
QT_QPA_PLATFORM=wayland
|
||||
MOZ_ENABLE_WAYLAND=1
|
||||
XDG_CURRENT_DESKTOP=AeroOS
|
||||
EOF
|
||||
ok "AeroGlass theme installed"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- session + services
|
||||
make_session() {
|
||||
step "Session launcher + services"
|
||||
install -m755 "$AEROS_TOP/desktop/aero-session/aero-session" "$LFS/usr/bin/aero-session"
|
||||
install -m755 "$AEROS_TOP/desktop/aero-lofi/aero-lofi" "$LFS/usr/bin/aero-lofi"
|
||||
install -d "$LFS/usr/lib/systemd/user"
|
||||
install -m644 "$AEROS_TOP/desktop/aero-lofi/aero-lofi.service" \
|
||||
"$LFS/usr/lib/systemd/user/aero-lofi.service"
|
||||
ok "session + lofi service installed"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------- users/autologin (chroot)
|
||||
configure_users() {
|
||||
step "Live user + autologin to the AeroOS home screen"
|
||||
mount_vkfs
|
||||
cat > "$LFS/root/setup-users.sh" <<INNER
|
||||
#!/bin/bash
|
||||
set -e
|
||||
# groups a desktop user needs
|
||||
for g in video input render seat audio wheel users; do getent group \$g >/dev/null || groupadd -r \$g 2>/dev/null || true; done
|
||||
id ${AEROS_LIVE_USER} >/dev/null 2>&1 || useradd -m -G wheel,video,input,render,seat,audio,users -s /bin/bash ${AEROS_LIVE_USER}
|
||||
echo "${AEROS_LIVE_USER}:${AEROS_LIVE_PASS}" | chpasswd
|
||||
echo "root:${AEROS_ROOT_PASS}" | chpasswd
|
||||
|
||||
# autologin the live user on tty1
|
||||
mkdir -p /etc/systemd/system/getty@tty1.service.d
|
||||
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf <<EOF
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin ${AEROS_LIVE_USER} --noclear %I \$TERM
|
||||
EOF
|
||||
|
||||
# start the Aero session automatically on tty1 login
|
||||
cat > /home/${AEROS_LIVE_USER}/.bash_profile <<'EOF'
|
||||
# Launch the AeroOS glassmorphism desktop on the first VT, once.
|
||||
if [ -z "\$WAYLAND_DISPLAY" ] && [ "\$(tty)" = "/dev/tty1" ]; then
|
||||
exec aero-session
|
||||
fi
|
||||
EOF
|
||||
chown ${AEROS_LIVE_USER}:${AEROS_LIVE_USER} /home/${AEROS_LIVE_USER}/.bash_profile
|
||||
|
||||
# enable lofi for the live user by default
|
||||
loginctl enable-linger ${AEROS_LIVE_USER} 2>/dev/null || true
|
||||
mkdir -p /home/${AEROS_LIVE_USER}/.config/systemd/user/default.target.wants
|
||||
ln -sf /usr/lib/systemd/user/aero-lofi.service \
|
||||
/home/${AEROS_LIVE_USER}/.config/systemd/user/default.target.wants/aero-lofi.service
|
||||
chown -R ${AEROS_LIVE_USER}:${AEROS_LIVE_USER} /home/${AEROS_LIVE_USER}/.config
|
||||
|
||||
# seatd for the compositor's DRM/input session
|
||||
systemctl enable seatd 2>/dev/null || true
|
||||
echo "users + autologin configured"
|
||||
INNER
|
||||
chmod +x "$LFS/root/setup-users.sh"
|
||||
in_chroot "AEROS_LIVE_USER='$AEROS_LIVE_USER' AEROS_LIVE_PASS='$AEROS_LIVE_PASS' AEROS_ROOT_PASS='$AEROS_ROOT_PASS' /root/setup-users.sh"
|
||||
umount_vkfs
|
||||
}
|
||||
|
||||
make_wallpaper
|
||||
make_lofi
|
||||
make_theme
|
||||
make_session
|
||||
configure_users
|
||||
ok "Aero identity applied"
|
||||
Executable
+118
@@ -0,0 +1,118 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/08-image.sh — assemble the bootable hybrid (BIOS+UEFI) live ISO.
|
||||
#
|
||||
# Layout produced:
|
||||
# ISO/
|
||||
# boot/vmlinuz-aeros (kernel)
|
||||
# boot/initrd-aeros.img (busybox initramfs: squashfs+overlay+switch_root)
|
||||
# boot/grub/grub.cfg
|
||||
# boot/grub/aero-splash.png (wallpaper, as boot splash)
|
||||
# LiveOS/aeros.squashfs (the whole AeroOS root, compressed)
|
||||
# -> xorriso/grub-mkrescue -> out/aeros-<ver>-x86_64.iso (isohybrid)
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
|
||||
require_root
|
||||
LFS="$AEROS_ROOT"
|
||||
WORK="$AEROS_OUT/imgwork"
|
||||
ISODIR="$WORK/iso"
|
||||
|
||||
trap 'mountpoint -q "$LFS/sources" && umount -l "$LFS/sources"; umount_vkfs 2>/dev/null || true' EXIT
|
||||
|
||||
build_image_tools() {
|
||||
step "Image tooling (busybox/squashfs/xorriso/grub-efi)"
|
||||
mount_vkfs
|
||||
mkdir -p "$LFS/sources"
|
||||
mountpoint -q "$LFS/sources" || mount --bind "$AEROS_SOURCES" "$LFS/sources"
|
||||
install -m755 "$AEROS_TOP/packages/chroot-imagetools.sh" "$LFS/root/build-imgtools.sh"
|
||||
in_chroot "MAKEFLAGS='-j${AEROS_JOBS}' /root/build-imgtools.sh"
|
||||
mountpoint -q "$LFS/sources" && umount -l "$LFS/sources" || true
|
||||
umount_vkfs
|
||||
}
|
||||
|
||||
make_initramfs() {
|
||||
step "Initramfs"
|
||||
local IR="$WORK/initramfs"
|
||||
rm -rf "$IR"; mkdir -p "$IR"/{bin,sbin,proc,sys,dev,run,sysroot,etc}
|
||||
mknod -m 600 "$IR/dev/console" c 5 1
|
||||
mknod -m 666 "$IR/dev/null" c 1 3
|
||||
mknod -m 666 "$IR/dev/tty" c 5 0
|
||||
# busybox provides sh, mount, switch_root, blkid, etc. (static => no libs)
|
||||
install -Dm755 "$LFS/usr/bin/busybox-static" "$IR/bin/busybox"
|
||||
# init script with the ISO label substituted in
|
||||
sed "s/@@ISO_LABEL@@/$AEROS_ISO_LABEL/g" "$AEROS_TOP/assets/live/init" \
|
||||
> "$IR/init"
|
||||
chmod +x "$IR/init"
|
||||
ln -sf bin/busybox "$IR/sbin/busybox" 2>/dev/null || true
|
||||
( cd "$IR" && find . | cpio -o -H newc 2>/dev/null | gzip -9 ) \
|
||||
> "$ISODIR/boot/initrd-aeros.img"
|
||||
ok "initramfs -> boot/initrd-aeros.img ($(du -h "$ISODIR/boot/initrd-aeros.img" | cut -f1))"
|
||||
}
|
||||
|
||||
make_squashfs() {
|
||||
step "SquashFS root (compressing the AeroOS system)"
|
||||
install -d "$ISODIR/LiveOS"
|
||||
# exclude build-only/transient content from the shipped root
|
||||
local EXCL=(
|
||||
--exclude-regex '^sources(/|$)'
|
||||
--exclude-regex '^tools(/|$)'
|
||||
--exclude-regex '^root/build-.*\.sh$'
|
||||
--exclude-regex '^root/setup-users\.sh$'
|
||||
--exclude-regex '^root/aeros\.config$'
|
||||
--exclude-regex '^\.stamps(/|$)'
|
||||
--exclude-regex '^tmp/.+'
|
||||
--exclude-regex '^usr/src/aerowm/build(/|$)'
|
||||
)
|
||||
"$LFS/usr/bin/mksquashfs" "$LFS" "$ISODIR/LiveOS/aeros.squashfs" \
|
||||
-comp zstd -Xcompression-level 19 -noappend -no-progress \
|
||||
-e sources tools 2>/dev/null \
|
||||
|| mksquashfs "$LFS" "$ISODIR/LiveOS/aeros.squashfs" -comp zstd -noappend \
|
||||
-e sources tools
|
||||
ok "squashfs -> LiveOS/aeros.squashfs ($(du -h "$ISODIR/LiveOS/aeros.squashfs" | cut -f1))"
|
||||
}
|
||||
|
||||
assemble_iso() {
|
||||
step "GRUB config + kernel + splash"
|
||||
install -d "$ISODIR/boot/grub"
|
||||
# kernel
|
||||
cp -v "$LFS"/boot/vmlinuz-aeros-* "$ISODIR/boot/vmlinuz-aeros"
|
||||
# grub.cfg
|
||||
sed -e "s/@@ISO_LABEL@@/$AEROS_ISO_LABEL/g" \
|
||||
-e "s/@@VERSION@@/$AEROS_VERSION/g" \
|
||||
"$AEROS_TOP/assets/live/grub.cfg" > "$ISODIR/boot/grub/grub.cfg"
|
||||
# boot splash = wallpaper
|
||||
cp -v "$LFS/usr/share/backgrounds/aeros/frutiger-aero.png" \
|
||||
"$ISODIR/boot/grub/aero-splash.png" 2>/dev/null || true
|
||||
|
||||
step "Building hybrid ISO with grub-mkrescue"
|
||||
mkdir -p "$AEROS_OUT"
|
||||
local OUT="$AEROS_OUT/$AEROS_ISO_NAME"
|
||||
rm -f "$OUT"
|
||||
# Run grub-mkrescue from inside the chroot so it uses the AeroOS grub +
|
||||
# xorriso + mtools we built; bind-mount the iso tree in.
|
||||
mount_vkfs
|
||||
in_chroot "mkdir -p /usr/share/grub && if [ ! -s /usr/share/grub/unicode.pf2 ]; then grub-mkfont -o /usr/share/grub/unicode.pf2 /usr/share/fonts/dejavu/DejaVuSans.ttf; fi"
|
||||
mkdir -p "$LFS/mnt/isobuild" "$LFS/mnt/isoout"
|
||||
mount --bind "$ISODIR" "$LFS/mnt/isobuild"
|
||||
mount --bind "$AEROS_OUT" "$LFS/mnt/isoout"
|
||||
if ! in_chroot "set -o pipefail; grub-mkrescue -o /mnt/isoout/$AEROS_ISO_NAME /mnt/isobuild \
|
||||
--volid $AEROS_ISO_LABEL 2>&1 | tail -20"; then
|
||||
rm -f "$OUT"
|
||||
warn "chroot grub-mkrescue failed; trying host grub-mkrescue"
|
||||
fi
|
||||
umount "$LFS/mnt/isobuild" 2>/dev/null || true
|
||||
umount "$LFS/mnt/isoout" 2>/dev/null || true
|
||||
umount_vkfs
|
||||
|
||||
if [[ ! -s "$OUT" ]] && command -v grub-mkrescue >/dev/null 2>&1; then
|
||||
grub-mkrescue -o "$OUT" "$ISODIR" --volid "$AEROS_ISO_LABEL"
|
||||
fi
|
||||
[[ -s "$OUT" ]] || die "ISO build failed"
|
||||
ok "ISO ready: $OUT ($(du -h "$OUT" | cut -f1))"
|
||||
echo "$OUT" > "$AEROS_OUT/.last-iso"
|
||||
}
|
||||
|
||||
mkdir -p "$ISODIR/boot/grub"
|
||||
build_image_tools
|
||||
make_squashfs
|
||||
make_initramfs
|
||||
assemble_iso
|
||||
ok "live image complete"
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env bash
|
||||
# scripts/lib/common.sh — shared helpers sourced by every stage.
|
||||
set -Eeuo pipefail
|
||||
|
||||
# Resolve repo top from this file's location, then load config + versions.
|
||||
_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
AEROS_TOP="$(cd "$_LIB_DIR/../.." && pwd)"
|
||||
# shellcheck source=/dev/null
|
||||
source "$AEROS_TOP/config/aeros.conf"
|
||||
# shellcheck source=/dev/null
|
||||
source "$AEROS_TOP/config/versions.sh"
|
||||
|
||||
# ---- pretty logging ---------------------------------------------------------
|
||||
if [[ -t 1 ]]; then
|
||||
C_RESET=$'\e[0m'; C_BLUE=$'\e[1;34m'; C_GREEN=$'\e[1;32m'
|
||||
C_YELLOW=$'\e[1;33m'; C_RED=$'\e[1;31m'; C_CYAN=$'\e[1;36m'
|
||||
else
|
||||
C_RESET=""; C_BLUE=""; C_GREEN=""; C_YELLOW=""; C_RED=""; C_CYAN=""
|
||||
fi
|
||||
|
||||
log() { printf '%s>>%s %s\n' "$C_BLUE" "$C_RESET" "$*" >&2; }
|
||||
ok() { printf '%s ✓%s %s\n' "$C_GREEN" "$C_RESET" "$*" >&2; }
|
||||
warn() { printf '%s !!%s %s\n' "$C_YELLOW" "$C_RESET" "$*" >&2; }
|
||||
die() { printf '%sxx%s %s\n' "$C_RED" "$C_RESET" "$*" >&2; exit 1; }
|
||||
step() { printf '\n%s== %s ==%s\n' "$C_CYAN" "$*" "$C_RESET" >&2; }
|
||||
|
||||
# ---- guards -----------------------------------------------------------------
|
||||
require_cmd() { command -v "$1" >/dev/null 2>&1 || die "missing host command: $1"; }
|
||||
require_root(){ [[ $EUID -eq 0 ]] || die "this stage must run as root (use sudo)"; }
|
||||
deny_root() { [[ $EUID -ne 0 ]] || die "do NOT run this stage as root"; }
|
||||
|
||||
# Stamp files mark a stage/sub-step as complete so re-runs are idempotent.
|
||||
_stamp_dir() { mkdir -p "$AEROS_ROOT/.stamps"; echo "$AEROS_ROOT/.stamps"; }
|
||||
stamped() { [[ -f "$(_stamp_dir)/$1" ]]; }
|
||||
stamp() { touch "$(_stamp_dir)/$1"; }
|
||||
# run a build step once: once <name> <command...>
|
||||
once() {
|
||||
local name="$1"; shift
|
||||
if stamped "$name"; then ok "skip $name (done)"; return 0; fi
|
||||
log "build $name"
|
||||
"$@"
|
||||
stamp "$name"
|
||||
ok "done $name"
|
||||
}
|
||||
|
||||
# ---- sources ----------------------------------------------------------------
|
||||
# unpack <pkg-name> → extracts tarball into current dir, echoes src dir path
|
||||
unpack() {
|
||||
local pkg="$1" tb dir
|
||||
tb="$AEROS_SOURCES/$(pkg_tarball "$pkg")"
|
||||
[[ -f "$tb" ]] || die "source not fetched: $tb (run ./build.sh fetch)"
|
||||
dir="$(pkg_srcdir "$pkg")"
|
||||
rm -rf "$dir"
|
||||
log "extract $(basename "$tb")"
|
||||
case "$tb" in
|
||||
*.tar.xz|*.txz) tar -xf "$tb" ;;
|
||||
*.tar.gz|*.tgz) tar -xzf "$tb" ;;
|
||||
*.tar.bz2) tar -xjf "$tb" ;;
|
||||
*) die "unknown archive type: $tb" ;;
|
||||
esac
|
||||
# Some archives (gitlab) extract to a differently-named dir; normalize.
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
dir="$(tar -tf "$tb" 2>/dev/null | head -1 | cut -d/ -f1)"
|
||||
fi
|
||||
[[ -d "$dir" ]] || die "extracted dir not found for $pkg"
|
||||
printf '%s\n' "$dir"
|
||||
}
|
||||
|
||||
# ---- chroot helpers ---------------------------------------------------------
|
||||
mount_vkfs() {
|
||||
require_root
|
||||
local r="$AEROS_ROOT"
|
||||
# ensure the virtual-fs mount points exist (stages 03-08 all rely on this)
|
||||
mkdir -p "$r"/dev "$r"/dev/pts "$r"/dev/shm "$r"/proc "$r"/sys "$r"/run
|
||||
mountpoint -q "$r/dev" || mount --bind /dev "$r/dev"
|
||||
mountpoint -q "$r/dev/pts" || mount -t devpts devpts -o gid=5,mode=0620 "$r/dev/pts"
|
||||
mountpoint -q "$r/proc" || mount -t proc proc "$r/proc"
|
||||
mountpoint -q "$r/sys" || mount -t sysfs sysfs "$r/sys"
|
||||
mountpoint -q "$r/run" || mount -t tmpfs tmpfs "$r/run"
|
||||
if [[ -h "$r/dev/shm" ]]; then mkdir -p "$r/$(readlink "$r/dev/shm")"
|
||||
else mountpoint -q "$r/dev/shm" || mount -t tmpfs -o nosuid,nodev tmpfs "$r/dev/shm"; fi
|
||||
}
|
||||
umount_vkfs() {
|
||||
require_root
|
||||
local r="$AEROS_ROOT"
|
||||
for m in dev/shm dev/pts run sys proc dev; do
|
||||
mountpoint -q "$r/$m" && umount -l "$r/$m" || true
|
||||
done
|
||||
}
|
||||
# run a command string inside the chroot with a clean env
|
||||
in_chroot() {
|
||||
require_root
|
||||
chroot "$AEROS_ROOT" /usr/bin/env -i \
|
||||
HOME=/root TERM="$TERM" PS1='(aeros chroot) \u:\w\$ ' \
|
||||
PATH=/usr/bin:/usr/sbin \
|
||||
MAKEFLAGS="-j${AEROS_JOBS}" \
|
||||
/bin/bash --login -c "$*"
|
||||
}
|
||||
|
||||
export -f log ok warn die step
|
||||
Reference in new issue
Block a user