Some checks are pending
ci / test (push) Waiting to run
Add a branded live welcome window and a Quickshell/QML installer frontend over a narrow, fail-closed JSON bridge (phoebus-installer --gui-bridge) that reuses the same InstallConfig, plan, validation, authorization and staged executor as the TUI/CLI. Add the Phoebus brand system (emblem, wordmark, wallpaper, tokens), suppress DMS first-run dialogs on the live medium, identify the live medium as protected, make the installer shortcut live-only, and fix the installed boot default so systemd-boot never selects the recovery entry. Verified in a disposable graphical VM (welcome/installer journey, duplicate prevention, keyboard navigation, blocked AI prerequisite) plus a real non-interactive install and detached boot (INSTALL-RC=0, NO_SECRET_LEAK, systemd running, 0 failed units, LUKS2, Btrfs, network).
96 lines
4 KiB
Bash
96 lines
4 KiB
Bash
#!/bin/bash
|
|
# mmdebstrap customize hook: turn a Debian testing rootfs into the Phoebus live
|
|
# desktop (Mango + DankMaterialShell). Runs as root inside mmdebstrap's userns.
|
|
#
|
|
# Payload installation (binaries, branding, Quickshell UI, the live marker) is
|
|
# done by build.sh after the rootfs is extracted, so a cached rootfs
|
|
# (PHOEBUS_REUSE_ROOTFS=1) still picks up changed assets. This hook only does
|
|
# the expensive, root-requiring work: user accounts, the Mango build and the
|
|
# DMS install.
|
|
#
|
|
# Environment (set by build.sh):
|
|
# PHOEBUS_SRC directory with the verified pinned source tarballs
|
|
# MANGO_VERSION, DMS_VERSION
|
|
set -euo pipefail
|
|
|
|
root="$1"
|
|
: "${PHOEBUS_SRC:?}"
|
|
MANGO_VERSION="${MANGO_VERSION:-0.17.2}"
|
|
DMS_VERSION="${DMS_VERSION:-1.6.2}"
|
|
LIVE_USER=phoebus
|
|
|
|
in_root() {
|
|
chroot "$root" /usr/bin/env -i \
|
|
PATH=/usr/sbin:/usr/bin:/sbin:/bin HOME=/root TERM=linux LANG=C.UTF-8 \
|
|
"$@"
|
|
}
|
|
|
|
say() { echo "livefs-hook: $*"; }
|
|
|
|
say "live user"
|
|
if ! in_root id "$LIVE_USER" >/dev/null 2>&1; then
|
|
in_root useradd --create-home --shell /bin/bash \
|
|
--groups sudo,video,render,input,audio "$LIVE_USER"
|
|
fi
|
|
install -d -m 0755 "$root/etc/sudoers.d"
|
|
printf '%s ALL=(ALL) NOPASSWD: ALL\n' "$LIVE_USER" > "$root/etc/sudoers.d/90-phoebus-live"
|
|
chmod 440 "$root/etc/sudoers.d/90-phoebus-live"
|
|
# A well-known live password so the serial/recovery console is usable; the
|
|
# graphical session still logs in automatically via greetd. This is live-only
|
|
# and is never written to an installed system.
|
|
echo "$LIVE_USER:phoebus" | chroot "$root" chpasswd
|
|
# greetd validates its default-session user at startup even when an
|
|
# initial_session is configured, so the greeter account must exist.
|
|
if ! in_root id greeter >/dev/null 2>&1; then
|
|
in_root useradd --system --no-create-home --home-dir /var/lib/greetd \
|
|
--shell /sbin/nologin --comment "Phoebus greeter" greeter
|
|
fi
|
|
|
|
say "build Mango ${MANGO_VERSION}"
|
|
tar -xzf "$PHOEBUS_SRC/mango-${MANGO_VERSION}.tar.gz" -C "$root/tmp"
|
|
in_root sh -c "cd /tmp/mango-${MANGO_VERSION} && \
|
|
meson setup build --prefix=/usr --buildtype=release -Dxwayland=enabled && \
|
|
ninja -C build && ninja -C build install"
|
|
rm -rf "$root/tmp/mango-${MANGO_VERSION}"
|
|
|
|
say "install DankMaterialShell ${DMS_VERSION}"
|
|
mkdir -p "$root/tmp/dms-full"
|
|
tar -xzf "$PHOEBUS_SRC/dms-full-amd64.tar.gz" -C "$root/tmp/dms-full"
|
|
dmsdir="$root/tmp/dms-full"
|
|
[ -x "$dmsdir/bin/dms" ] || { echo "livefs-hook: dms binary missing" >&2; exit 1; }
|
|
install -D -m 0755 "$dmsdir/bin/dms" "$root/usr/bin/dms"
|
|
install -d "$root/usr/share/quickshell"
|
|
cp -a "$dmsdir/dms" "$root/usr/share/quickshell/dms"
|
|
if [ -f "$root/usr/share/quickshell/dms/assets/systemd/dms.service" ]; then
|
|
install -D -m 0644 \
|
|
"$root/usr/share/quickshell/dms/assets/systemd/dms.service" \
|
|
"$root/usr/lib/systemd/user/dms.service"
|
|
install -d "$root/etc/systemd/user/mango-session.target.wants"
|
|
ln -sf /usr/lib/systemd/user/dms.service \
|
|
"$root/etc/systemd/user/mango-session.target.wants/dms.service"
|
|
fi
|
|
for entry in "$root/usr/share/quickshell/dms/assets/"*.desktop; do
|
|
[ -f "$entry" ] || continue
|
|
install -D -m 0644 "$entry" \
|
|
"$root/usr/share/applications/$(basename "$entry")"
|
|
done
|
|
if [ -d "$dmsdir/completions" ]; then
|
|
install -d "$root/usr/share/bash-completion/completions"
|
|
[ -f "$dmsdir/completions/completion.bash" ] && \
|
|
install -m 0644 "$dmsdir/completions/completion.bash" \
|
|
"$root/usr/share/bash-completion/completions/dms"
|
|
fi
|
|
rm -rf "$root/tmp/dms-full"
|
|
|
|
say "enable services"
|
|
# Regenerate the initramfs now that live-boot/live-config and the desktop
|
|
# packages are installed, so the live boot hooks are present.
|
|
in_root update-initramfs -u -k all >/dev/null 2>&1 || \
|
|
echo "livefs-hook: update-initramfs reported an issue" >&2
|
|
for svc in greetd.service NetworkManager.service bluetooth.service systemd-resolved.service \
|
|
serial-getty@ttyS0.service; do
|
|
in_root systemctl enable "$svc" >/dev/null 2>&1 \
|
|
|| echo "livefs-hook: could not enable $svc" >&2
|
|
done
|
|
|
|
say "desktop rootfs ready"
|