]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
config: ExtraDebs: replace with DebianExtraPackages
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 11:24:39 +0000 (12:24 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 12 Jun 2018 11:25:55 +0000 (12:25 +0100)
`ExtraDebs' is a silly name.  Also the semantics are rather
inflexible; we might want to install specific packages rather than
the contents of a whole directory.

And, document it.

This variable has only just been introduced, so hopefully it is OK to
replace and rename it now without causing too much disruption.

(osstest's own production runs each use their own copy of the config,
so they will be fine.  It's just downstreams, or users whose config is
set up to use one not in their own tree, who will be affected.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
------------------------------

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
README
production-config
ts-xen-install

diff --git a/README b/README
index 7b7bc52a0582217eccdfd9c6c1fd42267874280e..2dfd4deb00368425bdac731189f2540fde7501e4 100644 (file)
--- a/README
+++ b/README
@@ -537,6 +537,15 @@ DebianNonfreeFirmware
   grep-dctrl (for example because it's not Debian) then you must set
   this to the empty string, by writing  DebianNonfreeFirmware=''
 
+DebianExtraPackages_<firmware>_<arch>_<suite> [<item>... ]
+  Extra packages, or directories of them, to install on every Debian
+  host (dom0).  Each variable is a space-separated list of items.
+  Each <item> is relative to Images unless it starts with `/' or `./'.
+  It should be one of the following:
+    <directory-name>/                        update packages, dpkg -iGROEB
+    [.../]<package>_<version>_<pkgarch>.deb  install package, dpkg -iB
+    [.../]<package>_<version>_.deb           install _<hostarch>.deb
+
 Tftp*
    Settings related to the tftp server:
 
index aa414d0555b12afa8b750de4a9058a527bc19502..d89e89a434ee63d7fc31bf81c6a96aeff6536f80 100644 (file)
@@ -106,10 +106,10 @@ MicrocodeUpdateI386 microcode.x86.2015-06-12.cpio
 # Update with ./mg-netgrub-loader-update
 TftpGrubVersion XXXX-XX-XX
 
-ExtraDebs_uefi_i386_jessie   2018-04-01
-ExtraDebs_uefi_amd64_jessie  2018-04-01
-ExtraDebs_uefi_i386_stretch  2018-04-01
-ExtraDebs_uefi_amd64_stretch 2018-04-01
+DebianExtraPackages_uefi_i386_jessie   extradebs-uefi-i386-2018-04-01/
+DebianExtraPackages_uefi_amd64_jessie  extradebs-uefi-amd64-2018-04-01/
+DebianExtraPackages_uefi_i386_stretch  extradebs-uefi-i386-2018-04-01/
+DebianExtraPackages_uefi_amd64_stretch extradebs-uefi-amd64-2018-04-01/
 
 XenUsePath /usr/groups/xencore/systems/bin/xenuse
 XenUseUser osstest
index 17f76629bc7930ef72483b43dcbd04519ee606ef..d3a9d115f0bc92e1d3f625980cd56e6ba1ef71e9 100755 (executable)
@@ -20,6 +20,7 @@ use DBI;
 BEGIN { unshift @INC, qw(.); }
 use Osstest;
 use File::Path;
+use File::Basename;
 use POSIX;
 use Osstest::Debian;
 use Osstest::TestSupport;
@@ -66,14 +67,47 @@ sub packages () {
         if toolstack($ho)->{ExtraPackages};
 }
 
+sub some_extradebs ($) {
+    my ($items) = @_;
+    my $cfgvar = join('_', @$items);
+    my $specs = $c{$cfgvar};
+    if (!length $specs) {
+       logm("$cfgvar: no extra debs");
+       return;
+    }
+    my $counter = 0;
+    my $rsync_installed;
+    foreach my $spec (split /\s+/, $specs) {
+       my $path = $spec;
+       $path = "$c{Images}/$path" unless $path =~ m{^/|^\./};
+       my ($ontarget, $dpkgopts);
+       if ($path =~ m{/$}) {
+           $ontarget = "extrapackages-$cfgvar-$counter"; $counter++;
+           $dpkgopts = '-iGROEB';
+           logm("$cfgvar: updating packages from directory $path");
+           target_install_packages($ho, 'rsync') unless $rsync_installed++;
+           target_putfile_root($ho,300, "$path/.", $ontarget, '-r');
+       } elsif ($path =~ m{\.deb$}) {
+           $path =~ s{_\.deb}{ "_$r{arch}.deb" }e;
+           logm("$cfgvar: installing $path");
+           $ontarget = basename($path);
+           $dpkgopts = '-iB';
+           target_putfile_root($ho,300, $path, $ontarget);
+       } else {
+           die "no / or . deb in $spec ?";
+       }
+       target_cmd_root($ho,
+                       "dpkg --force-confold $dpkgopts $ontarget </dev/null",
+                       300);
+    }
+}
+
 sub extradebs () {
+    my $suite = $ho->{Suite};
+
+    # $c{ DebianExtraPackages_<firmware>_<arch>_<suite> }
     my $firmware = get_host_property($ho, "firmware", "bios");
-    my $version = $c{ "ExtraDebs_${firmware}_$r{arch}_$ho->{Suite}" };
-    return unless $version;
-    target_install_packages($ho, 'rsync');
-    my $extradebs = "$c{Images}/extradebs-$firmware-$r{arch}-$version";
-    target_putfile_root($ho,300, "$extradebs/.", 'extradebs', '-r');
-    target_cmd_root($ho,"dpkg --force-confold -iGROEB extradebs </dev/null",300);
+    some_extradebs([ 'DebianExtraPackages', $firmware, $r{arch}, $suite ]);
 }
 
 sub extract () {