From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 06/10] ts-host-install: Add need-kernel-deb host flag Date: Wed, 4 Sep 2013 17:58:19 +0100 Message-ID: <1378313903-10539-6-git-send-email-ian.campbell@citrix.com> References: <1378313870.17510.172.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1378313870.17510.172.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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