Toggle diff (387 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index fa6f76e790..bb13280dc7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1996,8 +1996,6 @@ dist_patch_DATA = \
%D%/packages/patches/twinkle-bcg729.patch \
%D%/packages/patches/u-boot-allow-disabling-openssl.patch \
%D%/packages/patches/u-boot-fix-build-python-3.10.patch \
- %D%/packages/patches/u-boot-infodocs-target.patch \
- %D%/packages/patches/u-boot-patman-guix-integration.patch \
%D%/packages/patches/u-boot-nintendo-nes-serial.patch \
%D%/packages/patches/u-boot-rockchip-inno-usb.patch \
%D%/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 01fd1093ff..8be5303a74 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -648,23 +648,21 @@ (define %u-boot-rk3399-enable-emmc-phy-patch
(define u-boot
(package
(name "u-boot")
- (version "2022.10")
+ (version "2023.07-rc6")
(source (origin
(patches
(list %u-boot-rockchip-inno-usb-patch
%u-boot-allow-disabling-openssl-patch
%u-boot-sifive-prevent-relocating-initrd-fdt
%u-boot-rk3399-enable-emmc-phy-patch
- (search-patch "u-boot-fix-build-python-3.10.patch")
- (search-patch "u-boot-infodocs-target.patch")
- (search-patch "u-boot-patman-guix-integration.patch")))
+ (search-patch "u-boot-fix-build-python-3.10.patch")))
(method url-fetch)
(uri (string-append
"https://ftp.denx.de/pub/u-boot/"
"u-boot-" version ".tar.bz2"))
(sha256
(base32
- "1y5x8vxdgsqdqlsvq01mn8lmw53fqairkhvhhjx83hjva0m4id2h"))))
+ "1dgvr228imbhzq7vzr8iialijl3k4mhjdirjrm6hsy6qbm6jyj5r"))))
(build-system gnu-build-system)
(native-inputs
(list bison
@@ -676,6 +674,7 @@ (define u-boot
perl
pkg-config ;for 'make menuconfig'
python
+ python-pyelftools
swig
(list util-linux "lib")))
(home-page "https://www.denx.de/wiki/U-Boot/")
@@ -726,7 +725,12 @@ (define-public u-boot-tools
(name "u-boot-tools")
(native-inputs
(modify-inputs (package-native-inputs u-boot)
- (prepend python-coverage python-pycryptodomex python-pytest sdl2)))
+ (prepend python-coverage
+ python-filelock
+ python-pycryptodomex
+ python-pytest
+ python-pytest-xdist
+ sdl2)))
(arguments
`(#:make-flags '("HOSTCC=gcc")
#:test-target "tcheck"
@@ -739,7 +743,7 @@ (define-public u-boot-tools
(("/bin/false") (which "false")))
(substitute* "tools/dtoc/fdt_util.py"
(("'cc'") "'gcc'"))
- (substitute* "tools/patman/test_util.py"
+ (substitute* "tools/u_boot_pylib/test_util.py"
;; python3-coverage is simply called coverage in guix.
(("python3-coverage") "coverage")
@@ -777,7 +781,15 @@ (define-public u-boot-tools
;; See https://bugs.gnu.org/34717 for
;; details.
(("CONFIG_FIT_SIGNATURE=y")
- "CONFIG_FIT_SIGNATURE=n\nCONFIG_UT_LIB_ASN1=n\nCONFIG_TOOLS_LIBCRYPTO=n")
+ "CONFIG_FIT_SIGNATURE=n
+CONFIG_UT_LIB_ASN1=n
+CONFIG_TOOLS_LIBCRYPTO=n")
+ ;; Catch instances of implied CONFIG_FIG_SIGNATURE with VPL targets
+ (("CONFIG_SANDBOX_VPL=y")
+ "CONFIG_SANDBOX_VPL=y
+CONFIG_FIT_SIGNATURE=n
+CONFIG_VPL_FIT_SIGNATURE=n
+CONFIG_TOOLS_LIBCRYPTO=n")
;; This test requires a sound system, which is un-used
;; in u-boot-tools.
(("CONFIG_SOUND=y") "CONFIG_SOUND=n")))
@@ -1009,6 +1021,8 @@ (define*-public (make-u-boot-sunxi64-package board triplet
#~(modify-phases #$phases
(add-after 'unpack 'set-environment
(lambda* (#:key native-inputs inputs #:allow-other-keys)
+ ;; Avoid dependency on crust-firmware https://issues.guix.gnu.org/48371
+ (setenv "SCP" "/dev/null")
(setenv "BL31" (search-input-file inputs "bl31.bin"))))))))
(inputs
(modify-inputs (package-inputs base)
@@ -1104,7 +1118,7 @@ (define-public u-boot-puma-rk3399
(delete 'strip)
(delete 'validate-runpath)))))
(inputs
- (modify-inputs (package-native-inputs base)
+ (modify-inputs (package-inputs base)
(append arm-trusted-firmware-rk3399))))))
(define-public u-boot-qemu-arm
@@ -1170,7 +1184,20 @@ (define-public u-boot-sandbox
(append sdl2))))))
(define-public u-boot-sifive-unleashed
- (make-u-boot-package "sifive_unleashed" "riscv64-linux-gnu"))
+ (let ((base (make-u-boot-package "sifive_unleashed" "riscv64-linux-gnu")))
+ (package
+ (inherit base)
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (add-after 'unpack 'set-environment
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "OPENSBI" (search-input-file inputs
+ "fw_dynamic.bin"))))))))
+ (inputs
+ (modify-inputs (package-inputs base)
+ (append opensbi-generic))))))
(define-public u-boot-sifive-unmatched
(let ((base (make-u-boot-package "sifive_unmatched" "riscv64-linux-gnu")))
@@ -1230,7 +1257,8 @@ (define-public u-boot-rockpro64-rk3399
"CONFIG_SATA_SIL=y"
"CONFIG_SCSI=y"
"CONFIG_SCSI_AHCI=y"
- "CONFIG_DM_SCSI=y"))))
+ "CONFIG_DM_SCSI=y"
+ "# CONFIG_SPL_FIT_SIGNATURE is not set"))))
(package
(inherit base)
(arguments
@@ -1240,6 +1268,13 @@ (define-public u-boot-rockpro64-rk3399
(add-after 'unpack 'set-environment
(lambda* (#:key inputs #:allow-other-keys)
(setenv "BL31" (search-input-file inputs "/bl31.elf"))))
+ ;; Disable SPL FIT signatures, due to GPLv2 and Openssl license
+ ;; incompatibilities
+ (add-after 'unpack 'disable-spl-fit-signature
+ (lambda _
+ (substitute* "configs/rockpro64-rk3399_defconfig"
+ (("CONFIG_SPL_FIT_SIGNATURE=y")
+ "# CONFIG_SPL_FIT_SIGNATURE is not set"))))
(add-after 'unpack 'patch-header
(lambda _
(substitute* "include/config_distro_bootcmd.h"
diff --git a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
index 5f2856dbb4..5195a7a6f8 100644
--- a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
+++ b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
@@ -128,29 +128,28 @@ index 94b7685392..eec599b0ee 100644
datai = 0;
for (cfgi = 0; cfgi < cfgn; cfgi++) {
e = &image_cfg[cfgi];
-@@ -1552,9 +1568,11 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
+@@ -1624,10 +1640,12 @@ static void *image_create_v1(size_t *dataoff, struct image_tool_params *params,
&datai, delay);
}
+#if defined(CONFIG_KWB_SECURE)
- if (secure_hdr && add_secure_header_v1(params, ptr, payloadsz + headersz,
- headersz, image, secure_hdr))
+ if (secure_hdr && add_secure_header_v1(params, ptr + *dataoff, payloadsz,
+ image, headersz, secure_hdr))
return NULL;
+#endif
- *imagesz = headersz;
+ /* Calculate and set the header checksum */
+ main_hdr->checksum = image_checksum8(main_hdr, headersz);
--- a/tools/image-host.c
+++ b/tools/image-host.c
-@@ -14,10 +14,12 @@
+@@ -14,8 +14,10 @@
#include <image.h>
#include <version.h>
+#ifdef CONFIG_FIT_PRELOAD
#include <openssl/pem.h>
#include <openssl/evp.h>
-
- #define IMAGE_PRE_LOAD_PATH "/image/pre-load/sig"
+#endif
/**
diff --git a/gnu/packages/patches/u-boot-infodocs-target.patch b/gnu/packages/patches/u-boot-infodocs-target.patch
deleted file mode 100644
index 5b21a99de3..0000000000
--- a/gnu/packages/patches/u-boot-infodocs-target.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-Upstream status: https://patchwork.ozlabs.org/project/uboot/list/?series=333259
-
-diff --git a/Makefile b/Makefile
-index de5746399a..597a8886c3 100644
---- a/Makefile
-+++ b/Makefile
-@@ -2372,7 +2372,7 @@ tcheck:
- # Documentation targets
- # ---------------------------------------------------------------------------
- DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
-- linkcheckdocs dochelp refcheckdocs
-+ linkcheckdocs dochelp refcheckdocs texinfodocs infodocs
- PHONY += $(DOC_TARGETS)
- $(DOC_TARGETS): scripts_basic FORCE
- $(Q)$(MAKE) $(build)=doc $@
-diff --git a/doc/Makefile b/doc/Makefile
-index f5de65e927..d0904a9f99 100644
---- a/doc/Makefile
-+++ b/doc/Makefile
-@@ -69,6 +69,14 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
- htmldocs:
- @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
-
-+texinfodocs:
-+ @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))
-+
-+# Note: the 'info' Make target is generated by sphinx itself when
-+# running the texinfodocs target defined above.
-+infodocs: texinfodocs
-+ $(MAKE) -C $(BUILDDIR)/texinfo info
-+
- linkcheckdocs:
- @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
-
-@@ -109,6 +117,8 @@ cleandocs:
- dochelp:
- @echo ' U-Boot documentation in different formats from ReST:'
- @echo ' htmldocs - HTML'
-+ @echo ' texinfodocs - Texinfo'
-+ @echo ' infodocs - Info'
- @echo ' latexdocs - LaTeX'
- @echo ' pdfdocs - PDF'
- @echo ' epubdocs - EPUB'
-diff --git a/doc/conf.py b/doc/conf.py
-index 62c8d31270..3db70f80c1 100644
---- a/doc/conf.py
-+++ b/doc/conf.py
-@@ -449,7 +449,7 @@ for fn in os.listdir('.'):
- # One entry per manual page. List of tuples
- # (source start file, name, description, authors, manual section).
- man_pages = [
-- (master_doc, 'dasuboot', 'The U-Boot Documentation',
-+ (master_doc, 'u-boot', 'The U-Boot Documentation',
- [author], 1)
- ]
-
-@@ -463,8 +463,8 @@ man_pages = [
- # (source start file, target name, title, author,
- # dir menu entry, description, category)
- texinfo_documents = [
-- (master_doc, 'DasUBoot', 'The U-Boot Documentation',
-- author, 'DasUBoot', 'One line description of project.',
-+ (master_doc, 'u-boot', 'The U-Boot Documentation',
-+ author, 'U-Boot', 'Boot loader for embedded systems',
- 'Miscellaneous'),
- ]
-
-diff --git a/doc/media/Makefile b/doc/media/Makefile
-index b9b43a34c3..9b32258696 100644
---- a/doc/media/Makefile
-+++ b/doc/media/Makefile
-@@ -22,10 +22,11 @@ $(BUILDDIR)/linker_lists.h.rst: ${API}/linker_lists.h ${PARSER} $(SRC_DIR)/linke
-
- # Media build rules
-
--.PHONY: all html epub xml latex
-+.PHONY: all html texinfo epub xml latex
-
- all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
- html: all
-+texinfo: all
- epub: all
- xml: all
- latex: $(IMGPDF) all
diff --git a/gnu/packages/patches/u-boot-patman-guix-integration.patch b/gnu/packages/patches/u-boot-patman-guix-integration.patch
deleted file mode 100644
index 3472656c99..0000000000
--- a/gnu/packages/patches/u-boot-patman-guix-integration.patch
+++ /dev/null
@@ -1,1244 +0,0 @@
-These changes correspond to commits 9ff7500ace..3154de3dd6 already merged to
-the u-boot-dm custodian repo (at
-https://source.denx.de/u-boot/custodians/u-boot-dm/-/commits/next), scheduled
-to be pulled after the next release.
-
-diff --git a/tools/patman/__init__.py b/tools/patman/__init__.py
-index c9d3e35052..1b98ec7fee 100644
---- a/tools/patman/__init__.py
-+++ b/tools/patman/__init__.py
-@@ -1,6 +1,6 @@
- # SPDX-License-Identifier: GPL-2.0+
-
- __all__ = ['checkpatch', 'command', 'commit', 'control', 'cros_subprocess',
-- 'func_test', 'get_maintainer', 'gitutil', 'main', 'patchstream',
-+ 'func_test', 'get_maintainer', 'gitutil', '__main__', 'patchstream',
- 'project', 'series', 'setup', 'settings', 'terminal',
- 'test_checkpatch', 'test_util', 'tools', 'tout']
-diff --git a/tools/patman/main.py b/tools/patman/__main__.py
-similarity index 89%
-rename from tools/patman/main.py
-rename to tools/patman/__main__.py
-index 8067a288ab..749e6348b6 100755
---- a/tools/patman/main.py
-+++ b/tools/patman/__main__.py
-@@ -7,6 +7,7 @@
- """See README for more information"""
-
- from argparse import ArgumentParser
-+import importlib.resources
- import os
- import re
- import sys
-@@ -19,6 +20,7 @@ if __name__ == "__main__":
-
- # Our modules
- from patman import control
-+from patman import func_test
- from patman import gitutil
- from patman import project
- from patman import settings
-@@ -53,7 +55,8 @@ parser.add_argument('-H', '--full-help', action='store_true', dest='full_help',
- default=False, help='Display the README file')
-
- subparsers = parser.add_subparsers(dest='cmd')
--send = subparsers.add_parser('send')
-+send = subparsers.add_parser(
-+ 'send', help='Format, check and email patches (default command)')
- send.add_argument('-i', '--ignore-errors', action='store_true',
- dest='ignore_errors', default=False,
- help='Send patches email even if patch errors are found')
-@@ -62,6 +65,12 @@ send.add_argument('-l', '--limit-cc', dest='limit', type=int, default=None,
- send.add_argument('-m', '--no-maintainers', action='store_false',
- dest='add_maintainers', default=True,
- help="Don't cc the file maintainers automatically")
-+send.add_argument(
-+ '--get-maintainer-script', dest='get_maintainer_script', type=str,
-+ action='store',
-+ default=os.path.join(gitutil.get_top_level(), 'scripts',
-+ 'get_maintainer.pl') + ' --norolestats',
-+ help='File name of the get_maintainer.pl (or compatible) script.')
- send.add_argument('-n', '--dry-run', action='store_true', dest='dry_run',
- default=False, help="Do a dry run (create but don't email patches)")
- send.add_argument('-r', '--in-reply-to', type=str, action='store',
-@@ -94,9 +103,11 @@ send.add_argument('--smtp-server', type=str,
-
- send.add_argument('patchfiles', nargs='*')
-
--test_parser = subparsers.add_parser('test', help='Run tests')
--test_parser.add_argument('testname', type=str, default=None, nargs='?',
-- help="Specify the test to run")
-+# Only add the 'test' action if the test data files are available.
-+if os.path.exists(func_test.TEST_DATA_DIR):
-+ test_parser = subparsers.add_parser('test', help='Run tests')
-+ test_parser.add_argument('testname', type=str, default=None, nargs='?',
-+ help="Specify the test to run")
-
- status = subparsers.add_parser('status',
- help='Check status of patches in patchwork')
-@@ -113,7 +124,7 @@ status.add_argument('-f', '--force', action='store_true',
- argv = sys.argv[1:]
- args, rest = parser.parse_known_args(argv)
- if hasattr(args, 'project'):
-- settings.Setup(gitutil, parser, args.project, '')
-+ settings.Setup(parser, args.project)
- args, rest = parser.parse_known_args(argv)
-
- # If we have a command, it is safe to parse all arguments
-@@ -160,11 +171,8 @@ elif args.cmd == 'send':
- fd.close()
-
- elif args.full_help:
-- tools.print_full_help(
-- os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
-- 'README.rst')
-- )