Stage 6: server image with a console installer (0.4.0)
- server/ profile and build-iso.sh [desktop|server]; make iso-server, make qemu-server, run-qemu.sh --serial; login on tty and ttyS0 - das-server: SSH, chrony, NetworkManager/dhcpcd, Docker with Compose, nftables (closed except SSH, own table), fail2ban reading socklog, sshd without root passwords, Docker log rotation, tools - das-server-install: dialog installer in Ukrainian and English, or unattended with --config; GPT + Btrfs subvolumes, GRUB for UEFI and BIOS, serial console, SSH key with optional keys-only logins - das-install-common: mount-source and postinstall shared with Calamares - dsv: runit service manager (list, enable, disable, start, stop, restart, status, logs) with bash completion, also on the desktop - das-update split into a subpackage without GTK; the window and tray icon move to /usr/libexec/das/das-update-gui - das-snapper-setup enables dbus, which snapper needs - TODO: ISO size review with measured numbers and options Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# Builds the Das OS live ISO with void-mklive from the profile in live/.
|
||||
# Builds a Das OS live ISO with void-mklive from a profile directory:
|
||||
# build-iso.sh the desktop image from live/
|
||||
# build-iso.sh server the console server image from server/
|
||||
# Runs inside the builder container, see scripts/builder.sh.
|
||||
set -euo pipefail
|
||||
|
||||
profile=${1:-desktop}
|
||||
repo=/work/out/hostdir/binpkgs
|
||||
version=$(< /work/VERSION)
|
||||
iso=/work/out/iso/dasos-${version}-x86_64.iso
|
||||
|
||||
case $profile in
|
||||
desktop)
|
||||
dir=/work/live
|
||||
iso=/work/out/iso/dasos-${version}-x86_64.iso
|
||||
title="Das OS"
|
||||
locale=uk_UA.UTF-8
|
||||
cmdline="live.user=live quiet loglevel=3"
|
||||
;;
|
||||
server)
|
||||
dir=/work/server
|
||||
iso=/work/out/iso/dasos-server-${version}-x86_64.iso
|
||||
title="Das OS Server"
|
||||
locale=en_US.UTF-8
|
||||
# Both consoles: a screen and a serial line (IPMI, VPS consoles, QEMU -nographic).
|
||||
# mklive starts a login on ttyS0 when it sees console=ttyS0.
|
||||
cmdline="live.user=live loglevel=4 console=tty0 console=ttyS0,115200"
|
||||
;;
|
||||
*)
|
||||
echo "build-iso: unknown profile '$profile' (desktop, server)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! compgen -G "$repo/*-repodata" >/dev/null; then
|
||||
echo "build-iso: the local package repository is missing, run 'make packages' first" >&2
|
||||
@@ -21,22 +46,25 @@ work=$(mktemp -d)
|
||||
mkdir -p /work/out/iso
|
||||
trap 'rm -rf "$work"; chown -R "$HOST_UID:$HOST_GID" /work/out/iso' EXIT
|
||||
|
||||
# Root file system overlay: static files from live/include plus generated links
|
||||
# Root file system overlay: static files from <profile>/include plus generated links
|
||||
include=$work/include
|
||||
cp -a /work/live/include "$include"
|
||||
mkdir -p "$include/etc"
|
||||
[[ -d $dir/include ]] && cp -a "$dir/include/." "$include"
|
||||
ln -sf /usr/share/zoneinfo/Europe/Kyiv "$include/etc/localtime"
|
||||
# PipeWire as the sound server, wired up the same way as Void's own live images
|
||||
mkdir -p "$include"/etc/xdg/autostart "$include"/etc/pipewire/pipewire.conf.d "$include"/etc/alsa/conf.d
|
||||
ln -sf /usr/share/applications/pipewire.desktop "$include"/etc/xdg/autostart/
|
||||
ln -sf /usr/share/examples/wireplumber/10-wireplumber.conf "$include"/etc/pipewire/pipewire.conf.d/
|
||||
ln -sf /usr/share/examples/pipewire/20-pipewire-pulse.conf "$include"/etc/pipewire/pipewire.conf.d/
|
||||
ln -sf /usr/share/alsa/alsa.conf.d/50-pipewire.conf "$include"/etc/alsa/conf.d/
|
||||
ln -sf /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf "$include"/etc/alsa/conf.d/
|
||||
# The installer shows the Das OS version, which lives in VERSION, not in the package
|
||||
branding=usr/share/calamares/branding/dasos
|
||||
mkdir -p "$include/$branding"
|
||||
sed -e "s/@VERSION@/$version/g" -e "s/@SHORT_VERSION@/${version%.*}/g" \
|
||||
"/work/srcpkgs/das-installer/files/calamares/branding/dasos/branding.desc" >"$include/$branding/branding.desc"
|
||||
if [[ $profile == desktop ]]; then
|
||||
# PipeWire as the sound server, wired up the same way as Void's own live images
|
||||
mkdir -p "$include"/etc/xdg/autostart "$include"/etc/pipewire/pipewire.conf.d "$include"/etc/alsa/conf.d
|
||||
ln -sf /usr/share/applications/pipewire.desktop "$include"/etc/xdg/autostart/
|
||||
ln -sf /usr/share/examples/wireplumber/10-wireplumber.conf "$include"/etc/pipewire/pipewire.conf.d/
|
||||
ln -sf /usr/share/examples/pipewire/20-pipewire-pulse.conf "$include"/etc/pipewire/pipewire.conf.d/
|
||||
ln -sf /usr/share/alsa/alsa.conf.d/50-pipewire.conf "$include"/etc/alsa/conf.d/
|
||||
ln -sf /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf "$include"/etc/alsa/conf.d/
|
||||
# The installer shows the Das OS version, which lives in VERSION, not in the package
|
||||
branding=usr/share/calamares/branding/dasos
|
||||
mkdir -p "$include/$branding"
|
||||
sed -e "s/@VERSION@/$version/g" -e "s/@SHORT_VERSION@/${version%.*}/g" \
|
||||
"/work/srcpkgs/das-installer/files/calamares/branding/dasos/branding.desc" >"$include/$branding/branding.desc"
|
||||
fi
|
||||
|
||||
# mklive's dracut module creates the live user, hostname and passwords at boot.
|
||||
# Rebrand its defaults in this container's copy (the image itself stays untouched).
|
||||
@@ -49,8 +77,9 @@ for pattern in 'echo void-live >' 'voidlinux'; do
|
||||
done
|
||||
sed -i -e 's/echo void-live >/echo dasos >/' -e 's/voidlinux/live/g' "$adduser"
|
||||
# mklive copies its /etc/issue (Void live logins) into the image, and the
|
||||
# installer copies the image to disk, so use a neutral Das OS one.
|
||||
cp /work/live/branding/issue /opt/void-mklive/data/issue
|
||||
# installers copy the image to disk, so use a Das OS one (the server's tells
|
||||
# how to log in to the live system; its installer writes a neutral one).
|
||||
cp "$dir/branding/issue" /opt/void-mklive/data/issue
|
||||
|
||||
rsvg-convert /work/live/branding/splash.svg --output "$work/splash.png"
|
||||
rm -f "$iso"
|
||||
@@ -60,11 +89,11 @@ SPLASH_IMAGE=$work/splash.png ./mklive.sh \
|
||||
-a x86_64 \
|
||||
-r "$repo" \
|
||||
-c /var/cache/xbps \
|
||||
-p "$(read_list /work/live/packages.x86_64)" \
|
||||
-S "$(read_list /work/live/services)" \
|
||||
-p "$(read_list "$dir/packages.x86_64")" \
|
||||
-S "$(read_list "$dir/services")" \
|
||||
-I "$include" \
|
||||
-l uk_UA.UTF-8 \
|
||||
-l "$locale" \
|
||||
-k us \
|
||||
-T "Das OS" \
|
||||
-C "live.user=live quiet loglevel=3" \
|
||||
-T "$title" \
|
||||
-C "$cmdline" \
|
||||
-o "$iso"
|
||||
|
||||
@@ -41,6 +41,11 @@ for dir in /work/srcpkgs/*/; do
|
||||
echo "warning: $name is now in void-packages, consider dropping our template" >&2
|
||||
fi
|
||||
rm -rf "$vp/srcpkgs/$name"
|
||||
# A subpackage is a link to its source package's directory and is built with it
|
||||
if [[ -L ${dir%/} ]]; then
|
||||
as_builder ln -s "$(readlink "${dir%/}")" "$vp/srcpkgs/$name"
|
||||
continue
|
||||
fi
|
||||
as_builder cp -rL "$dir" "$vp/srcpkgs/$name"
|
||||
names+=("$name")
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user