]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
libtpms: New package
authorDaniel Weismüller <daniel.weismueller@ipfire.org>
Tue, 8 Jul 2025 15:04:27 +0000 (17:04 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 8 Jul 2025 15:18:21 +0000 (15:18 +0000)
This package is required for libvirt to emulate TPM devices.

Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/packages/libtpms [new file with mode: 0644]
lfs/libtpms [new file with mode: 0644]
make.sh

diff --git a/config/rootfiles/packages/libtpms b/config/rootfiles/packages/libtpms
new file mode 100644 (file)
index 0000000..6fce3eb
--- /dev/null
@@ -0,0 +1,41 @@
+#usr/include/libtpms
+#usr/include/libtpms/tpm_error.h
+#usr/include/libtpms/tpm_library.h
+#usr/include/libtpms/tpm_memory.h
+#usr/include/libtpms/tpm_nvfilename.h
+#usr/include/libtpms/tpm_tis.h
+#usr/include/libtpms/tpm_types.h
+#usr/lib/libtpms.a
+#usr/lib/libtpms.la
+#usr/lib/libtpms.so
+usr/lib/libtpms.so.0
+usr/lib/libtpms.so.0.10.1
+#usr/lib/pkgconfig/libtpms.pc
+#usr/share/man/man3/TPMLIB_CancelCommand.3
+#usr/share/man/man3/TPMLIB_ChooseTPMVersion.3
+#usr/share/man/man3/TPMLIB_DecodeBlob.3
+#usr/share/man/man3/TPMLIB_GetInfo.3
+#usr/share/man/man3/TPMLIB_GetState.3
+#usr/share/man/man3/TPMLIB_GetTPMProperty.3
+#usr/share/man/man3/TPMLIB_GetVersion.3
+#usr/share/man/man3/TPMLIB_MainInit.3
+#usr/share/man/man3/TPMLIB_Process.3
+#usr/share/man/man3/TPMLIB_RegisterCallbacks.3
+#usr/share/man/man3/TPMLIB_SetBufferSize.3
+#usr/share/man/man3/TPMLIB_SetDebugFD.3
+#usr/share/man/man3/TPMLIB_SetDebugLevel.3
+#usr/share/man/man3/TPMLIB_SetDebugPrefix.3
+#usr/share/man/man3/TPMLIB_SetProfile.3
+#usr/share/man/man3/TPMLIB_SetState.3
+#usr/share/man/man3/TPMLIB_Terminate.3
+#usr/share/man/man3/TPMLIB_ValidateState.3
+#usr/share/man/man3/TPMLIB_VolatileAll_Store.3
+#usr/share/man/man3/TPMLIB_WasManufactured.3
+#usr/share/man/man3/TPM_Free.3
+#usr/share/man/man3/TPM_IO_Hash_Data.3
+#usr/share/man/man3/TPM_IO_Hash_End.3
+#usr/share/man/man3/TPM_IO_Hash_Start.3
+#usr/share/man/man3/TPM_IO_TpmEstablished_Get.3
+#usr/share/man/man3/TPM_IO_TpmEstablished_Reset.3
+#usr/share/man/man3/TPM_Malloc.3
+#usr/share/man/man3/TPM_Realloc.3
diff --git a/lfs/libtpms b/lfs/libtpms
new file mode 100644 (file)
index 0000000..1f87a23
--- /dev/null
@@ -0,0 +1,91 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2025  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+SUMMARY           = This library provides software emulation of a Trusted Platform Module (TPM 1.2 and TPM 2.0).
+
+VER        = 0.10.1
+
+THISAPP    = libtpms-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = libtpms
+PAK_VER    = 1
+
+DEPS       =
+
+SERVICES   =
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_BLAKE2 = 39feead951a84b715e8e4db8cd6eab7f19728c00423df16150c99004230061691cde90fcf7aafc6a5748647ac58cb696b89a709368da4b8f0c684b22321ff1ea
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+b2 : $(subst %,%_BLAKE2,$(objects))
+
+###############################################################################
+# Downloading, checking, b2sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_BLAKE2,$(objects)) :
+       @$(B2SUM)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       -mkdir -pv $(DIR_APP)
+       cd $(DIR_APP) && autoreconf -vfi
+       cd $(DIR_APP) && ./configure \
+               --prefix=/usr \
+               --with-tpm2 \
+               --with-openssl \
+               --disable-hardening
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index cf794701814ead4ef5aff26d0bf48f018ec64c71..12d097fd8d9eca384d2f92ffcc8a8d3aa178b097 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -2033,6 +2033,7 @@ build_system() {
        lfsmake2 frr
        lfsmake2 dmidecode
        lfsmake2 mcelog
+       lfsmake2 libtpms
        lfsmake2 libpciaccess
        lfsmake2 ovmf
        lfsmake2 libvirt