Fix issues found testing stage 5 in a VM

- Calamares branding takes the version from VERSION at ISO build time
- das-update tray hides its icon when updates were installed elsewhere
  (watches the xbps package database)
- Installer removes guest tools of other hypervisors; the live image
  starts VBoxClient only inside VirtualBox
- Live session no longer locks the screen while the installer runs
- das-tools 0.2.0, das-installer 0.2.0, das-settings 0.4.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
das
2026-10-19 19:43:51 +03:00
co-authored by Claude Opus 5.5
parent d1d76c2bef
commit 5349a028c8
11 changed files with 91 additions and 23 deletions
@@ -12,10 +12,10 @@ 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"
version: "@VERSION@"
shortVersion: "@SHORT_VERSION@"
versionedName: "Das OS @VERSION@"
shortVersionedName: "Das OS @SHORT_VERSION@"
bootloaderEntryName: "Das OS"
productUrl: "https://git.das.org.ua/das/Das-OS"
supportUrl: "https://git.das.org.ua/das/Das-OS/issues"
+19 -4
View File
@@ -22,12 +22,27 @@ 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.
# 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
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
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
+1 -1
View File
@@ -1,6 +1,6 @@
# Template file for 'das-installer'
pkgname=das-installer
version=0.1.0
version=0.2.0
revision=1
depends="calamares das-snapshots das-theme sudo"
short_desc="Das OS installer: Calamares configuration and branding for the live ISO"
@@ -4,6 +4,21 @@
# which is only known inside the session. Runs once per user.
set -u
# Sets an xfconf property, creating it when it does not exist yet.
set_prop() {
local channel=$1 prop=$2 type=$3 value=$4
xfconf-query -c "$channel" -p "$prop" -s "$value" 2>/dev/null ||
xfconf-query -c "$channel" -p "$prop" -n -t "$type" -s "$value"
}
# The live session must not lock the screen: the installer runs for minutes
# without input, and the live user's password is not something people know.
# Static files would reach the installed system, which copies the live image.
if grep -q '\(^\| \)root=live:' /proc/cmdline; then
set_prop xfce4-screensaver /lock/enabled bool false
set_prop xfce4-power-manager /xfce4-power-manager/lock-screen-suspend-hibernate bool false
fi
marker="${XDG_CONFIG_HOME:-$HOME/.config}/das/session-init.done"
[[ -e $marker ]] && exit 0
@@ -12,13 +27,6 @@ if [[ $(xfconf-query -c xsettings -p /Net/ThemeName 2>/dev/null) == *-Dark ]]; t
wallpaper=/usr/share/backgrounds/das/das-dark.svg
fi
# Sets an xfconf property, creating it when it does not exist yet.
set_prop() {
local prop=$1 type=$2 value=$3
xfconf-query -c xfce4-desktop -p "$prop" -s "$value" 2>/dev/null ||
xfconf-query -c xfce4-desktop -p "$prop" -n -t "$type" -s "$value"
}
# "xrandr --listactivemonitors" prints a header, then one line per monitor ending in its connector name.
monitors=$(xrandr --listactivemonitors 2>/dev/null | awk 'NR > 1 { print $NF }')
if [[ -z $monitors ]]; then
@@ -28,8 +36,8 @@ fi
for monitor in $monitors; do
base="/backdrop/screen0/monitor${monitor}/workspace0"
set_prop "$base/last-image" string "$wallpaper"
set_prop "$base/image-style" int 5 # zoomed: fill the screen, keep proportions
set_prop xfce4-desktop "$base/last-image" string "$wallpaper"
set_prop xfce4-desktop "$base/image-style" int 5 # zoomed: fill the screen, keep proportions
done
mkdir -p "${marker%/*}" && touch "$marker"
+1 -1
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.3.0
version=0.4.0
revision=1
create_wrksrc=yes
depends="das-theme lightdm lightdm-gtk-greeter xfce4-notifyd xfce4-panel
@@ -22,6 +22,9 @@ const (
firstCheck = 2 * time.Minute
checkInterval = 6 * time.Hour
checkTimeout = 5 * time.Minute
// How often to look for updates installed outside the tray: from a
// separately started window, das-update --cli or xbps-install.
pkgdbInterval = time.Minute
)
type trayApp struct {
@@ -29,6 +32,7 @@ type trayApp struct {
checking bool
notified []string // the updates the last notification was about
window *exec.Cmd
pkgdb time.Time // package database time at the last check
}
func runTray() int {
@@ -69,6 +73,12 @@ func runTray() int {
})
return false
})
glib.TimeoutSecondsAdd(uint(pkgdbInterval.Seconds()), func() bool {
if t.notified != nil && !xbps.PkgdbTime().Equal(t.pkgdb) {
t.check()
}
return true
})
gtk.Main()
return 0
}
@@ -78,6 +88,7 @@ func (t *trayApp) check() {
return
}
t.checking = true
t.pkgdb = xbps.PkgdbTime()
go func() {
ctx, cancel := context.WithTimeout(context.Background(), checkTimeout)
defer cancel()
@@ -4,11 +4,17 @@ package xbps
import (
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"time"
)
// pkgdbGlob matches the package database, which xbps rewrites on every transaction.
const pkgdbGlob = "/var/db/xbps/pkgdb-*.plist"
// Update is one package that a full system update would change.
type Update struct {
Name string
@@ -46,6 +52,19 @@ func Check(ctx context.Context) ([]Update, error) {
return updates, nil
}
// PkgdbTime tells when the installed packages last changed: the modification
// time of the package database, zero when it can't be read.
func PkgdbTime() time.Time {
paths, _ := filepath.Glob(pkgdbGlob)
var latest time.Time
for _, p := range paths {
if fi, err := os.Stat(p); err == nil && fi.ModTime().After(latest) {
latest = fi.ModTime()
}
}
return latest
}
// ParseDryRun parses "xbps-install -un" output: one transaction entry per
// line, "<pkgver> <action> <arch> <repository> [sizes]". Other lines are skipped.
func ParseDryRun(out string) []Update {
+1 -1
View File
@@ -1,7 +1,7 @@
# Template file for 'das-tools'
# In-tree package: Go sources are in files/src (FILESDIR).
pkgname=das-tools
version=0.1.0
version=0.2.0
revision=1
create_wrksrc=yes
# Like build_style=go: the Go linker decides about PIE, xbps-src must not check it