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>
This commit is contained in:
das
2026-10-19 08:59:09 +03:00
co-authored by Claude Opus 5.5
parent b7399031c7
commit ecced4e3f4
51 changed files with 849 additions and 14 deletions
+22
View File
@@ -0,0 +1,22 @@
# Template file for 'calamares'
pkgname=calamares
version=3.4.3
revision=2
build_style=cmake
configure_args="-DWITH_QT6=ON -DWITH_QML=OFF -DWITH_PYTHON=ON -DWITH_PYBIND11=ON
-DINSTALL_CONFIG=OFF -DBUILD_TESTING=OFF -DBUILD_SCHEMA_TESTING=OFF
-DBUILD_CRASH_REPORTING=OFF -DCMAKE_INSTALL_LIBEXECDIR=libexec
-DUSE_services=none
-DSKIP_MODULES=dummycpp;dummyprocess;dummypython;initcpio;initcpiocfg;mkinitfs;openrcdmcryptcfg;plasmalnf;plymouthcfg;tracking;zfs;zfshostid;interactiveterminal"
hostmakedepends="extra-cmake-modules gettext pkg-config python3 qt6-base qt6-tools"
makedepends="icu-devel kf6-kcoreaddons-devel kpmcore-devel libparted-devel
libpwquality-devel libxcrypt-devel polkit-qt6-devel python3-devel qt6-base-devel
qt6-svg-devel qt6-tools-devel yaml-cpp-devel"
depends="ckbcomp kpmcore polkit python3 qt6-plugin-tls-openssl qt6-svg rsync
squashfs-tools xkeyboard-config"
short_desc="Distribution-independent installer framework"
maintainer="Das <anry.das@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://calamares.codeberg.page"
distfiles="https://codeberg.org/Calamares/calamares/releases/download/v${version}/calamares-${version}.tar.gz"
checksum=144cbbf6bdcebfb21685950db4f0777218519df095f62f4aa392f28348110d18
+1
View File
@@ -0,0 +1 @@
../../../LICENSE
@@ -0,0 +1,37 @@
---
componentName: dasos
welcomeStyleCalamares: false
welcomeExpandingLogo: true
windowExpanding: normal
windowSize: 960px,640px
windowPlacement: center
sidebar: widget
navigation: widget
strings:
productName: "Das OS"
shortProductName: "Das OS"
version: "0.2.0"
shortVersion: "0.2"
versionedName: "Das OS 0.2.0"
shortVersionedName: "Das OS 0.2"
bootloaderEntryName: "Das OS"
productUrl: "https://git.das.org.ua/das/Das-OS"
supportUrl: "https://git.das.org.ua/das/Das-OS/issues"
images:
productIcon: "/usr/share/icons/hicolor/scalable/apps/das-logo.svg"
productLogo: "/usr/share/icons/hicolor/scalable/apps/das-logo.svg"
productWelcome: "welcome.svg"
slideshow:
- "slide-1.svg"
- "slide-2.svg"
- "slide-3.svg"
style:
SidebarBackground: "#1b1f27"
SidebarText: "#e3e6ec"
SidebarTextCurrent: "#1b1f27"
SidebarBackgroundCurrent: "#ffd23f"
@@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="440" viewBox="0 0 800 440">
<defs>
<path id="petal" d="M0 0 L19.13 -46.19 L0 -92.39 L-19.13 -46.19 Z"/>
<path id="core" d="M0 -25.4 L8.61 -46.19 L0 -66.98 L-8.61 -46.19 Z"/>
<g id="pb"><use xlink:href="#petal" fill="#2f6fde"/><use xlink:href="#core" fill="#ffd23f"/></g>
<g id="py"><use xlink:href="#petal" fill="#f5c400"/><use xlink:href="#core" fill="#1f4fa8"/></g>
<g id="star">
<use xlink:href="#pb"/><use xlink:href="#py" transform="rotate(45)"/>
<use xlink:href="#pb" transform="rotate(90)"/><use xlink:href="#py" transform="rotate(135)"/>
<use xlink:href="#pb" transform="rotate(180)"/><use xlink:href="#py" transform="rotate(225)"/>
<use xlink:href="#pb" transform="rotate(270)"/><use xlink:href="#py" transform="rotate(315)"/>
</g>
<pattern id="stitch" patternUnits="userSpaceOnUse" width="28" height="20">
<path d="M14 0 L24 10 L14 20 L4 10 Z" fill="#2f6fde"/>
<path d="M14 6 L18 10 L14 14 L10 10 Z" fill="#f5c400"/>
</pattern>
</defs>
<rect width="800" height="440" fill="#f6f7fa"/>
<rect y="420" width="800" height="20" fill="url(#stitch)"/>
<use xlink:href="#star" transform="translate(150 210) scale(1.15)"/>
<g font-family="Inter, sans-serif" fill="#1f2430">
<text x="300" y="150" font-size="34" font-weight="600">Ласкаво просимо!</text>
<text x="300" y="205" font-size="19">Das OS — легка система на Void Linux</text>
<text x="300" y="235" font-size="19">з робочим столом Xfce, українською</text>
<text x="300" y="265" font-size="19">мовою та звичними програмами.</text>
<text x="300" y="295" font-size="19"></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="440" viewBox="0 0 800 440">
<defs>
<path id="petal" d="M0 0 L19.13 -46.19 L0 -92.39 L-19.13 -46.19 Z"/>
<path id="core" d="M0 -25.4 L8.61 -46.19 L0 -66.98 L-8.61 -46.19 Z"/>
<g id="pb"><use xlink:href="#petal" fill="#2f6fde"/><use xlink:href="#core" fill="#ffd23f"/></g>
<g id="py"><use xlink:href="#petal" fill="#f5c400"/><use xlink:href="#core" fill="#1f4fa8"/></g>
<g id="star">
<use xlink:href="#pb"/><use xlink:href="#py" transform="rotate(45)"/>
<use xlink:href="#pb" transform="rotate(90)"/><use xlink:href="#py" transform="rotate(135)"/>
<use xlink:href="#pb" transform="rotate(180)"/><use xlink:href="#py" transform="rotate(225)"/>
<use xlink:href="#pb" transform="rotate(270)"/><use xlink:href="#py" transform="rotate(315)"/>
</g>
<pattern id="stitch" patternUnits="userSpaceOnUse" width="28" height="20">
<path d="M14 0 L24 10 L14 20 L4 10 Z" fill="#2f6fde"/>
<path d="M14 6 L18 10 L14 14 L10 10 Z" fill="#f5c400"/>
</pattern>
</defs>
<rect width="800" height="440" fill="#f6f7fa"/>
<rect y="420" width="800" height="20" fill="url(#stitch)"/>
<use xlink:href="#star" transform="translate(150 210) scale(1.15)"/>
<g font-family="Inter, sans-serif" fill="#1f2430">
<text x="300" y="150" font-size="34" font-weight="600">Знімки системи</text>
<text x="300" y="205" font-size="19">Btrfs і snapper щогодини зберігають</text>
<text x="300" y="235" font-size="19">стан системи. Попередній знімок можна</text>
<text x="300" y="265" font-size="19">завантажити з меню GRUB і повернути</text>
<text x="300" y="295" font-size="19">командою sudo snapper-rollback.</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="440" viewBox="0 0 800 440">
<defs>
<path id="petal" d="M0 0 L19.13 -46.19 L0 -92.39 L-19.13 -46.19 Z"/>
<path id="core" d="M0 -25.4 L8.61 -46.19 L0 -66.98 L-8.61 -46.19 Z"/>
<g id="pb"><use xlink:href="#petal" fill="#2f6fde"/><use xlink:href="#core" fill="#ffd23f"/></g>
<g id="py"><use xlink:href="#petal" fill="#f5c400"/><use xlink:href="#core" fill="#1f4fa8"/></g>
<g id="star">
<use xlink:href="#pb"/><use xlink:href="#py" transform="rotate(45)"/>
<use xlink:href="#pb" transform="rotate(90)"/><use xlink:href="#py" transform="rotate(135)"/>
<use xlink:href="#pb" transform="rotate(180)"/><use xlink:href="#py" transform="rotate(225)"/>
<use xlink:href="#pb" transform="rotate(270)"/><use xlink:href="#py" transform="rotate(315)"/>
</g>
<pattern id="stitch" patternUnits="userSpaceOnUse" width="28" height="20">
<path d="M14 0 L24 10 L14 20 L4 10 Z" fill="#2f6fde"/>
<path d="M14 6 L18 10 L14 14 L10 10 Z" fill="#f5c400"/>
</pattern>
</defs>
<rect width="800" height="440" fill="#f6f7fa"/>
<rect y="420" width="800" height="20" fill="url(#stitch)"/>
<use xlink:href="#star" transform="translate(150 210) scale(1.15)"/>
<g font-family="Inter, sans-serif" fill="#1f2430">
<text x="300" y="150" font-size="34" font-weight="600">Ваші файли в безпеці</text>
<text x="300" y="205" font-size="19">Домашня тека лежить в окремому</text>
<text x="300" y="235" font-size="19">підтомі й не входить до знімків,</text>
<text x="300" y="265" font-size="19">тому відкат системи її не зачіпає.</text>
<text x="300" y="295" font-size="19"></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="480" height="300" viewBox="0 0 480 300">
<defs>
<path id="petal" d="M0 0 L19.13 -46.19 L0 -92.39 L-19.13 -46.19 Z"/>
<path id="core" d="M0 -25.4 L8.61 -46.19 L0 -66.98 L-8.61 -46.19 Z"/>
<g id="pb"><use xlink:href="#petal" fill="#2f6fde"/><use xlink:href="#core" fill="#ffd23f"/></g>
<g id="py"><use xlink:href="#petal" fill="#f5c400"/><use xlink:href="#core" fill="#1f4fa8"/></g>
<g id="star">
<use xlink:href="#pb"/><use xlink:href="#py" transform="rotate(45)"/>
<use xlink:href="#pb" transform="rotate(90)"/><use xlink:href="#py" transform="rotate(135)"/>
<use xlink:href="#pb" transform="rotate(180)"/><use xlink:href="#py" transform="rotate(225)"/>
<use xlink:href="#pb" transform="rotate(270)"/><use xlink:href="#py" transform="rotate(315)"/>
</g>
<pattern id="stitch" patternUnits="userSpaceOnUse" width="28" height="20">
<path d="M14 0 L24 10 L14 20 L4 10 Z" fill="#2f6fde"/>
<path d="M14 6 L18 10 L14 14 L10 10 Z" fill="#f5c400"/>
</pattern>
</defs>
<use xlink:href="#star" transform="translate(240 130) scale(1.15)"/>
<text x="240" y="285" text-anchor="middle" font-family="Inter, sans-serif" font-size="34" font-weight="600" fill="#2f6fde">Das OS</text>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,13 @@
---
efiBootLoader: "grub"
kernelSearchPath: "/boot"
kernelPattern: "^vmlinuz.*"
kernelParams: [ "quiet", "loglevel=3" ]
grubInstall: "grub-install"
grubMkconfig: "grub-mkconfig"
grubCfg: "/boot/grub/grub.cfg"
grubProbe: "grub-probe"
efiBootMgr: "efibootmgr"
efiBootloaderId: "dasos"
installEFIFallback: true
installHybridGRUB: false
@@ -0,0 +1,10 @@
---
displaymanagers:
- lightdm
defaultDesktopEnvironment:
executable: "startxfce4"
desktopFile: "xfce"
basicSetup: false
sysconfigSetup: false
lightdm:
preferred_greeters: ["lightdm-gtk-greeter.desktop"]
@@ -0,0 +1,4 @@
---
restartNowMode: user-unchecked
restartNowCommand: "loginctl reboot"
notifyOnFinished: false
@@ -0,0 +1,9 @@
---
crypttabOptions: luks
tmpOptions:
default:
tmpfs: true
options: "defaults,nosuid,nodev,mode=1777"
ssd:
tmpfs: true
options: "defaults,noatime,nosuid,nodev,mode=1777"
@@ -0,0 +1,13 @@
---
overwrite: false
prefer_grub_d: false
keep_distributor: false
kernel_params: [ "quiet", "loglevel=3" ]
defaults:
GRUB_TIMEOUT: 5
GRUB_DEFAULT: "saved"
GRUB_DISABLE_SUBMENU: true
GRUB_TERMINAL_OUTPUT: "console"
GRUB_DISABLE_RECOVERY: true
GRUB_DISABLE_OS_PROBER: false
always_use_defaults: false
@@ -0,0 +1,7 @@
---
xOrgConfFileName: "/etc/X11/xorg.conf.d/00-keyboard.conf"
convertedKeymapPath: "/usr/share/kbd/keymaps/xkb"
writeEtcDefaultKeyboard: false
configure:
kwin: false
gnome: false
@@ -0,0 +1,5 @@
---
region: "Europe"
zone: "Kyiv"
geoip:
style: none
@@ -0,0 +1,6 @@
# Void has no systemd: only D-Bus needs a machine id (/var/lib/dbus/machine-id).
---
systemd: false
dbus: true
dbus-symlink: false
entropy-copy: false
@@ -0,0 +1,48 @@
---
extraMounts:
- device: proc
fs: proc
mountPoint: /proc
- device: sys
fs: sysfs
mountPoint: /sys
- device: /dev
mountPoint: /dev
options: [ bind ]
- device: tmpfs
fs: tmpfs
mountPoint: /run
- device: /run/udev
mountPoint: /run/udev
options: [ bind ]
- device: efivarfs
fs: efivarfs
mountPoint: /sys/firmware/efi/efivars
efi: true
# The flat layout that snapper-rollback expects: the root in @ and snapshots
# in @snapshots. Home, logs and the package cache stay out of root snapshots,
# so a rollback never touches personal files.
btrfsSubvolumes:
- mountPoint: /
subvolume: /@
- mountPoint: /home
subvolume: /@home
- mountPoint: /.snapshots
subvolume: /@snapshots
- mountPoint: /var/log
subvolume: /@var_log
- mountPoint: /var/cache/xbps
subvolume: /@var_cache_xbps
mountOptions:
- filesystem: default
options: [ defaults ]
- filesystem: efi
options: [ defaults, umask=0077 ]
- filesystem: btrfs
options: [ defaults, noatime, compress=zstd:1 ]
- filesystem: ext4
options: [ defaults, noatime ]
- filesystem: xfs
options: [ defaults, noatime ]
@@ -0,0 +1,10 @@
# The target is a copy of the live system: drop the installer and whatever was
# installed only for it.
---
backend: xbps
skip_if_no_internet: false
update_db: false
update_system: false
operations:
- try_remove:
- das-installer
@@ -0,0 +1,29 @@
---
efi:
mountPoint: "/boot/efi"
recommendedSize: 512MiB
minimumSize: 64MiB
label: "EFI"
userSwapChoices:
- none
- small
- suspend
initialSwapChoice: none
drawNestedPartitions: false
alwaysShowPartitionLabels: true
allowManualPartitioning: true
initialPartitioningChoice: none
# Btrfs subvolumes (see mount.conf) give snapper snapshots and rollback.
defaultFileSystemType: "btrfs"
availableFileSystemTypes: [ "btrfs", "ext4", "xfs" ]
# Disk encryption needs extra initramfs and GRUB setup that Das OS does not
# have yet.
enableLuksAutomatedPartitioning: false
essentialMounts: [ "live-*", "control", "ventoy" ]
lvm:
enable: false
@@ -0,0 +1,7 @@
---
dontChroot: false
timeout: 900
verbose: true
script:
- command: "/usr/libexec/das/installer/postinstall"
timeout: 900
@@ -0,0 +1,9 @@
# The first snapshot is the freshly installed system. grub-mkconfig then adds
# it to the boot menu through grub-btrfs.
---
dontChroot: false
timeout: 300
verbose: true
script:
- "-snapper --no-dbus -c root create -d 'Fresh install' -c number --userdata important=yes"
- "-grub-mkconfig -o /boot/grub/grub.cfg"
@@ -0,0 +1,5 @@
---
dontChroot: true
timeout: 60
script:
- "/usr/libexec/das/installer/mount-source"
@@ -0,0 +1,7 @@
# Copy the clean live image that shellprocess@source mounts, not the running
# live root (see mount-source).
---
unpack:
- source: "/run/das-installer/root"
sourcefs: "file"
destination: ""
@@ -0,0 +1,53 @@
---
defaultGroups:
- name: users
must_exist: true
system: true
- name: wheel
must_exist: true
system: true
- audio
- video
- input
- storage
- network
- optical
- scanner
- lp
- kvm
- plugdev
- name: bluetooth
must_exist: false
system: true
sudoersGroup: wheel
sudoersConfigureWithGroup: true
autologinGroup: autologin
setRootPassword: true
doReusePassword: true
displayAutologin: true
doAutologin: false
passwordRequirements:
minLength: 4
maxLength: -1
allowWeakPasswords: true
allowWeakPasswordsDefault: true
user:
shell: /bin/bash
forbidden_names: [ root, live ]
home_permissions: "o700"
hostname:
location: EtcFile
writeHostsFile: true
template: "${login}-dasos"
forbidden_names: [ localhost ]
presets:
fullName:
editable: true
loginName:
editable: true
@@ -0,0 +1,24 @@
---
showSupportUrl: true
showKnownIssuesUrl: false
showReleaseNotesUrl: false
showDonateUrl: false
requirements:
requiredStorage: 15
requiredRam: 1.5
internetCheckUrl: https://voidlinux.org
check:
- storage
- ram
- power
- internet
- root
- screen
required:
- storage
- ram
- root
geoip:
style: none
@@ -0,0 +1,54 @@
# Calamares settings for Das OS (Void Linux, runit).
---
modules-search: [ local ]
instances:
- id: source
module: shellprocess
config: shellprocess-source.conf
- id: postinstall
module: shellprocess
config: shellprocess-postinstall.conf
- id: snapshot
module: shellprocess
config: shellprocess-snapshot.conf
sequence:
- show:
- welcome
- locale
- keyboard
- partition
- users
- summary
- exec:
- partition
- mount
- shellprocess@source
- unpackfs
- machineid
- locale
- keyboard
- localecfg
- fstab
- users
- displaymanager
- networkcfg
- hwclock
- grubcfg
- shellprocess@postinstall
- packages
- bootloader
- shellprocess@snapshot
- umount
- show:
- finished
branding: dasos
prompt-install: true
dont-chroot: false
oem-setup: false
disable-cancel: false
disable-cancel-during-exec: false
hide-back-and-next-during-exec: true
quit-at-end: false
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
# Start the Das OS installer as root. The live user has passwordless sudo.
exec sudo --preserve-env=DISPLAY,XAUTHORITY,LANG,LANGUAGE,LC_ALL \
/usr/bin/calamares "$@"
@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=Das OS installer icon
Comment=Put the installer on the live desktop
Exec=/usr/libexec/das/installer/installer-icon
OnlyShowIn=XFCE;
NoDisplay=true
@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=Install Das OS
Name[uk]=Встановити Das OS
Comment=Install Das OS on this computer
Comment[uk]=Встановити Das OS на цей комп'ютер
Exec=das-install
Icon=das-logo
Terminal=false
Categories=System;
Keywords=installer;calamares;
Keywords[uk]=встановлення;інсталятор;calamares;
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# Put the installer launcher on the live user's desktop. Xfce runs launchers
# from the desktop only when they are executable and marked as trusted.
desktop=$(xdg-user-dir DESKTOP 2>/dev/null)
[ -n "$desktop" ] && [ "$desktop" != "$HOME" ] || desktop="$HOME/Desktop"
launcher="$desktop/das-installer.desktop"
[ -e "$launcher" ] && exit 0
mkdir -p "$desktop"
install -m 755 /usr/share/applications/das-installer.desktop "$launcher"
gio set -t string "$launcher" metadata::xfce-exe-checksum \
"$(sha256sum "$launcher" | cut -d' ' -f1)" 2>/dev/null || true
+17
View File
@@ -0,0 +1,17 @@
#!/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"
+49
View File
@@ -0,0 +1,49 @@
#!/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"
+22
View File
@@ -0,0 +1,22 @@
# Template file for 'das-installer'
pkgname=das-installer
version=0.1.0
revision=1
depends="calamares das-snapshots das-theme sudo"
short_desc="Das OS installer: Calamares configuration and branding for the live ISO"
maintainer="Das <anry.das@gmail.com>"
license="MIT"
homepage="https://git.das.org.ua/das/Das-OS"
do_install() {
local f
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
vlicense ${FILESDIR}/LICENSE
}
@@ -0,0 +1,8 @@
# Sourced by /etc/sv/lightdm/run (installed by das-settings).
# runit starts services with an empty environment, so pass the system language
# from /etc/locale.conf to LightDM: the greeter and new sessions use it.
if [ -r /etc/locale.conf ]; then
set -a
. /etc/locale.conf
set +a
fi
+3 -2
View File
@@ -4,7 +4,7 @@
# Defaults go to /etc/xdg/das, which /etc/profile.d/das-xdg.sh puts in front of
# /etc/xdg: stock Xfce files stay untouched and users' own changes still win.
pkgname=das-settings
version=0.1.0
version=0.2.0
revision=1
create_wrksrc=yes
depends="das-theme lightdm lightdm-gtk-greeter xfce4-notifyd xfce4-panel
@@ -14,7 +14,7 @@ short_desc="Das OS desktop defaults: Xfce panel, theme, fonts, login screen"
maintainer="Das <anry.das@gmail.com>"
license="MIT"
homepage="https://git.das.org.ua/das/Das-OS"
conf_files="/etc/profile.d/das-xdg.sh /etc/xdg/das/xfce4/xfconf/xfce-perchannel-xml/*.xml"
conf_files="/etc/profile.d/das-xdg.sh /etc/sv/lightdm/conf /etc/xdg/das/xfce4/xfconf/xfce-perchannel-xml/*.xml"
do_install() {
local xml
@@ -28,6 +28,7 @@ do_install() {
vinstall "${FILESDIR}/autostart/das-session-init.desktop" 644 etc/xdg/autostart
vinstall "${FILESDIR}/lightdm/50-das.conf" 644 usr/share/lightdm/lightdm.conf.d
vinstall "${FILESDIR}/lightdm/sv-conf" 644 etc/sv/lightdm conf
vinstall "${FILESDIR}/lightdm/50-das-greeter.conf" 644 \
usr/share/lightdm/lightdm-gtk-greeter.conf.d 50-das.conf
vlicense "${FILESDIR}/LICENSE"
+1
View File
@@ -0,0 +1 @@
../../../LICENSE
+49
View File
@@ -0,0 +1,49 @@
#!/bin/sh
# Set up snapper for a Das OS root file system on Btrfs.
#
# Expects the layout created by the installer: the root in subvolume @ and
# snapshots in subvolume @snapshots mounted at /.snapshots, which is what
# snapper-rollback needs. Safe to run again.
set -eu
msg() { echo "das-snapper-setup: $*"; }
if [ "$(id -u)" -ne 0 ]; then
msg "must be run as root" >&2
exit 1
fi
if [ "$(findmnt -no FSTYPE /)" != btrfs ]; then
msg "the root file system is not Btrfs, nothing to do"
exit 0
fi
if [ "$(findmnt -no FSTYPE /.snapshots 2>/dev/null)" != btrfs ]; then
msg "/.snapshots is not a mounted Btrfs subvolume" >&2
exit 1
fi
if [ ! -e /etc/snapper/configs/root ]; then
install -m 640 /usr/share/das/snapper/root /etc/snapper/configs/root
msg "created /etc/snapper/configs/root"
fi
if ! grep -q '^SNAPPER_CONFIGS=".*\broot\b' /etc/conf.d/snapper; then
sed -i 's/^SNAPPER_CONFIGS=.*/SNAPPER_CONFIGS="root"/' /etc/conf.d/snapper
fi
chmod 750 /.snapshots
chgrp wheel /.snapshots
# snapper-rollback mounts the top-level subvolume from this device.
dev=$(findmnt -no SOURCE / | sed 's/\[.*\]$//')
uuid=$(blkid -s UUID -o value "$dev")
sed -i "s|^#\?\s*dev = .*|dev = /dev/disk/by-uuid/$uuid|" /etc/snapper-rollback.conf
# Name the GRUB submenu that grub-btrfs adds
cfg=/etc/default/grub-btrfs/config
if [ -f "$cfg" ] && ! grep -q '^GRUB_BTRFS_SUBMENUNAME=' "$cfg"; then
echo 'GRUB_BTRFS_SUBMENUNAME="Das OS snapshots"' >>"$cfg"
fi
# Hourly snapshots come from cron, and grub-btrfs adds them to the boot menu.
for sv in cronie grub-btrfs; do
ln -sfn "/etc/sv/$sv" "/etc/runit/runsvdir/default/$sv"
done
msg "snapshots are enabled"
@@ -0,0 +1,2 @@
# Lets a read-only snapper snapshot boot from the GRUB menu (see das-snapshot-overlay).
add_dracutmodules+=" das-snapshot-overlay "
@@ -0,0 +1,14 @@
#!/bin/sh
# Snapper snapshots are read-only, and the system can't start from a read-only
# root. When GRUB boots a snapshot, mount it under an overlay whose writable
# layer lives in RAM. Changes made in that session are lost at shutdown.
[ "$(btrfs property get -ts "$NEWROOT" ro 2>/dev/null)" = "ro=true" ] || return 0
info "das-snapshot-overlay: read-only snapshot, adding a writable overlay"
lower=$(mktemp -d -p /)
ram=$(mktemp -d -p /)
mount --move "$NEWROOT" "$lower"
mount -t tmpfs -o mode=0755 das-overlay "$ram"
mkdir -p "$ram/upper" "$ram/work"
mount -t overlay -o "lowerdir=$lower,upperdir=$ram/upper,workdir=$ram/work" das-overlay "$NEWROOT"
@@ -0,0 +1,20 @@
#!/bin/bash
# Dracut module: boot read-only Btrfs snapshots with a writable overlay in RAM.
check() {
require_binaries btrfs || return 1
return 0
}
depends() {
echo btrfs
}
installkernel() {
hostonly='' instmods overlay
}
install() {
inst_multiple btrfs mktemp
inst_hook pre-pivot 10 "$moddir/das-snapshot-overlay.sh"
}
@@ -0,0 +1,37 @@
# Snapper configuration for the Das OS root file system.
# das-snapper-setup copies it to /etc/snapper/configs/root.
SUBVOLUME="/"
FSTYPE="btrfs"
QGROUP=""
# Snapshots may use at most half of the file system and must leave 20% free.
SPACE_LIMIT="0.5"
FREE_LIMIT="0.2"
# Members of wheel can list and compare snapshots without sudo.
ALLOW_USERS=""
ALLOW_GROUPS="wheel"
SYNC_ACL="yes"
BACKGROUND_COMPARISON="yes"
# Snapshots made by das-update and by hand.
NUMBER_CLEANUP="yes"
NUMBER_MIN_AGE="3600"
NUMBER_LIMIT="20"
NUMBER_LIMIT_IMPORTANT="10"
# Hourly snapshots made by cron.
TIMELINE_CREATE="yes"
TIMELINE_CLEANUP="yes"
TIMELINE_MIN_AGE="3600"
TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAILY="7"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="0"
TIMELINE_LIMIT_QUARTERLY="0"
TIMELINE_LIMIT_YEARLY="0"
EMPTY_PRE_POST_CLEANUP="yes"
EMPTY_PRE_POST_MIN_AGE="3600"
+20
View File
@@ -0,0 +1,20 @@
# Template file for 'das-snapshots'
pkgname=das-snapshots
version=0.1.0
revision=1
depends="btrfs-progs cronie dracut grub-btrfs snapper snapper-rollback"
short_desc="Das OS Btrfs snapshots: snapper setup, boot menu entries and rollback"
maintainer="Das <anry.das@gmail.com>"
license="MIT"
homepage="https://git.das.org.ua/das/Das-OS"
do_install() {
vbin ${FILESDIR}/das-snapper-setup
vinstall ${FILESDIR}/snapper-root.conf 644 usr/share/das/snapper root
vinstall ${FILESDIR}/das-snapshots.conf 644 usr/lib/dracut/dracut.conf.d 50-das-snapshots.conf
vinstall ${FILESDIR}/dracut/90das-snapshot-overlay/module-setup.sh 755 \
usr/lib/dracut/modules.d/90das-snapshot-overlay
vinstall ${FILESDIR}/dracut/90das-snapshot-overlay/das-snapshot-overlay.sh 755 \
usr/lib/dracut/modules.d/90das-snapshot-overlay
vlicense ${FILESDIR}/LICENSE
}