gnu: u-boot: Update to 2019.04.

* gnu/packages/bootloaders.scm (u-boot): Update to 2019.04.
[source]: Add patch.
(u-boot-novena): Update dynamic patch to handle config key rename.
(u-boot-am335x-evm): New variable.
(u-boot-am335x-boneblack): Build with modified am335x-evm config.
(u-boot-novena): Fix typo in description.
* gnu/bootloader/u-boot.scm (u-boot-beaglebone-black-bootloader): Use
u-boot-am335x-boneblack.
* gnu/packages/patches/u-boot-fix-mkimage-header-verification.patch: New file.
* gnu/local.mk (dist_patch_DATA): Update accordingly.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Vagrant Cascadian 2019-04-15 21:46:57 -07:00 committed by Danny Milosavljevic
parent da56f10971
commit 6b99afeef8
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5
4 changed files with 92 additions and 7 deletions

View file

@ -106,7 +106,7 @@ (define u-boot-bootloader
(define u-boot-beaglebone-black-bootloader
(bootloader
(inherit u-boot-bootloader)
(package u-boot-beagle-bone-black)
(package u-boot-am335x-boneblack)
(installer install-beaglebone-black-u-boot)))
(define u-boot-allwinner-bootloader

View file

@ -1309,6 +1309,7 @@ dist_patch_DATA = \
%D%/packages/patches/totem-meson-easy-codec.patch \
%D%/packages/patches/tuxpaint-stamps-path.patch \
%D%/packages/patches/twinkle-include-qregexpvalidator.patch \
%D%/packages/patches/u-boot-fix-mkimage-header-verification.patch \
%D%/packages/patches/unzip-CVE-2014-8139.patch \
%D%/packages/patches/unzip-CVE-2014-8140.patch \
%D%/packages/patches/unzip-CVE-2014-8141.patch \

View file

@ -379,7 +379,7 @@ (define-public dtc
(define u-boot
(package
(name "u-boot")
(version "2019.01")
(version "2019.04")
(source (origin
(method url-fetch)
(uri (string-append
@ -387,7 +387,10 @@ (define u-boot
"u-boot-" version ".tar.bz2"))
(sha256
(base32
"08hwsmh5xsb1gcxsv8gvx00bai938dm5y3889n8jif3a8rd7xgah"))))
"1vwv4bgbl7fjcm073zrphn17hnz5h5h778f88ivdsgbb2lnpgdvn"))
(patches
(search-patches
"u-boot-fix-mkimage-header-verification.patch"))))
(native-inputs
`(("bc" ,bc)
("bison" ,bison)
@ -578,8 +581,32 @@ (define-public u-boot-vexpress
(define-public u-boot-malta
(make-u-boot-package "malta" "mips64el-linux-gnuabi64"))
(define-public u-boot-beagle-bone-black
(make-u-boot-package "am335x_boneblack" "arm-linux-gnueabihf"))
(define-public u-boot-am335x-boneblack
(let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf")))
(package
(inherit base)
(name "u-boot-am335x-boneblack")
(description "U-Boot is a bootloader used mostly for ARM boards. It
also initializes the boards (RAM etc).
This U-Boot is built for the BeagleBone Black, which was removed upstream,
adjusted from the am335x_evm build with several device trees removed so that
it fits within common partitioning schemes.")
(arguments
(substitute-keyword-arguments (package-arguments base)
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'patch-defconfig
;; Patch out other devicetrees to build image small enough to
;; fit within typical partitioning schemes where the first
;; partition begins at sector 2048.
(lambda _
(substitute* "configs/am335x_evm_defconfig"
(("CONFIG_OF_LIST=.*$") "CONFIG_OF_LIST=\"am335x-evm am335x-boneblack\"\n"))
#t)))))))))
(define-public u-boot-am335x-evm
(make-u-boot-package "am335x_evm" "arm-linux-gnueabihf"))
(define-public (make-u-boot-sunxi64-package board triplet)
(let ((base (make-u-boot-package board triplet)))
@ -638,7 +665,7 @@ (define-public u-boot-novena
also initializes the boards (RAM etc).
This U-Boot is built for Novena. Be advised that this version, contrary
to Novena upstream, does not load u-boot.img from the first patition.")
to Novena upstream, does not load u-boot.img from the first partition.")
(arguments
(substitute-keyword-arguments (package-arguments base)
((#:phases phases)
@ -648,7 +675,7 @@ (define-public u-boot-novena
;; allowing it to be installed at a device offset.
(lambda _
(substitute* "configs/novena_defconfig"
(("CONFIG_SPL_FAT_SUPPORT=y") "# CONFIG_SPL_FAT_SUPPORT is not set"))
(("CONFIG_SPL_FS_FAT=y") "# CONFIG_SPL_FS_FAT is not set"))
#t)))))))))
(define-public u-boot-cubieboard

View file

@ -0,0 +1,57 @@
From 48b52117235928cfd7ef1ec5c3f2cff5d7b03862 Mon Sep 17 00:00:00 2001
From: Jordan Hand <jordanhand22@gmail.com>
Date: Wed, 10 Apr 2019 09:46:32 -0700
Subject: [PATCH,v2] fdt: Fix mkimage list to try every header type
Origin: https://patchwork.ozlabs.org/patch/1083495/
Image type is not supplied to `mkimage -l`. For this reason, we cannot
use imagetool_verify_print_header_by_type. Instead, this patch uses
imagetool_verify_print_header to look through all header types to find
one where image validation succeeds.
This patch fixes failures in test/image/test-imagetools.sh
Signed-off-by: Jordan Hand <jorhand@microsoft.com>
Tested-by: Alex Kiernan <alex.kiernan@gmail.com>
Tested-by: Vagrant Cascadian <vagrant@debian.org>
---
tools/mkimage.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 2899adff81..76c3406d37 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -403,14 +403,21 @@ int main(int argc, char **argv)
exit (EXIT_FAILURE);
}
- /*
- * scan through mkimage registry for all supported image types
- * and verify the input image file header for match
- * Print the image information for matched image type
- * Returns the error code if not matched
- */
- retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
- tparams, &params);
+ if (params.fflag) {
+ /*
+ * Verifies the header format based on the expected header for
+ * image type in tparams
+ */
+ retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
+ tparams, &params);
+ } else {
+ /**
+ * When listing the image, we are not given the image type. Simply check all
+ * image types to find one that matches our header
+ */
+ retval = imagetool_verify_print_header(ptr, &sbuf,
+ tparams, &params);
+ }
(void) munmap((void *)ptr, sbuf.st_size);
(void) close (ifd);
--
2.20.1