Fix install-breaking and live-boot bugs, verified on real hardware
All checks were successful
Mirror to GitHub / mirror (push) Successful in 3s

Boot-critical (each confirmed with a real boot/install cycle, not just
code review):

- Live ISO's liveuser shell is zsh, but Hyprland autostart was written
  to .bash_profile (never runs) — moved to .zprofile, and switched to
  start-hyprland (Hyprland's own watchdog wrapper; raw `exec Hyprland`
  is no longer the recommended launch method).
- copytoram (self-enables on most real hardware: non-optical boot +
  image < 4GiB + enough free RAM) unmounts /run/archiso/bootmnt, which
  unpackfs.conf and bos-copy-kernel both hardcoded as their source —
  broke the installer outright on real hardware, confirmed by forcing
  copytoram=y. Added a resolver step for unpackfs, and switched the
  kernel copy to /usr/lib/modules/$(uname -r)/vmlinuz (part of the live
  squashfs itself, unaffected by copytoram).
- BIOS installs got no bootloader — post-install.sh only ever ran the
  UEFI grub-install path despite BOS shipping bios.syslinux. Added a
  BIOS branch with disk auto-detection.
- @snapshots/@log/@cache were never real: iso/partition.conf's
  btrfsSubvolumes key isn't part of this Calamares version's partition
  module schema at all (same class of bug as the userShell fix below —
  silently ignored). Calamares only natively creates @ and @home.
  post-install.sh now creates the three subvolumes by hand after
  unpackfs, migrates existing /var/log + /var/cache content into them
  before mounting over, and adds the fstab entries — verified end to
  end on real hardware, including grub-btrfs generating bootable
  snapshot menu entries. The unmount step in the existing snapper
  create-config dance also gained retry + lazy-unmount fallback after
  a real chroot run hit a transient busy-mount race.
- Default shell was bash instead of zsh post-install: users.conf's
  top-level `userShell` key isn't part of this Calamares version's
  users module schema either — the real key is nested (user.shell).
- graphical-session.target ships RefuseManualStart=yes (systemd
  convention), so the earlier attempt to activate it from hyprland.lua
  silently failed and breadclipd (WantedBy=graphical-session.target)
  never started. Starts breadclipd.service directly instead.
- /etc/os-release was never set (showed "Arch Linux"); live boot never
  had quiet/splash/plymouth wired in (raw kernel scroll the whole
  time) despite BOS already shipping a complete bread-logo+spinner
  plymouth theme for the installed system.

Also: generalized build-local.sh's per-service skel baking (previously
only breadd.service was hand-committed; breadbox-sync/breadmill/
breadclipd never shipped), added the four new bakery packages to
BREAD_BINS, removed the redundant cliphist/fzf clipboard pipeline in
favor of breadclip, mirrored fastfetch's bread-logo config into skel,
and fixed a stale bos-update comment.
This commit is contained in:
Breadway 2026-07-03 13:31:40 +08:00
parent 81f2f3545a
commit a8f1592e75
24 changed files with 373 additions and 56 deletions

View file

@ -49,7 +49,7 @@ grep airootfs_image_tool_options "$STAGE/profiledef.sh"
# created from skel (the live user and the installed user) then gets the same
# versions `bakery list` reports here, fully offline. Copied at build time so the
# binaries never bloat the git repo and always track the current bakery state.
BREAD_BINS=(bakery bread breadd breadman breadbar breadbox breadbox-sync breadcrumbs breadpad breadpaper bread-theme)
BREAD_BINS=(bakery bread breadd breadman breadbar breadbox breadbox-sync breadcrumbs breadpad breadpaper bread-theme breadmon breadsearch breadmill breadclip breadclipd breadshot)
LAPTOP_HOME="${LAPTOP_HOME:-$(getent passwd "${SUDO_USER:-$USER}" | cut -d: -f6)}"
BAKERY_BIN="$LAPTOP_HOME/.local/bin"
BAKERY_STATE="$LAPTOP_HOME/.local/state/bakery"
@ -69,6 +69,50 @@ install -m 0644 "$BAKERY_STATE/installed.json" "$SKEL/.local/state/bakery/instal
install -m 0644 "$BAKERY_CACHE/index.json" "$SKEL/.cache/bakery/index.json"
echo "baked: $(ls "$SKEL/.local/bin")"
# --- Bake systemd user services for bakery-managed bread packages -----------
# Historically only breadd.service was hand-committed to skel; every other
# bakery package's service (breadbox-sync, breadmill, breadclipd, ...) was
# silently left out, so those daemons never start on a fresh install/live
# boot until the user re-runs `bakery install` (which needs network).
# Generalize from the same source of truth as the binary bake above: read
# the services this laptop's bakery actually installed, copy each unit file
# into skel with ExecStart rewritten from this laptop's literal home path to
# the portable `%h` specifier, and recreate whichever *.target.wants enable
# symlink bakery created locally. Units already committed by hand (breadd.service
# carries a RuntimeDirectoryPreserve=yes fix not yet upstreamed — see bread-release-build
# notes) are left alone rather than overwritten.
echo "=== baking bakery service units into skel ==="
SYSTEMD_USER_DIR="$LAPTOP_HOME/.config/systemd/user"
SKEL_SYSTEMD="$SKEL/.config/systemd/user"
mapfile -t SERVICE_UNITS < <(python3 -c "
import json
with open('$BAKERY_STATE/installed.json') as f:
d = json.load(f)
for pkg in d.get('packages', d).values():
for s in pkg.get('services', []):
print(s)
")
for unit in "${SERVICE_UNITS[@]}"; do
if [[ -f "$SKEL_SYSTEMD/$unit" ]]; then
echo " $unit already committed in skel, leaving as-is"
continue
fi
src="$SYSTEMD_USER_DIR/$unit"
if [[ ! -f "$src" ]]; then
echo " warning: $unit not found at $src, skipping"
continue
fi
install -d -m 0755 "$SKEL_SYSTEMD"
sed "s#ExecStart=$LAPTOP_HOME/.local/bin/#ExecStart=%h/.local/bin/#" "$src" > "$SKEL_SYSTEMD/$unit"
for wants_dir in "$SYSTEMD_USER_DIR"/*.target.wants; do
[[ -L "$wants_dir/$unit" ]] || continue
target_name="$(basename "$wants_dir")"
install -d -m 0755 "$SKEL_SYSTEMD/$target_name"
ln -sf "../$unit" "$SKEL_SYSTEMD/$target_name/$unit"
done
echo " baked $unit"
done
# mkarchiso resets every airootfs file to 0644, so executables must be declared
# in profiledef.sh's file_permissions array or they ship non-executable and the
# exec-once launches fail with "permission denied". Inject a 0755 entry for each