Improvements for Archlinux and Debian template updates

I am looking to the ways for small improvements to Archlinux and Debian template update progress.

Archlinux

Currently there is only one Qubes pacman hook. And it is for qubes-update-desktop-icons. There is no post-upgrade hook to run upgrades-status-notify or directly invoke qrexec client to reset updates-available feature of the template to 0. Depending on qubes-update-check service is not sufficient. The current situation confuses Qubes Update GUI and the user. Am I missing something here? Why there is not a post-upgrade hook? If this is not intentional, we should submit a patch to include the hook.

Debian

The progress bar of apt is messing the reports of Debian template updates (picture below). There is a proper -q option for apt-get -q update to suppress the progress bar while refreshing the repositories. There should be one for updates as well.

The GUI updater calls notify script after calling pacman (or other package manager) anyway: qubes-core-admin-linux/vmupdate/agent/entrypoint.py at main · QubesOS/qubes-core-admin-linux · GitHub

But a hook might be useful to reset the flag after manual updates too.

As for Debian output, makes sense.

2 Likes

Thank you very much for your time Marek.

One more issue that I am currently personally experiencing is shutdown timeout of templates after updates. Since I have so many templates and this is a relatively old 3rd gen Intel machine with slow SATA SSD rather than NVMe. My workaround was to increase shutdown-timeout property of some templates and manually doing upgrades in batches. This is necessary as shutdown is forced in Update GUI and I want templates to gracefully shutdown. Maybe Qubes Update GUI should restart/shutdown the updated templates in an async queue of VCPU count (or VCPU x 2). Just like how it does it by default for the concurrent template updates. Or maybe instead of this happening in Update GUI, qubesadmin.vm.shutdown would better queue the shutdown of VMs and limit concurrent shutdowns.

1 Like

Some minor small bugs could be time consuming to fix without having proper background knowledge. Archlinux was relatively easy. Post upgrade hook for pacman was submitted. Running upgrades-status-notify in the post upgrade hook was not possible. Since the upgrades-installed-check scripts uses checkupdates(8) which only resets update status after the post-upgrade hooks.

Debian bug on the other hand is relatively confusing. Qubes template update mechanism is relatively complex. Updater resides inside dom0 and uploads vmupdate payload to templates at /run/qubes-update. There are independent update agents written for apt, dnf and pacman to communicate with vmupdate core. But not for emerge (it seams). If anyone wants to write a compatibility layer for qubes-vm-update or updater GUI for something else (e.g. Alpine), it is where you should look into.

The compatibility layer for apt uses python-apt which is well documented. There are examples on how to setup config parameters. The problem is I can not find the exact config to disable the progress bar without silencing it completely. Others have similar issues. Apt and dpkg themselves are not well documented. If you spent time to read this post to this point, perhaps you may know the exact config to disable progress bar. I appreciate if you could share.

p.s.: apt config documentation is available at /usr/share/doc/apt/examples/configure-index.gz

OK. The annoying (Reading database ... ... ...) progress output while updating Debian based Distros is from dpkg which is called by apt-get. And it is well known ancient bug which has been discussed since 2009. Some people have submitted patches to allow suppression of the dpkg progress bar via a command line option. Regretfully dpkg maintainers rejected it. It is cluttering logs of CI jobs of everyone. The only option is to disable the entire dpkg output via Dpkg::Use-Pty=0 which is not documented in apt configuration document. But that is not wise since it suppresses dpkg entirely. So we should live with it :confused:

1 Like