tools: mkimage: Update U-Boot to version 2021.01
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 6 Jan 2021 18:36:44 +0000 (19:36 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 8 Feb 2021 21:46:27 +0000 (22:46 +0100)
* The fit image is now created with 0666 permission in upstream U-Boot
  remove our patch switch creates it with 0744
* The generated/autoconf.h file is created now as an empty file, it is
  not needed to remove this include any more.
* Upstream lib/rsa/rsa-sign.c now includes stdlib.h instead of malloc.h
* ALIGN_MASK was moved to imagetool.h, own patch should not be needed
  any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
tools/mkimage/Makefile
tools/mkimage/patches/020-fix-file-creation-perms.patch [deleted file]
tools/mkimage/patches/030-allow-to-use-different-magic.patch
tools/mkimage/patches/050-Add-compatibility-with-non-Linux-hosts.patch
tools/mkimage/patches/070-remove_generated_autoconf.patch [deleted file]
tools/mkimage/patches/210-link-libcrypto-static.patch

index 90ecdaaa6e5708df632eeae5bca487ef7c001963..6901d921cfc63286705b9b5006d1bc9537c64b75 100644 (file)
@@ -7,14 +7,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mkimage
-PKG_VERSION:=2020.04
+PKG_VERSION:=2021.01
 
 PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
        https://mirror.cyberbits.eu/u-boot \
        https://ftp.denx.de/pub/u-boot \
        ftp://ftp.denx.de/pub/u-boot
-PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
+PKG_HASH:=b407e1510a74e863b8b5cb42a24625344f0e0c2fc7582d8c866bd899367d0454
 
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
 
@@ -24,6 +24,8 @@ define Host/Prepare
        $(Host/Prepare/Default)
        mkdir -p $(HOST_BUILD_DIR)/include/config
        touch $(HOST_BUILD_DIR)/include/config/auto.conf
+       mkdir -p $(HOST_BUILD_DIR)/include/generated/
+       touch $(HOST_BUILD_DIR)/include/generated/autoconf.h
 endef
 
 define Host/Compile
diff --git a/tools/mkimage/patches/020-fix-file-creation-perms.patch b/tools/mkimage/patches/020-fix-file-creation-perms.patch
deleted file mode 100644 (file)
index 80cda28..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/tools/fit_image.c
-+++ b/tools/fit_image.c
-@@ -642,7 +642,7 @@ static int copyfile(const char *src, con
-               goto out;
-       }
--      fd_dst = open(dst, O_WRONLY | O_CREAT, 0700);
-+      fd_dst = open(dst, O_WRONLY | O_CREAT, 0744);
-       if (fd_dst < 0) {
-               printf("Can't open file %s (%s)\n", dst, strerror(errno));
-               goto out;
index 8d79de29921a7246e3b29faed727053bd40d4569..3a1677d54ddbc86c0d1833c5786a4f789aff94fe 100644 (file)
@@ -2,7 +2,7 @@ This patch makes it possible to set a custom image magic.
 
 --- a/tools/mkimage.c
 +++ b/tools/mkimage.c
-@@ -20,6 +20,7 @@ static struct image_tool_params params =
+@@ -21,6 +21,7 @@ static struct image_tool_params params =
        .arch = IH_ARCH_PPC,
        .type = IH_TYPE_KERNEL,
        .comp = IH_COMP_GZIP,
@@ -10,7 +10,7 @@ This patch makes it possible to set a custom image magic.
        .dtc = MKIMAGE_DEFAULT_DTC_OPTIONS,
        .imagename = "",
        .imagename2 = "",
-@@ -76,11 +77,12 @@ static void usage(const char *msg)
+@@ -82,11 +83,12 @@ static void usage(const char *msg)
                         "          -l ==> list image header information\n",
                params.cmdname);
        fprintf(stderr,
@@ -24,16 +24,16 @@ This patch makes it possible to set a custom image magic.
                "          -a ==> set load address to 'addr' (hex)\n"
                "          -e ==> set entry point to 'ep' (hex)\n"
                "          -n ==> set image name to 'name'\n"
-@@ -143,7 +145,7 @@ static void process_args(int argc, char
+@@ -150,7 +152,7 @@ static void process_args(int argc, char
        int opt;
  
        while ((opt = getopt(argc, argv,
--                           "a:A:b:c:C:d:D:e:Ef:Fk:i:K:ln:N:p:O:rR:qsT:vVx")) != -1) {
-+                           "a:A:b:c:C:d:D:e:Ef:Fk:i:K:lM:n:N:p:O:rR:qsT:vVx")) != -1) {
+-                 "a:A:b:B:c:C:d:D:e:Ef:Fk:i:K:ln:N:p:O:rR:qstT:vVx")) != -1) {
++                 "a:A:b:B:c:C:d:D:e:Ef:Fk:i:K:lM:n:N:p:O:rR:qstT:vVx")) != -1) {
                switch (opt) {
                case 'a':
                        params.addr = strtoull(optarg, &ptr, 16);
-@@ -221,6 +223,14 @@ static void process_args(int argc, char
+@@ -237,6 +239,14 @@ static void process_args(int argc, char
                case 'l':
                        params.lflag = 1;
                        break;
@@ -61,7 +61,7 @@ This patch makes it possible to set a custom image magic.
        image_set_load(hdr, addr);
 --- a/tools/imagetool.h
 +++ b/tools/imagetool.h
-@@ -53,6 +53,7 @@ struct image_tool_params {
+@@ -56,6 +56,7 @@ struct image_tool_params {
        int arch;
        int type;
        int comp;
index ea2e8e3da3d5e04e6a7f666ea16af9ff0865ab70..5b87a259db59d4b4b76de3135f3a7ff9d71f3103 100644 (file)
@@ -12,8 +12,6 @@ parts for these header files manually or remove the usage too.
 
 __u64 is not available on FreeBSD, remove its usage.
 
-<malloc.h> has been replaced by <stdlib.h>
-
 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 ---
  include/image.h             | 2 ++
@@ -35,21 +33,6 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  #include <stdbool.h>
  
  /* Define this to avoid #ifdefs later on */
---- a/include/imx8image.h
-+++ b/include/imx8image.h
-@@ -11,7 +11,12 @@
- #include <image.h>
- #include <inttypes.h>
- #include "imagetool.h"
-+#ifdef linux
- #include "linux/kernel.h"
-+#else
-+#define ALIGN(x,a)            __ALIGN_MASK((x),(typeof(x))(a)-1)
-+#define __ALIGN_MASK(x,mask)  (((x)+(mask))&~(mask))
-+#endif
- #define __packed   __attribute__((packed))
 --- a/include/linux/posix_types.h
 +++ b/include/linux/posix_types.h
 @@ -43,6 +43,8 @@ typedef void (*__kernel_sighandler_t)(in
@@ -82,14 +65,3 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  typedef __u64 __bitwise __le64;
  typedef __u64 __bitwise __be64;
  #endif
---- a/lib/rsa/rsa-sign.c
-+++ b/lib/rsa/rsa-sign.c
-@@ -4,7 +4,7 @@
-  */
- #include "mkimage.h"
--#include <malloc.h>
-+#include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <image.h>
diff --git a/tools/mkimage/patches/070-remove_generated_autoconf.patch b/tools/mkimage/patches/070-remove_generated_autoconf.patch
deleted file mode 100644 (file)
index 7dcc8b6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/tools/imximage.c
-+++ b/tools/imximage.c
-@@ -11,7 +11,6 @@
- #include "imagetool.h"
- #include <image.h>
- #include "imximage.h"
--#include <generated/autoconf.h>
- #define UNDEFINED 0xFFFFFFFF
index c609912be9032a5a3779ed37e9b6341d5d1bd476..87a425bd9450e4e633582da3918e93e83dadcd9e 100644 (file)
@@ -3,10 +3,10 @@ needed dependencies are added too.
 
 --- a/tools/Makefile
 +++ b/tools/Makefile
-@@ -162,7 +162,7 @@ ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CON
+@@ -158,7 +158,7 @@ ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CON
  HOSTCFLAGS_kwbimage.o += \
        $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
- HOSTLOADLIBES_mkimage += \
+ HOSTLDLIBS_mkimage += \
 -      $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto")
 +      $(shell pkg-config --libs --static libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto")