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:
das
2026-10-19 21:28:26 +03:00
co-authored by Claude Opus 5.5
parent 5349a028c8
commit eba4516998
42 changed files with 1454 additions and 114 deletions
@@ -8,3 +8,4 @@ update_system: false
operations:
- try_remove:
- das-installer
- das-install-common
-17
View File
@@ -1,17 +0,0 @@
#!/bin/sh
# Mount the clean live image for Calamares' unpackfs at /run/das-installer/root.
#
# Dracut runs the live root as a device-mapper snapshot (live-rw) that also
# holds the live user and boot-time tweaks. Its origin, live-base, is the
# untouched LiveOS/rootfs.img; mount it read-only without journal replay.
set -eu
root=/run/das-installer/root
mountpoint -q "$root" && exit 0
if [ ! -b /dev/mapper/live-base ]; then
echo "mount-source: /dev/mapper/live-base not found, is this the live system?" >&2
exit 1
fi
mkdir -p "$root"
mount -o ro,noload /dev/mapper/live-base "$root"
-64
View File
@@ -1,64 +0,0 @@
#!/bin/sh
# Finish a Das OS installation. Calamares runs this inside the target system
# after users, locale and display manager are configured, before GRUB.
set -eu
msg() { echo "das-postinstall: $*"; }
# Calamares writes LANG to /etc/locale.conf, but glibc on Void only builds the
# locales enabled in /etc/default/libc-locales.
lang=$(sed -n 's/^LANG=//p' /etc/locale.conf 2>/dev/null | tr -d '"')
for l in "$lang" en_US.UTF-8; do
[ -n "$l" ] || continue
re=$(printf '%s' "$l" | sed 's/[.]/\\./g')
sed -i "s/^#\(${re} \)/\1/" /etc/default/libc-locales
done
msg "building locales"
xbps-reconfigure -f glibc-locales
# Calamares mounts /tmp on tmpfs only when the root disk is an SSD; Void's own
# installer always does.
if ! grep -q '^[^#]*[[:space:]]/tmp[[:space:]]' /etc/fstab; then
echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >>/etc/fstab
fi
# Guest tools only help inside their own hypervisor (VirtualBox's ones even
# complain at every login elsewhere).
machine=$(cat /sys/class/dmi/id/sys_vendor /sys/class/dmi/id/product_name 2>/dev/null || true)
if ! grep -q '^flags.* hypervisor' /proc/cpuinfo; then
machine="real hardware"
fi
case $machine in
*VirtualBox* | *innotek*) unused="spice-vdagent qemu-ga" ;;
*QEMU* | *KVM*) unused="virtualbox-ose-guest" ;;
*) unused="spice-vdagent qemu-ga virtualbox-ose-guest" ;;
esac
msg "removing guest tools not needed here: $unused"
case $unused in
*spice-vdagent*) rm -f /etc/runit/runsvdir/default/spice-vdagentd ;;
esac
case $unused in
# The live image replaces this autostart file, so xbps keeps it as modified
*virtualbox*) rm -f /etc/xdg/autostart/vboxclient.desktop ;;
esac
# shellcheck disable=SC2086
xbps-remove -Ry $unused || true
# Snapper, hourly snapshots and the GRUB snapshot menu (Btrfs only).
das-snapper-setup
# The installer copies files with rsync --sparse, which turns the zero tail of
# a kernel image into a Btrfs hole that GRUB 2.12 can't read ("premature end
# of file"). Rewrite the kernels in full.
for f in /boot/vmlinuz-*; do
cp --sparse=never "$f" "$f.das-tmp"
mv "$f.das-tmp" "$f"
done
# The live image has a generic initramfs. Build the target's own the same way
# Void does on kernel updates (host-only), with das-snapshot-overlay included.
msg "building the initramfs"
for kver in $(ls /usr/lib/modules); do
dracut -q --force "/boot/initramfs-$kver.img" "$kver"
done
msg "done"
+2 -4
View File
@@ -1,8 +1,8 @@
# Template file for 'das-installer'
pkgname=das-installer
version=0.2.0
version=0.3.0
revision=1
depends="calamares das-snapshots das-theme sudo"
depends="calamares das-install-common das-theme sudo"
short_desc="Das OS installer: Calamares configuration and branding for the live ISO"
maintainer="Das <anry.das@gmail.com>"
license="MIT"
@@ -13,8 +13,6 @@ do_install() {
vmkdir usr/share/calamares
vcopy "${FILESDIR}/calamares/*" usr/share/calamares
vbin ${FILESDIR}/das-install
vinstall ${FILESDIR}/postinstall 755 usr/libexec/das/installer
vinstall ${FILESDIR}/mount-source 755 usr/libexec/das/installer
vinstall ${FILESDIR}/installer-icon 755 usr/libexec/das/installer
vinstall ${FILESDIR}/das-installer.desktop 644 usr/share/applications
vinstall ${FILESDIR}/das-installer-icon.desktop 644 etc/xdg/autostart