fix(session): give the runtime a machine ID so D-Bus programs such as melonDS start (#2275)

* fix(session): give the runtime a machine ID so D-Bus programs start

The Ubuntu runtime ships an empty /etc/machine-id for systemd to fill on first
boot, and nothing fills it in a DroidDeck session. libdbus aborts when it needs
the ID ("D-Bus library appears to be incorrectly set up"), so melonDS closed at
once from the desktop and GTK Flatpaks started outside the session bus failed.

The session now writes a fresh ID once when the file is empty or malformed and
never changes a valid one.

* fix(session): check the whole machine ID file and reject the all-zero ID
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-08 08:54:56 -05:00
1 parent 45e39b7aaf
commit aa883830ca
2 files changed
+71

No files matched your search

@@ -56,6 +56,16 @@ sync_timezone() {
} 2>/dev/null
sync_timezone
ensure_machine_id() {
local id=
id=$(< /etc/machine-id)
[[ $id =~ ^[0-9a-f]{32}$ && $id != 00000000000000000000000000000000 ]] && return 0
id=$(dbus-uuidgen) || return 0
[[ $id =~ ^[0-9a-f]{32}$ ]] || return 0
printf '%s\n' "$id" > /etc/machine-id.droiddeck && mv -f /etc/machine-id.droiddeck /etc/machine-id
} 2>/dev/null
ensure_machine_id
write_system_bus_config() {
mkdir -p /run/dbus /usr/local/share/droiddeck
cat > /usr/local/share/droiddeck/system-bus.conf <<'BUSCONF'