]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
ts-host-install: Add need-kernel-deb host flag
authorIan Campbell <ian.campbell@citrix.com>
Wed, 4 Sep 2013 16:11:06 +0000 (17:11 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 4 Sep 2013 16:27:08 +0000 (17:27 +0100)
This can be used to request a specific kernel binary and initrd overlay (for
modules). These are already collected and created by
mg-debian-installer-update for the armhf "armmp" flavour.

ts-host-install

index b974365e01b033a6b8c61d43ce5456fdd5081b65..91519401eaa0c2928d8f43a48a3ac49ddad018e4 100755 (executable)
@@ -130,6 +130,8 @@ sub setup_pxeboot_firstboot($) {
     my $src_initrd= "$d_i/initrd.gz";
     my @initrds= "$c{TftpPath}/$src_initrd";
 
+    my $kernel;
+
     foreach my $fp (keys %{ $ho->{Flags} }) {
         $fp =~ s/^need-firmware-deb-// or next;
         my $cpio= "$c{TftpPath}/$d_i/$fp.cpio.gz";
@@ -143,6 +145,31 @@ sub setup_pxeboot_firstboot($) {
         }
     }
 
+    foreach my $kp (keys %{ $ho->{Flags} }) {
+        $kp =~ s/need-kernel-deb-// or next;
+        my $kern= "$c{TftpPath}/$d_i/linux.$kp";
+        if (stat $kern) {
+            logm("using kernel from: $kern");
+            $kernel = "/$d_i/linux.$kp";
+        } elsif ($! == &ENOENT) {
+            logm("warning: no kernel found for $kp at $kern");
+        } else {
+            die "$kp $kern $!";
+        }
+
+        my $cpio= "$c{TftpPath}/$d_i/$kp.cpio.gz";
+        if (stat $cpio) {
+            logm("using kernel modules from: $cpio");
+            push @initrds, $cpio;
+        } elsif ($! == &ENOENT) {
+            logm("warning: no kernel module cpio found for $kp at $cpio");
+        } else {
+            die "$kp $cpio $!";
+        }
+    }
+
+    $kernel = "/$d_i/linux" unless $kernel;
+
     my $initrd_overlay= "tmp/t.$ho->{Name}.initrd";
     system qw(rm -rf --),"$initrd_overlay.d";
     mkdir "$initrd_overlay.d" or die "$initrd_overlay.d: $!";
@@ -190,7 +217,7 @@ timeout 5
 label overwrite
        menu label ^Overwrite
        menu default
-       kernel /$d_i/linux
+       kernel $kernel
        append $installcmdline
 default overwrite
 END