tools: mkimage: Update U-Boot to version 2021.01

* 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>
This commit is contained in:
Hauke Mehrtens 2021-01-06 19:36:44 +01:00
parent 3e7c7d4446
commit e6ccb40ba5
6 changed files with 13 additions and 60 deletions

View 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

View File

@ -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;

View 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;

View 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>

View File

@ -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

View 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")