[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 06/10] ts-host-install: Add need-kernel-deb host flag



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 |   29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/ts-host-install b/ts-host-install
index b974365..9151940 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -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
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.