From a8df6e002f1652352013fbdeddb8069cc63e12ca Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Fri, 8 Feb 2019 17:37:11 +0100 Subject: [PATCH] distributions.conf now supports arbitrary keyring files Any tag ending in ".gpg" will be considered to be the according keyring file in /usr/share/keyrings/. This is at least needed for some Ubuntu releases which were eol'ed in the past few years, especially because Ubuntu split up their keyrings much more finegrained than just "archive" and "archive-removed-keys". --- NEWS.markdown | 2 ++ bin/xen-create-image | 6 +++++- debian/changelog | 2 ++ etc/distributions.conf | 5 +++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NEWS.markdown b/NEWS.markdown index c136eef..e316b55 100644 --- a/NEWS.markdown +++ b/NEWS.markdown @@ -9,6 +9,8 @@ New Features * Support for really random MAC addresses upon every xen-create-image invocation by using the new option `--randommac`. (by Pietro Stäheli, closes Debian bug report #855703) +* distributions.conf now supports arbitrary keyring files in + /usr/share/keyrings/. (Needed for some EoL Ubuntu releases.) Bug Fixes --------- diff --git a/bin/xen-create-image b/bin/xen-create-image index 395a3e7..c4190ef 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -1314,9 +1314,13 @@ sub setupDefaultOptions $CONFIG{ 'mirror_'.$debdist } = $MIRROR{$dist.'_archive'} or die $dist.'_archive not defined in /etc/xen-tools/mirrors.conf'; my $removed_keys = "/usr/share/keyrings/$dist-archive-removed-keys.gpg"; - if ($debdistinfo !~ /default-keyring/ and -s $removed_keys) { + if ($debdistinfo =~ /(\S*\.gpg)($|\s)/ and -s "/usr/share/keyrings/${1}") { + $CONFIG{ 'keyring_'.$debdist } = "/usr/share/keyrings/${1}"; + } elsif ($debdistinfo !~ /default-keyring/ and -s $removed_keys) { $CONFIG{ 'keyring_'.$debdist } = $removed_keys; } + } elsif ($debdistinfo =~ /(\S*\.gpg)($|\s)/ and -s "/usr/share/keyrings/${1}") { + $CONFIG{ 'keyring_'.$debdist } = "/usr/share/keyrings/${1}"; } else { $CONFIG{ 'mirror_'.$debdist } = $MIRROR{$dist} or die $dist.' not defined in /etc/xen-tools/mirrors.conf'; diff --git a/debian/changelog b/debian/changelog index 8dba93a..21ba006 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,8 @@ xen-tools (4.8-1) UNRELEASED; urgency=medium + Many improvements for the release-testing script. + Only run xen-toolstack helper script if both, xm and xl are present. Avoids warning about deprecated helper script. + + distributions.conf now supports arbitrary keyring files in + /usr/share/keyrings/. (Needed for some EoL Ubuntu releases.) [ Nico Boehr ] + Add support for LVM thin provisioning. diff --git a/etc/distributions.conf b/etc/distributions.conf index 1de0a8d..a6cb7a3 100644 --- a/etc/distributions.conf +++ b/etc/distributions.conf @@ -6,6 +6,7 @@ # # Known distributions: debian, ubuntu # Known keywords: eol, pygrub, default-keyring, dont-test +# Known generic keywords: *.gpg (uses the according /usr/share/keyrings/….gpg file) # sarge = debian eol etch = debian eol @@ -40,7 +41,7 @@ lucid = ubuntu eol pygrub maverick = ubuntu eol pygrub natty = ubuntu eol pygrub oneiric = ubuntu eol pygrub -precise = ubuntu pygrub +precise = ubuntu pygrub ubuntu-archive-removed-keys.gpg quantal = ubuntu eol pygrub raring = ubuntu eol pygrub saucy = ubuntu eol pygrub @@ -50,7 +51,7 @@ vivid = ubuntu eol pygrub wily = ubuntu eol pygrub xenial = ubuntu pygrub yakkety = ubuntu eol pygrub -zesty = ubuntu eol pygrub +zesty = ubuntu eol pygrub ubuntu-keyring-2012-archive.gpg artful = ubuntu pygrub bionic = ubuntu pygrub cosmic = ubuntu pygrub