Files
Das-OS/srcpkgs/das-installer/files/postinstall
T
dasandClaude Opus 5.5 ecced4e3f4 Stage 4: Calamares installer and Btrfs snapshots (0.2.0)
- Package Calamares 3.4.3 (Qt6, widgets UI) with xbps-src.
- das-installer: Calamares setup for Void/runit with Das OS branding and
  slides. It copies the clean live image (live-base), builds locales and the
  host-only initramfs, rewrites kernels without sparse tails (GRUB 2.12 cannot
  read Btrfs holes at the end of a file), then removes itself.
- das-snapshots: flat Btrfs layout (@, @home, @snapshots, @var_log,
  @var_cache_xbps), snapper with hourly snapshots via cronie, grub-btrfs menu,
  snapper-rollback, and a dracut module that boots read-only snapshots with
  a RAM overlay.
- das-settings 0.2.0: start LightDM with the system locale.
- Live image: GRUB, efibootmgr and the new packages; Das OS /etc/issue.
- Build: wipe stale destdirs before building packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:59:09 +03:00

50 lines
1.8 KiB
Bash
Executable File

#!/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 are only useful inside a virtual machine.
if ! grep -q '^flags.* hypervisor' /proc/cpuinfo; then
msg "real hardware: removing virtual machine guest tools"
rm -f /etc/runit/runsvdir/default/spice-vdagentd
xbps-remove -Ry spice-vdagent qemu-ga virtualbox-ose-guest || true
fi
# 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"