Ports the update behaviour of the Fedora clients to Debian, and adds the
Debian equivalent of putting ks.cfg on the installation medium.
Updates
-------
Debian's shipped polkit policy only lets a sudo-group user trigger
upgrade-system and trigger-offline-update without a password. The actions
pkcon refresh and pkcon update actually use (system-sources-refresh and
system-update) are auth_admin, so a desktop user was prompted - a
behavioural difference from Fedora. update_local_repo.py now installs
/etc/polkit-1/rules.d/60-vdi-no-password-updates.rules granting exactly
those two plus package-install to group sudo. package-remove,
package-reinstall and package-install-untrusted stay auth_admin.
The offline update itself ports unchanged: Debian 13 PackageKit 1.3.1
supports offline-get-prepared and offline-trigger, and
packagekit-offline-update.service is wired into system-update.target.
Scheduling moves from an @reboot cron line to vdi-offline-update.timer
(6h, Persistent), with /root/auto_update.sh delegating to the same script
so there is one implementation instead of two.
Both are installed by update_local_repo.py, not only by the preseed, so
already-provisioned machines pick them up on their next 10-minute cron run.
install ISO
-----------
debian/make-iso.sh bakes preseed.cfg into a Debian netinst ISO and adds
auto=true priority=critical preseed/file=/cdrom/preseed.cfg to every boot
menu entry, then verifies its own output.
Measured, not assumed
---------------------
* subject.local == true never matches in this environment: pkcheck returns
2 with the clause and 0 without it, same sudo-group user. It was in the
first version of the rule and is removed; the reasoning is in the source.
* pkcon exits 5 for "no packages to update", which is the normal answer on
a patched box and was being logged as a download failure. Fixed.
* offline-get-prepared exits 4 when nothing is prepared, so the Fedora
"if ... offline-trigger" guard is load-bearing - triggering anyway can
leave a dangling /system-update symlink that breaks the next boot.
* Extracting a netinst and rebuilding with "xorriso -as mkisofs" grows it
792MB -> 988MB because Debian shares identical file extents; replaying
the original session with -map keeps dedup and the boot record.
* A hardcoded menu list misses isolinux/gtk.cfg, where the BIOS *default*
entry lives, so the machine still prompted. Menus are discovered now.
Tests: 90 passed, 0 failed, 2 skipped. T17 asserts the polkit decision in
both directions (authorised with the rule, prompted without it), because a
check that cannot fail proves nothing.
The provisioning path now runs on both package families. Fedora behaviour is
unchanged: the Fedora publishing code issues the same ten operations in the
same order as before, verified by recording the call sequence from both
implementations against a stubbed environment.
update_local_repo.py
Detects the family from /etc/os-release and dispatches to sync_fedora() or
sync_debian(). Release assets are filtered by extension, so neither family
sees the other's packages. The Debian path builds a flat apt-ftparchive
repository at the same /var/local/citrix-repo, publishes
local-citrix-repo.list, and runs apt-get update.
Fixes found while testing:
- tqdm is now an optional dependency. A stock Debian 13 image has no pip and
no tqdm, and dying at import would take down provisioning over a progress
bar.
- sync_debian prunes stale *.deb files before repopulating. The Fedora path
gets this for free by writing fixed filenames; Debian filenames carry the
version, so without pruning every old version stayed indexed and apt always
picked the highest, making rollback impossible.
- The apt source file is resolved next to the script rather than from the
working directory, with a hardcoded canonical fallback, so a foreign cwd or
a missing file cannot break the 10-minute cron job.
local-citrix-repo.list
The apt counterpart of local-citrix-repo.repo, which stays as-is for dnf.
Uses trusted=yes rather than a signature: the repository is generated on the
machine from packages this script downloaded itself, so a signature would only
prove the machine signed its own work, and it would add a gpg dependency that
Debian 13 does not ship by default. Index integrity is still enforced through
the hashes in Release.
debian/preseed.cfg
The debian-installer equivalent of ks.cfg. Same locale, keyboard, timezone,
passwords, inventory-derived hostname/user/password, disk auto-detection,
Firefox managed bookmarks, Citrix and TeamViewer installs, auto-update script,
cron jobs and disable-sleep unit. Every directive was checked against the
templates in the real trixie udebs. Documented gaps, all inherent to preseed
vs kickstart: uppercase usernames are rejected by user-setup and so are
created in late_command; d-i has no lsblk, openssl, chvt or openvt, so disk
detection reads /sys/block and the inventory prompt goes to /dev/console with
a kernel-cmdline override and a timeout; pip install tqdm becomes
python3-tqdm from apt because of PEP 668.
debian/test/
Harness covering the Debian path on a real Debian 13 machine: repo build,
sources.list validity, apt visibility after purging the list cache, install
resolution, idempotency, stale-package pruning, corrupt-index rejection, and
Fedora non-regression. 52 pass, 3 skip (each skip states why).
Known limitations are listed in README.md under "What the tests do NOT prove":
no real d-i install has been run, and the generated post-install script is
verified as well-formed rather than executed against a target root.