[Pkg-xen-devel] Bug#988901: xen: installing xen-system-amd64 does not always properly update grub configuration

Maximilian Engelhardt maxi at daemonizer.de
Thu May 20 21:35:30 BST 2021


Source: xen
Severity: normal
Version: 4.14.1+11-gb0b734a8b3-1

I noticed that installing xen-system-amd64 does not always lead to a grub 
configuration that will boot into the xen hypervisor. As a quick fix 
"update-grub" can be run manually after installation of xen-system-amd64 to 
generate the proper grub configuration.

The issue leading to this is the following:

* xen-system-amd6 depends on xen-hypervisor-4.14-amd64, xen-hypervisor-common 
and xen-utils-4.14.

* xen-hypervisor-4.14-amd64 recommends xen-hypervisor-common and xen-
utils-4.14.

xen-hypervisor-common ships the conffile /etc/default/grub.d/xen.cfg which 
configures grub to boot into the xen hypervisor.

xen-hypervisor-4.14-amd64 has a postinst maintainer script which calls 
"update-grub".

The problem is that because xen-hypervisor-common is only a recommendation of 
xen-hypervisor-4.14-amd64 it may not be configured when the postinst script of 
xen-hypervisor-4.14-amd64 is run and within it update-grub is called.

When xen-hypervisor-common gets installed it first creates the file "/etc/
default/grub.d/xen.cfg.dpkg-new". Only after it gets configured the final file 
will be "/etc/default/grub.d/xen.cfg"

So when the update-grub command gets called the grub configuration file does 
not end in ".cfg" and this is ignored by update-grub.

I see the following possibilities to fix this:

* make xen-hypervisor-common a dependency of xen-hypervisor-4.14-amd64 which 
then should make sure xen-hypervisor-common is configures before the postinst 
script in xen-hypervisor-4.14-amd64 run. Of course this makes it no longer 
possible to install xen-hypervisor-4.14-amd64 without xen-hypervisor-common.

* Additionally run "update-grub" in the postinst maintainer script of xen-
hypervisor-common. This makes sens as the package ships a grub configuration 
file and if something changes there then update-grub should be called.
I also think that if xen-hypervisor-4.14-amd64 is already installed and xen-
hypervisor-common only gets installed later, update-grub currently is never 
run (I didn't verify this) and this change would also fix this.
The only downside I can see is that update-grub will be called twice if xen-
hypervisor-4.14-amd64 and xen-hypervisor-common get installed together.
Maybe this is not really an issue as update-grub usually should be quite fast.

I think the second option seems reasonable, but maybe someone else has a 
better idea how to fix this issue.

Thanks
Maxi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/pkg-xen-devel/attachments/20210520/ae9796ff/attachment.sig>


More information about the Pkg-xen-devel mailing list