forked from openwrt/openwrt
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also change the download source to https and add a mirror drop merged patches Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com> [Add extra changes to compile on FreeBSD, merge two patches] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
- Loading branch information
Showing
7 changed files
with
113 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
tools/mkimage/patches/050-Add-compatibility-with-non-Linux-hosts.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
From 590b23a46b7ae0f5ec5e8f57a85c0e7578c71141 Mon Sep 17 00:00:00 2001 | ||
From: Hauke Mehrtens <hauke@hauke-m.de> | ||
Date: Sun, 26 Apr 2020 17:15:17 +0200 | ||
Subject: [PATCH 1/2] Add compatibility with non Linux hosts | ||
|
||
This adds some changes to the u-boot tools to make it possible to build | ||
them on non Linux hosts like MacOS or FreeBSD. | ||
|
||
asm/byteorder.h, asm/posix_types.h, asm/types.h and linux/kernel.h are | ||
not available on such systems. Remove the include and add the necessary | ||
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 ++ | ||
include/imx8image.h | 5 +++++ | ||
include/linux/posix_types.h | 2 ++ | ||
include/linux/types.h | 4 +++- | ||
lib/rsa/rsa-sign.c | 2 +- | ||
5 files changed, 13 insertions(+), 2 deletions(-) | ||
|
||
--- a/include/image.h | ||
+++ b/include/image.h | ||
@@ -16,7 +16,9 @@ | ||
#define __IMAGE_H__ | ||
|
||
#include "compiler.h" | ||
+#ifdef linux | ||
#include <asm/byteorder.h> | ||
+#endif | ||
#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 | ||
/* Type of a SYSV IPC key. */ | ||
typedef int __kernel_key_t; | ||
|
||
+#ifdef linux | ||
#include <asm/posix_types.h> | ||
+#endif | ||
|
||
#endif /* _LINUX_POSIX_TYPES_H */ | ||
--- a/include/linux/types.h | ||
+++ b/include/linux/types.h | ||
@@ -2,7 +2,9 @@ | ||
#define _LINUX_TYPES_H | ||
|
||
#include <linux/posix_types.h> | ||
+#ifdef linux | ||
#include <asm/types.h> | ||
+#endif | ||
#include <stdbool.h> | ||
|
||
#ifndef __KERNEL_STRICT_NAMES | ||
@@ -142,7 +144,7 @@ typedef __u16 __bitwise __le16; | ||
typedef __u16 __bitwise __be16; | ||
typedef __u32 __bitwise __le32; | ||
typedef __u32 __bitwise __be32; | ||
-#if defined(__GNUC__) | ||
+#if defined(__GNUC__) && defined(linux) | ||
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> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters