Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
From 7ea7fe229ea6195938d9eadbe783cb1aa74380ba Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Sun, 26 Apr 2020 15:33:39 +0200
|
||||
Subject: [PATCH] Use LONG_BIT to define RADIX_BITS
|
||||
|
||||
This allows to avoid having to support each CPU architecture
|
||||
individually.
|
||||
|
||||
Also, add the necessary defines in the makefile to expose
|
||||
LONG_BIT. Adding those defines end up requiring using <sys/select.h>
|
||||
as we're now using >= POSIX.1-2001 definitions of fd_set and friends.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
|
||||
[Bernd: rebased for git rev 5452af422edeff70fcae8ea99dd28a0922051d7b]
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
[Fabrice: rebase for rev183-2024-03-27]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
src/LibSupport.h | 21 +++------------------
|
||||
src/TcpServerPosix.c | 1 +
|
||||
src/makefile | 2 ++
|
||||
3 files changed, 6 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/tpm_radix.h b/src/tpm_radix.h
|
||||
index 5055560..48b1e16 100644
|
||||
--- a/src/tpm_radix.h
|
||||
+++ b/src/tpm_radix.h
|
||||
@@ -61,27 +61,9 @@
|
||||
//** Introduction
|
||||
// Common defines for supporting large numbers and cryptographic buffer sizing.
|
||||
//*********************
|
||||
-#ifndef RADIX_BITS
|
||||
-# if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \
|
||||
- || defined(__amd64) || defined(_WIN64) || defined(_M_X64) || defined(_M_ARM64) \
|
||||
- || defined(__aarch64__) || defined(__PPC64__) || defined(__s390x__) \
|
||||
- || defined(__powerpc64__) || defined(__ppc64__)
|
||||
-# define RADIX_BITS 64
|
||||
-# elif defined(__i386__) || defined(__i386) || defined(i386) || defined(_WIN32) \
|
||||
- || defined(_M_IX86)
|
||||
-# define RADIX_BITS 32
|
||||
-# elif defined(_M_ARM) || defined(__arm__) || defined(__thumb__)
|
||||
-# define RADIX_BITS 32
|
||||
-# elif defined(__riscv)
|
||||
-// __riscv and __riscv_xlen are standardized by the RISC-V community and should be available
|
||||
-// on any compliant compiler.
|
||||
-//
|
||||
-// https://github.com/riscv-non-isa/riscv-toolchain-conventions
|
||||
-# define RADIX_BITS __riscv_xlen
|
||||
-# else
|
||||
-# error Unable to determine RADIX_BITS from compiler environment
|
||||
-# endif
|
||||
-#endif // RADIX_BITS
|
||||
+#include <limits.h>
|
||||
+
|
||||
+#define RADIX_BITS LONG_BIT
|
||||
|
||||
#if RADIX_BITS == 64
|
||||
# define RADIX_BYTES 8
|
||||
diff --git a/src/TcpServerPosix.c b/src/TcpServerPosix.c
|
||||
index cad0402..6293cdd 100644
|
||||
--- a/src/TcpServerPosix.c
|
||||
+++ b/src/TcpServerPosix.c
|
||||
@@ -66,6 +66,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
+#include <sys/select.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
diff --git a/src/makefile b/src/makefile
|
||||
index f124e78..6ee128e 100644
|
||||
--- a/src/makefile
|
||||
+++ b/src/makefile
|
||||
@@ -47,6 +47,8 @@ CCFLAGS = -Wall \
|
||||
-c -ggdb -O0 \
|
||||
-DTPM_POSIX \
|
||||
-D_POSIX_ \
|
||||
+ -D_DEFAULT_SOURCE \
|
||||
+ -D_XOPEN_SOURCE=500 \
|
||||
-DTPM_NUVOTON
|
||||
|
||||
# add this line for big endian platforms
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 1b5d9eb91f0d24d09d711ef839d301ee8b640d61 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sun, 21 Jul 2024 09:08:39 +0200
|
||||
Subject: [PATCH] src/BnToOsslMath.h: fix build with openssl 3.3.x
|
||||
|
||||
Fix the following build failure with openssl 3.3.x:
|
||||
|
||||
In file included from BnValues.h:327,
|
||||
from Global.h:80,
|
||||
from Tpm.h:78,
|
||||
from AuditCommands.c:62:
|
||||
TpmToOsslMath.h:83:5: error: #error Untested OpenSSL version
|
||||
83 | # error Untested OpenSSL version
|
||||
| ^~~~~
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/2fb5e1cb792fe25ef860ff8111622cd1ff3770bf
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Upstream: https://github.com/kgoldman/ibmswtpm2/pull/15
|
||||
---
|
||||
src/BnToOsslMath.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/BnToOsslMath.h b/src/BnToOsslMath.h
|
||||
index df4bcfb..72939ea 100644
|
||||
--- a/src/BnToOsslMath.h
|
||||
+++ b/src/BnToOsslMath.h
|
||||
@@ -77,7 +77,7 @@
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x30200ff0L
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x30300ff0L
|
||||
// Check the bignum_st definition against the one below and either update the
|
||||
// version check or provide the new definition for this version.
|
||||
# error Untested OpenSSL version
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From d59535c8c605f0b23abbefd9b23200b1a5e937fe Mon Sep 17 00:00:00 2001
|
||||
From: Peter Korsgaard <peter@korsgaard.com>
|
||||
Date: Fri, 6 Dec 2024 20:35:35 +0100
|
||||
Subject: [PATCH] src/BnToOsslMath.h: fix build with openssl 3.4.x
|
||||
|
||||
Openssl 3.4.x is out:
|
||||
https://github.com/openssl/openssl/blob/openssl-3.4.0/NEWS.md#openssl-34
|
||||
|
||||
So bump the max supported version number similar to how it was done by
|
||||
commit 89a4cb9cf8 "src/BnToOsslMath.h: fix build with openssl 3.3.x" to fix
|
||||
build failures with 3.4.x:
|
||||
|
||||
In file included from BnValues.h:327,
|
||||
from Global.h:80,
|
||||
from Tpm.h:78,
|
||||
from AuditCommands.c:62:
|
||||
TpmToOsslMath.h:83:5: error: #error Untested OpenSSL version
|
||||
83 | # error Untested OpenSSL version
|
||||
| ^~~~~
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.net/results/be6c679b821183b4385c74471e26d9ad7d3d8967
|
||||
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
Upstream: https://github.com/kgoldman/ibmswtpm2/pull/17
|
||||
---
|
||||
src/BnToOsslMath.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/BnToOsslMath.h b/src/BnToOsslMath.h
|
||||
index 72939ea..165304d 100644
|
||||
--- a/src/BnToOsslMath.h
|
||||
+++ b/src/BnToOsslMath.h
|
||||
@@ -77,7 +77,7 @@
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x30300ff0L
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x30400ff0L
|
||||
// Check the bignum_st definition against the one below and either update the
|
||||
// version check or provide the new definition for this version.
|
||||
# error Untested OpenSSL version
|
||||
--
|
||||
2.39.5
|
||||
|
||||
39
package/ibm-sw-tpm2/0004-tpm-Update-to-OpenSSL-3.5.patch
Normal file
39
package/ibm-sw-tpm2/0004-tpm-Update-to-OpenSSL-3.5.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 720ed4b8c74c3b517a46b442be9482319ed027dd Mon Sep 17 00:00:00 2001
|
||||
From: Ken Goldman <kgold@linux.ibm.com>
|
||||
Date: Fri, 18 Apr 2025 13:41:59 -0400
|
||||
Subject: [PATCH] tpm: Update to OpenSSL 3.5
|
||||
|
||||
Accept 3.5 as a supported version
|
||||
|
||||
Signed-off-by: Ken Goldman <kgold@linux.ibm.com>
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
Upstream: https://github.com/kgoldman/ibmswtpm2/commit/720ed4b8c74c3b517a46b442be9482319ed027dd
|
||||
---
|
||||
src/BnToOsslMath.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/BnToOsslMath.h b/src/BnToOsslMath.h
|
||||
index 165304d..5fd5323 100644
|
||||
--- a/src/BnToOsslMath.h
|
||||
+++ b/src/BnToOsslMath.h
|
||||
@@ -54,7 +54,7 @@
|
||||
/* arising in any way out of use or reliance upon this specification or any */
|
||||
/* information herein. */
|
||||
/* */
|
||||
-/* (c) Copyright IBM Corp. and others, 2023 */
|
||||
+/* (c) Copyright IBM Corp. and others, 2023 - 2025 */
|
||||
/* */
|
||||
/********************************************************************************/
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x30400ff0L
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x30500ff0L
|
||||
// Check the bignum_st definition against the one below and either update the
|
||||
// version check or provide the new definition for this version.
|
||||
# error Untested OpenSSL version
|
||||
--
|
||||
2.39.5
|
||||
|
||||
25
package/ibm-sw-tpm2/0005-tpm-Update-to-OpenSSL-3.6.patch
Normal file
25
package/ibm-sw-tpm2/0005-tpm-Update-to-OpenSSL-3.6.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
From 7f727710326bc0a6d6f28397253ec3a89000300e Mon Sep 17 00:00:00 2001
|
||||
From: Pedro Monreal <pmonrealgonzalez@suse.com>
|
||||
Date: Fri, 3 Oct 2025 10:35:46 +0200
|
||||
Subject: [PATCH] tpm: Update to OpenSSL 3.6
|
||||
|
||||
Upstream: https://github.com/kgoldman/ibmswtpm2/pull/22
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
src/BnToOsslMath.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/BnToOsslMath.h b/src/BnToOsslMath.h
|
||||
index 26828d0..731957e 100644
|
||||
--- a/src/BnToOsslMath.h
|
||||
+++ b/src/BnToOsslMath.h
|
||||
@@ -77,7 +77,7 @@
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x30500ff0L
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x30600ff0L
|
||||
// Check the bignum_st definition against the one below and either update the
|
||||
// version check or provide the new definition for this version.
|
||||
# error Untested OpenSSL version
|
||||
16
package/ibm-sw-tpm2/Config.in
Normal file
16
package/ibm-sw-tpm2/Config.in
Normal file
@@ -0,0 +1,16 @@
|
||||
config BR2_PACKAGE_IBM_SW_TPM2
|
||||
bool "ibm-sw-tpm2"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on !BR2_STATIC_LIBS # ibm-sw-tpm2
|
||||
select BR2_PACKAGE_OPENSSL
|
||||
select BR2_PACKAGE_OPENSSL_FORCE_LIBOPENSSL
|
||||
help
|
||||
This project is an implementation of the TCG TPM 2.0
|
||||
specification. It is based on the TPM specification Parts 3
|
||||
and 4 source code donated by Microsoft, with additional
|
||||
files to complete the implementation.
|
||||
|
||||
https://sourceforge.net/projects/ibmswtpm2/
|
||||
|
||||
comment "ibm-sw-tpm2 needs a toolchain w/ threads, dynamic library"
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
|
||||
3
package/ibm-sw-tpm2/ibm-sw-tpm2.hash
Normal file
3
package/ibm-sw-tpm2/ibm-sw-tpm2.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed:
|
||||
sha256 239cea3ec99cb31fb25c1ba4fe9b98a862bb20daefefeba8908d370bedd42a31 ibm-sw-tpm2-rev183-2024-03-27-git4.tar.gz
|
||||
sha256 dd2d31b560011ea673e197251e710e52669d911367d83cd3cfd018f8ed58bde9 LICENSE
|
||||
23
package/ibm-sw-tpm2/ibm-sw-tpm2.mk
Normal file
23
package/ibm-sw-tpm2/ibm-sw-tpm2.mk
Normal file
@@ -0,0 +1,23 @@
|
||||
################################################################################
|
||||
#
|
||||
# ibm-sw-tpm2
|
||||
#
|
||||
################################################################################
|
||||
|
||||
IBM_SW_TPM2_VERSION = rev183-2024-03-27
|
||||
IBM_SW_TPM2_SITE = https://git.code.sf.net/p/ibmswtpm2/tpm2
|
||||
IBM_SW_TPM2_SITE_METHOD = git
|
||||
IBM_SW_TPM2_LICENSE = BSD-3-Clause
|
||||
IBM_SW_TPM2_LICENSE_FILES = LICENSE
|
||||
IBM_SW_TPM2_DEPENDENCIES = openssl
|
||||
|
||||
define IBM_SW_TPM2_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src $(TARGET_CONFIGURE_OPTS)
|
||||
endef
|
||||
|
||||
define IBM_SW_TPM2_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src $(TARGET_CONFIGURE_OPTS) install \
|
||||
DESTDIR=$(TARGET_DIR)
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user