Make BOS a complete, bootable, themed desktop OS

Install/boot reliability:
- Use native Calamares initcpiocfg/initcpio + explicit grub-install (nvram +
  --removable) in post-install; drop the flaky native bootloader/grubcfg modules.
- mount.conf: bind /proc /sys /dev (devtmpfs) /run + efivars into the chroot.
- bos-copy-kernel: stage kernel + write a stock mkinitcpio preset (replace the
  archiso preset). Per-service systemctl enable (fixes NetworkManager et al.
  silently not enabling due to the all-or-nothing grub-btrfs.path name).

System completeness:
- greetd + tuigreet graphical login; installed pacman.conf + working mirrorlist;
  base CLI tools (nano, micro, vim, htop, …); amd/intel-ucode; tlp + hypridle
  power management; systemd-timesyncd, fstrim.timer; wpa_supplicant wifi; Zen
  browser (republished to the [Breadway] repo).

Desktop + theming:
- Native Lua Hyprland config (hyprland.lua) with curated standard binds; kitty
  (blur) replaces foot; awww wallpaper + pywal palette (tamed to a black base
  with warm accents); GTK dark mode.
- Plymouth boot splash (bos theme: logo + spinner + status) via plymouthcfg.
- Varela Round font; Calamares bread-palette sidebar (logo/black-region polish
  still pending).
This commit is contained in:
Breadway 2026-06-16 09:09:34 +08:00
parent 787cc0e4c5
commit f8ae8fe125
35 changed files with 787 additions and 180 deletions

View file

@ -23,7 +23,7 @@ slideshow: "show.qml"
slideshowAPI: 2
style:
sidebarBackground: "#3b4252"
sidebarText: "#eceff4"
sidebarTextSelect: "#5e81ac"
sidebarTextHighlight: "#eceff4"
sidebarBackground: "#230b00"
sidebarText: "#f1dcbd"
sidebarTextSelect: "#EAB672"
sidebarTextHighlight: "#ffffff"

View file

@ -0,0 +1,23 @@
/* BOS Calamares styling.
*
* The branding `style:` sidebar keys were being overridden, leaving the
* step tabs invisible. This forces them: bread-palette sidebar with clearly
* legible step labels. (A full installer retheme is tracked separately.)
*/
/* Left sidebar / progress steps */
#sidebarApp {
background-color: #230b00;
}
#sidebarApp QLabel {
color: #f1dcbd;
font-size: 11pt;
padding: 3px 0;
}
/* Logo at the top of the sidebar — keep aspect ratio, don't stretch */
#logoApp {
qproperty-alignment: AlignCenter;
margin: 14px 8px;
}

View file

@ -8,3 +8,32 @@ mountOptions:
options: [noatime, "compress=zstd", "space_cache=v2"]
- filesystem: vfat
options: [umask=0077]
# API filesystems mounted into the target so chroot steps work. Without these
# the chroot has no /proc or /dev and `mkinitcpio` aborts ("/proc must be
# mounted!" / "/dev must be mounted!") and grub-install can't probe properly.
# All are real-fs mounts (not bind) — Calamares 3.4.2 here applies fs-type mounts
# reliably but not bind-type ones, so /dev uses a fresh devtmpfs (which still
# exposes all device nodes). extraMountsEfi adds efivars on UEFI so grub-install
# can write an NVRAM boot entry.
extraMounts:
- device: proc
fs: proc
mountPoint: /proc
- device: sys
fs: sysfs
mountPoint: /sys
- device: udev
fs: devtmpfs
mountPoint: /dev
- device: devpts
fs: devpts
mountPoint: /dev/pts
- device: tmpfs
fs: tmpfs
mountPoint: /run
extraMountsEfi:
- device: efivarfs
fs: efivarfs
mountPoint: /sys/firmware/efi/efivars

View file

@ -0,0 +1,6 @@
---
# Boot-splash theme for the installed system. Calamares sets this as the default
# plymouth theme and signals initcpiocfg to add the plymouth hook to the
# initramfs. The post-install script also enforces the hook + a quiet/splash
# cmdline as a belt-and-suspenders.
plymouth_theme: bos

View file

@ -1,9 +1,10 @@
---
# Calamares defaults shellprocess to a 10-second timeout. post-install.sh runs
# mkinitcpio, grub-install, grub-mkconfig, snapper setup and a networked bakery
# install — minutes of work — so without a generous timeout it gets killed
# partway (leaving /boot and the ESP half-populated → unbootable system). The
# leading "-" keeps a non-zero exit non-fatal to the install.
timeout: 1800
# BOS finalization, run after the native initcpio + bootloader modules. It does
# only fast, non-boot-critical work (live-medium cleanup, snapper, services,
# dotfiles), so the shellprocess timeout can no longer leave the system
# unbootable — the boot-critical steps are owned by dedicated Calamares modules.
# A generous timeout is kept as a safety margin, and the leading "-" keeps a
# non-zero exit non-fatal to the install.
timeout: 600
script:
- "-/usr/bin/bash /etc/calamares/post-install.sh"

View file

@ -1,7 +1,11 @@
#!/bin/bash
# Runs inside the installed-system chroot (Calamares shellprocess, after the
# bootloader step). Best-effort: a single failure must not abort the rest, so
# we deliberately do NOT use `set -e`.
# BOS-specific finalization, run inside the installed-system chroot (Calamares
# shellprocess), AFTER the native initcpio module has built the initramfs. The
# kernel (shellprocess@kernel) and initramfs (initcpio) are in place by now, so
# this script installs GRUB and does the rest of setup. Calamares' own
# `bootloader`/`grubcfg` modules are NOT used — in this archiso layout they leave
# the ESP empty and abort; the explicit grub-install below is verified to boot.
# Best-effort: do NOT use `set -e`; a single failure here must not abort the rest.
set -uo pipefail
MAIN_USER="$(getent passwd 1000 | cut -d: -f1 || true)"
@ -20,30 +24,42 @@ userdel -r liveuser 2>/dev/null || true
passwd -l root || true
# ---------------------------------------------------------------------------
# Rebuild the initramfs for a real install — the live image ships the archiso
# hooks, which would send the installed system into the live-boot path.
# Boot splash (Plymouth) — BOS logo + spinner instead of kernel text. Done
# BEFORE grub so grub.cfg picks up the new cmdline and the rebuilt initramfs.
# All best-effort: if anything here fails the system still boots (just without
# the splash) — the initramfs the initcpio module already built stays valid.
# ---------------------------------------------------------------------------
rm -f /etc/mkinitcpio.conf.d/archiso.conf
cat >/etc/mkinitcpio.d/linux.preset <<'PRESET'
# mkinitcpio preset file for the 'linux' package
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"
PRESETS=('default' 'fallback')
default_image="/boot/initramfs-linux.img"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"
PRESET
mkinitcpio -P || echo "WARN: mkinitcpio regeneration failed"
if command -v plymouth-set-default-theme &>/dev/null; then
# Ensure the plymouth hook is in HOOKS (plymouthcfg/initcpiocfg usually add it;
# this is the belt). Handle both the udev and systemd initramfs styles.
if ! grep -q 'plymouth' /etc/mkinitcpio.conf 2>/dev/null; then
if grep -qE '^HOOKS=.*\bsystemd\b' /etc/mkinitcpio.conf; then
sed -i 's/^\(HOOKS=.*\bsystemd\b\)/\1 sd-plymouth/' /etc/mkinitcpio.conf \
|| echo "WARN: adding sd-plymouth hook failed"
else
sed -i 's/^\(HOOKS=.*\budev\b\)/\1 plymouth/' /etc/mkinitcpio.conf \
|| echo "WARN: adding plymouth hook failed"
fi
fi
# Clean boot: splash activates plymouth; hiding systemd status removes the
# "[ OK ] Started ..." text (what looked like kernel output) even if the
# splash itself doesn't grab the display (e.g. in some VMs).
if ! grep -q 'splash' /etc/default/grub 2>/dev/null; then
sed -i 's/^\(GRUB_CMDLINE_LINUX_DEFAULT="\)/\1splash quiet vt.global_cursor_default=0 systemd.show_status=false rd.systemd.show_status=false rd.udev.log_level=3 /' \
/etc/default/grub || echo "WARN: adding splash cmdline failed"
fi
# Set the BOS theme and rebuild the initramfs (-R) with the plymouth hook.
plymouth-set-default-theme -R bos || echo "WARN: plymouth-set-default-theme failed"
fi
# ---------------------------------------------------------------------------
# Install GRUB ourselves. Calamares' bootloader module runs before the kernel
# and initramfs exist (archiso keeps them out of the squashfs; shellprocess
# @kernel only lays vmlinuz down just beforehand), so its grub-install/config
# leaves the ESP empty. Redo it here, now that /boot is fully populated.
#
# Two passes: the standard NVRAM entry, plus a --removable copy to
# EFI/BOOT/BOOTX64.EFI so firmware that lost/never wrote an NVRAM entry (the
# "no boot device / screen just refreshes" failure) still finds a bootloader.
# Install GRUB (UEFI). /boot now has the kernel + initramfs, and the mount
# module has bind-mounted /proc /sys /dev /run + efivars into this chroot, so
# both grub-install passes and grub-mkconfig succeed.
# 1. NVRAM entry (EFI/BOS/grubx64.efi + a firmware boot entry)
# 2. --removable copy to EFI/BOOT/BOOTX64.EFI, so firmware that ignores/loses
# the NVRAM entry (the "no boot device / PXE fallback" failure) still finds
# a bootloader.
# ---------------------------------------------------------------------------
if command -v grub-install &>/dev/null; then
grub-install --target=x86_64-efi --efi-directory=/boot/efi \
@ -53,8 +69,6 @@ if command -v grub-install &>/dev/null; then
--removable --recheck \
|| echo "WARN: grub-install (removable) failed"
fi
# Refresh GRUB so it references the kernel + rebuilt initramfs.
if command -v grub-mkconfig &>/dev/null; then
grub-mkconfig -o /boot/grub/grub.cfg || echo "WARN: grub-mkconfig failed"
fi
@ -76,22 +90,39 @@ if command -v snapper &>/dev/null; then
fi
# ---------------------------------------------------------------------------
# System services.
# System services. Enable each one INDEPENDENTLY: `systemctl enable a b c`
# resolves every unit first and enables NONE if any one can't be loaded, so a
# single wrong/absent unit name would silently leave NetworkManager (etc.)
# disabled. The loop isolates failures to the offending unit.
# greetd — graphical login (shipped disabled; live uses tty autologin)
# grub-btrfsd — regenerates GRUB snapshot entries (the unit is grub-btrfsd.service,
# NOT grub-btrfs.path, which no longer exists)
# ---------------------------------------------------------------------------
systemctl enable NetworkManager bluetooth snapper-cleanup.timer grub-btrfs.path \
|| echo "WARN: enabling some services failed"
for unit in NetworkManager.service bluetooth.service systemd-timesyncd.service \
tlp.service greetd.service snapper-cleanup.timer grub-btrfsd.service \
fstrim.timer; do
systemctl enable "$unit" || echo "WARN: failed to enable $unit"
done
systemctl set-default graphical.target || echo "WARN: set-default graphical failed"
# The bread ecosystem (bread, breadbar, breadbox, breadcrumbs, breadpad,
# bos-settings) is baked into the squashfs and already copied onto the target by
# unpackfs — no install step needed here, and the install works fully offline.
# The bread ecosystem (bakery + bread, breadbar, breadbox, breadcrumbs, breadpad)
# is bakery-managed, not pacman: the binaries and bakery manifest live in
# /etc/skel/.local (baked in at ISO build time) and are copied into the user's
# home below, so the install works fully offline with no DNS for bakery/GitHub.
# bos-settings is the only pacman bread package and was installed by unpackfs.
# ---------------------------------------------------------------------------
# Deploy dotfiles into the user's home (don't clobber existing files).
# Deploy dotfiles + the bakery bread ecosystem into the user's home (Calamares
# already seeds from /etc/skel, but copy explicitly too so a fresh install is
# self-contained even if the users module skips skel). Don't clobber existing.
# ---------------------------------------------------------------------------
if [[ -n "$MAIN_USER" && -d /etc/skel/.config ]]; then
mkdir -p "/home/$MAIN_USER/.config"
cp -rn /etc/skel/.config/. "/home/$MAIN_USER/.config/" || true
chown -R "$MAIN_USER:$MAIN_USER" "/home/$MAIN_USER/.config" || true
if [[ -n "$MAIN_USER" && -d /etc/skel ]]; then
for d in .config .local .cache; do
[[ -d "/etc/skel/$d" ]] || continue
mkdir -p "/home/$MAIN_USER/$d"
cp -rn "/etc/skel/$d/." "/home/$MAIN_USER/$d/" || true
chown -R "$MAIN_USER:$MAIN_USER" "/home/$MAIN_USER/$d" || true
done
sudo -u "$MAIN_USER" xdg-user-dirs-update || true
fi

View file

@ -29,8 +29,21 @@ sequence:
- networkcfg
- hwclock
- packages
# archiso strips the kernel from the squashfs; stage it, drop the archiso
# initramfs config, and write a stock mkinitcpio preset before initcpio runs.
- shellprocess@kernel
- bootloader
# plymouthcfg sets the boot-splash theme and flags plymouth in use, so
# initcpiocfg adds the plymouth hook to the initramfs that initcpio builds.
- plymouthcfg
# Native initramfs generation (works reliably here). The native `bootloader`
# and `grubcfg` modules do NOT — in this archiso layout they leave the ESP
# empty and abort the install, so GRUB is installed explicitly in
# post-install.sh instead (grub-install --removable + NVRAM + grub-mkconfig,
# the sequence verified to produce a bootable system).
- initcpiocfg
- initcpio
# BOS finalization: GRUB install + cleanup + snapper + services + dotfiles.
# All fast, and runs after initcpio so /boot has the kernel + initramfs.
- shellprocess
- umount
- show: