]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Debian: Honour need-kernel-deb- flag in the installed system too
authorIan Campbell <ian.campbell@citrix.com>
Wed, 4 Sep 2013 16:29:56 +0000 (17:29 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 4 Sep 2013 16:32:37 +0000 (17:32 +0100)
Osstest/Debian.pm

index e58a7cc0a348a4d84a6ad04d24bd1e284f60044c..92d97a9ccea9c1d720bbbc2412a15d6cdd62df45 100644 (file)
@@ -21,6 +21,7 @@ use strict;
 use warnings;
 
 use IO::File;
+use File::Copy;
 
 use Osstest;
 use Osstest::TestSupport;
@@ -440,6 +441,35 @@ $overlays
 echo latecmd done.
 END
 
+    foreach my $kp (keys %{ $ho->{Flags} }) {
+       $kp =~ s/need-kernel-deb-// or next;
+
+       my $d_i= $c{TftpPath}.'/'.$c{TftpDiBase}.'/'.$r{arch}.'/'.$c{TftpDiVersion};
+
+       my $kurl = create_webfile($ho, "kernel", sub {
+           copy("$d_i/$kp.deb", $_[0]);
+        });
+
+       my $iurl = create_webfile($ho, "initramfs-tools", sub {
+           copy("$d_i/initramfs-tools.deb", $_[0]);
+        });
+
+       preseed_hook_command($ho, 'late_command', $sfx, <<END);
+#!/bin/sh
+set -ex
+
+r=/target
+
+wget -O \$r/tmp/kern.deb $kurl
+wget -O \$r/tmp/initramfs-tools.deb $iurl
+
+# This will fail due to dependencies...
+in-target dpkg -i /tmp/kern.deb /tmp/initramfs-tools.deb || true
+# ... Now fix everything up...
+in-target apt-get install -f -y
+END
+    }
+
     my $preseed_file= (<<END);
 d-i mirror/suite string $suite