diff mbox

[Xen-devel,RFC,OSSTEST,13/19] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs

Message ID 1412942554-752-13-git-send-email-ian.campbell@citrix.com
State New
Headers show

Commit Message

Ian Campbell Oct. 10, 2014, 12:02 p.m. UTC
This is done unconditionally for every platform which has a
need-kernel-deb-* flag, which is currently all ARM platforms. Since
mg-debian-installer-update produces the necessary inputs for the only such
kernel (armmp) this seems tolerable for now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Osstest/Debian.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Ian Jackson Oct. 10, 2014, 2:45 p.m. UTC | #1
Ian Campbell writes ("[PATCH RFC OSSTEST 13/19] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs"):
> This is done unconditionally for every platform which has a
> need-kernel-deb-* flag, which is currently all ARM platforms. Since
> mg-debian-installer-update produces the necessary inputs for the only such
> kernel (armmp) this seems tolerable for now.

Surely it would be better to check whether the source file exists and
use it iff it does ?

Ian.
Ian Campbell Oct. 10, 2014, 2:49 p.m. UTC | #2
On Fri, 2014-10-10 at 15:45 +0100, Ian Jackson wrote:
> Ian Campbell writes ("[PATCH RFC OSSTEST 13/19] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs"):
> > This is done unconditionally for every platform which has a
> > need-kernel-deb-* flag, which is currently all ARM platforms. Since
> > mg-debian-installer-update produces the necessary inputs for the only such
> > kernel (armmp) this seems tolerable for now.
> 
> Surely it would be better to check whether the source file exists and
> use it iff it does ?

I think I was just being lazy trying to reuse the existing hook script
etc.

I could throw the script text into a variable and include it that way
though.
Ian Jackson Oct. 10, 2014, 3:10 p.m. UTC | #3
Ian Campbell writes ("Re: [PATCH RFC OSSTEST 13/19] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs"):
> On Fri, 2014-10-10 at 15:45 +0100, Ian Jackson wrote:
> > Surely it would be better to check whether the source file exists and
> > use it iff it does ?
> 
> I think I was just being lazy trying to reuse the existing hook script
> etc.

Uh ?  You could reuse the existing hook script but just put the call
to add the hook inside a conditional.

Ian.
Ian Campbell Oct. 10, 2014, 3:14 p.m. UTC | #4
On Fri, 2014-10-10 at 16:10 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH RFC OSSTEST 13/19] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs"):
> > On Fri, 2014-10-10 at 15:45 +0100, Ian Jackson wrote:
> > > Surely it would be better to check whether the source file exists and
> > > use it iff it does ?
> > 
> > I think I was just being lazy trying to reuse the existing hook script
> > etc.
> 
> Uh ?  You could reuse the existing hook script but just put the call
> to add the hook inside a conditional.

I meant reuse existing <<here doc with a script in it, rather than
introduce a second call to the helper etc. As I say, lazy ;-)

Ian.
Ian Jackson Oct. 10, 2014, 4:03 p.m. UTC | #5
Ian Campbell writes ("Re: [PATCH RFC OSSTEST 13/19] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs"):
> On Fri, 2014-10-10 at 16:10 +0100, Ian Jackson wrote:
> > Uh ?  You could reuse the existing hook script but just put the call
> > to add the hook inside a conditional.
> 
> I meant reuse existing <<here doc with a script in it, rather than
> introduce a second call to the helper etc. As I say, lazy ;-)

OIC.  The whole point about this helper is that you can call it
multiple times...

Ian.
diff mbox

Patch

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 3ffbc50..9171c72 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -643,6 +643,11 @@  END
 		or die "Copy initramfs-tools failed: $!";
         });
 
+	my $durl = create_webfile($ho, "dtbs", sub {
+	    copy("$d_i/dtbs.tar.gz", $_[0])
+		or die "Copy dtbs failed: $!";
+	});
+
 	preseed_hook_command($ho, 'late_command', $sfx, <<END);
 #!/bin/sh
 set -ex
@@ -651,6 +656,9 @@  r=/target
 
 wget -O \$r/tmp/kern.deb $kurl
 wget -O \$r/tmp/initramfs-tools.deb $iurl
+wget -O \$r/tmp/dtbs.tar.gz $durl
+
+in-target tar -C /boot -xaf /tmp/dtbs.tar.gz
 
 # This will fail due to dependencies...
 in-target dpkg -i /tmp/kern.deb /tmp/initramfs-tools.deb || true