From patchwork Tue Jul 8 15:04:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Weism=C3=BCller?= X-Patchwork-Id: 8909 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4bc4DJ4d7pz3wm9 for ; Tue, 8 Jul 2025 15:05:36 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4bc4DD3tR6z6lX for ; Tue, 8 Jul 2025 15:05:32 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4bc4DC6GH5z34QF for ; Tue, 8 Jul 2025 15:05:31 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4bc4D86qgGz32MN for ; Tue, 8 Jul 2025 15:05:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4bc4D82vjXzkc; Tue, 8 Jul 2025 15:05:28 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1751987128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nm10ukc614dbxycnYGWZJgn+VG1lklIb+LsgXfs65BQ=; b=SlXxCw0gS/475ug9uTEjsZEp2MiE0Evlf+Hxg27mts5Ci5g+MLoHxsiveXhhjsS7JJLIUg oaeosLQWzngRSuDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1751987128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nm10ukc614dbxycnYGWZJgn+VG1lklIb+LsgXfs65BQ=; b=Kr1TJf/mb1vlBeLLRECFoPcFsU7N67qeHcAiT7wrQ3XjFl8nmP93HdhsKy0gcKu0liQruG ApDJFxM6QXippuZD3Hzy6aGv0tFY6TEkuJLljYL+vZtegW0WHLdoynpQnfPSg517+EsZmP WK29bU9bfGtPWhdTt+/7OB2yW55fs0fra+YClHsGY1bOryecEBf0oruZmIEsbr5TKWcbs+ Gsl6vyq8dJ6cBHnToRCaZY/5AvazxUo2gN4vTGYdzyMYKTecnlXmADNAu1j03GrwxREGrw Bl4mGHFn32QF6AvZtsTVJ8xmkRItrJFnNDYpz8Kjo0TK5x5CnoBiKM8v7Wkd8g== From: =?utf-8?q?Daniel_Weism=C3=BCller?= To: development@lists.ipfire.org Cc: =?utf-8?q?Daniel_Weism=C3=BCller?= Subject: [PATCH 2/3] libtpms: New package Date: Tue, 8 Jul 2025 17:04:27 +0200 Message-ID: <20250708150509.8131-2-daniel.weismueller@ipfire.org> In-Reply-To: <20250708150509.8131-1-daniel.weismueller@ipfire.org> References: <20250708150509.8131-1-daniel.weismueller@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 This package is required for libvirt to emulate TPM devices. Signed-off-by: Daniel Weismüller --- config/rootfiles/packages/libtpms | 41 ++++++++++++++ lfs/libtpms | 91 +++++++++++++++++++++++++++++++ make.sh | 1 + 3 files changed, 133 insertions(+) create mode 100644 config/rootfiles/packages/libtpms create mode 100644 lfs/libtpms diff --git a/config/rootfiles/packages/libtpms b/config/rootfiles/packages/libtpms new file mode 100644 index 000000000..6fce3ebd8 --- /dev/null +++ b/config/rootfiles/packages/libtpms @@ -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 index 000000000..1f87a236c --- /dev/null +++ b/lfs/libtpms @@ -0,0 +1,91 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2025 IPFire Team # +# # +# 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 . # +# # +############################################################################### + +############################################################################### +# 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 3412c8f5a..384c09407 100755 --- a/make.sh +++ b/make.sh @@ -2032,6 +2032,7 @@ build_system() { lfsmake2 frr lfsmake2 dmidecode lfsmake2 mcelog + lfsmake2 libtpms lfsmake2 libpciaccess lfsmake2 ovmf lfsmake2 libvirt