Record GPU/TPU host changes in the change journal

Seven gpu_tpu scripts now write through the journal for host changes only — driver and package installs, vfio binding, modprobe.d, /etc/modules, GRUB and udev — while VM and LXC configuration stays out; add_gpu_vm and install_coral_lxc journal only their host writes. amd_gpu_tools records its install, and pmx_journal.sh gains pmx_record_uninstall while changes_journal.py retires an installed package when ProxMenux removes it. What each function writes is byte-identical to before, verified by tests/journal/verify_journal_migration.py.
This commit is contained in:
MacRimi
2026-09-11 21:08:35 +02:00
parent 9c930de186
commit 2a672889bf
10 changed files with 373 additions and 117 deletions
+7
View File
@@ -255,6 +255,13 @@ def ingest(limit: int = 5000) -> int:
try:
conn.execute("BEGIN IMMEDIATE")
for r in rows:
if r[3] == "uninstall_package":
# A removal retires the package's install entry; the current
# state is that it is no longer on the host.
conn.execute(
"DELETE FROM changes WHERE class = ? AND target = ?",
(CLASS_INSTALLATION, r[7]))
continue
if r[2] == CLASS_INSTALLATION:
# A package is one entry however often, or by whichever helper,
# it is installed.