]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Debian: Use dtbs from kernel dist when booting that kernel
authorIan Campbell <ian.campbell@citrix.com>
Thu, 1 Oct 2015 15:01:26 +0000 (16:01 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 Oct 2015 16:19:14 +0000 (17:19 +0100)
The kernel dist built by ts-kernel-build puts the corresponding dtbs
into /boot/dtbs/$kvers.

The host installer's dtbs remain in /boot/dtbs and are used when
booting the native kernel.

It's possible that this change will expose bugs which exist in the
DTBs in previous kernel branches (3.18 and 4.1). I've not
investigated, I think we should accept this possibility and deal with
it via backport requests (and maybe some force pushes if appropriate)
as necessary.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm

index d56e410a88a02de5487786170865807712518de4..6a23751d7b357d65b96b0700a193dd2c397781c8 100644 (file)
@@ -142,11 +142,22 @@ sub uboot_common_kernel_bootargs ($)
     return @bootargs;
 }
 
-sub uboot_scr_load_dtb () {
+# ts-host-install will install the OS-supplied dtbs directly into
+# /boot/dtbs without a subdirectory, while the kernel dist tarball
+# produced by ts-kernel-build will install the DTBS from that kernel
+# into /boot/dtbs/$version.
+#
+# Therefore the optional $kvers argument allows the selection of
+# either the OS-supplied DTBS (when undef) or those of a specific
+# kernel built by osstest.
+sub uboot_scr_load_dtb (;$) {
+    my ($kvers) = @_;
+    $kvers ||= '';
+    $kvers .= '/' if $kvers;
     return <<END;
 if test -z "\\\${fdt_addr}" && test -n "\\\${fdtfile}" ; then
-    echo Loading dtbs/\\\${fdtfile}
-    ext2load scsi 0 \\\${fdt_addr_r} dtbs/\\\${fdtfile}
+    echo Loading dtbs/$kvers\\\${fdtfile}
+    ext2load scsi 0 \\\${fdt_addr_r} dtbs/$kvers\\\${fdtfile}
     setenv fdt_addr \\\${fdt_addr_r}
 fi
 END
@@ -229,7 +240,7 @@ END
        my $early_commands = get_host_property($ho, 'UBootScriptEarlyCommands', '');
        my $xen_addr_r = get_host_property($ho, 'UBootSetXenAddrR', undef);
 
-       my $load_dtb = uboot_scr_load_dtb();
+       my $load_dtb = uboot_scr_load_dtb($want_kernver);
 
        my $set_xen_addr_r =
            $xen_addr_r ? "setenv xen_addr_r $xen_addr_r" : "";