From dffeaacd06aa190ca99ff6c382cdcb1238376761 Mon Sep 17 00:00:00 2001 From: Lans Zhang Date: Thu, 20 Jul 2017 10:30:19 +0800 Subject: meta-tpm: code style fixup Signed-off-by: Lans Zhang --- .../recipes-base/packagegroups/packagegroup-tpm.bb | 5 ++- .../linux/linux-yocto-rt_4.%.bbappend | 2 +- meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc | 2 +- meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg | 13 ------ meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc | 1 - .../recipes-kernel/linux/linux-yocto_4.%.bbappend | 2 +- ...path-use-POSIX-getpwent-instead-of-getpwe.patch | 49 ++++++++++++++++++++++ 7 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch diff --git a/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb b/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb index 684a392..460320b 100644 --- a/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb +++ b/meta-tpm/recipes-base/packagegroups/packagegroup-tpm.bb @@ -1,6 +1,9 @@ DESCRIPTION = "Basic packagegroup for TCG TSS and utilities that use it." LICENSE = "MIT" -PR = "r0" +LIC_FILES_CHKSUM = "\ + file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \ +" inherit packagegroup diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend b/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend index 8fbd7ba..32bfc50 100644 --- a/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend +++ b/meta-tpm/recipes-kernel/linux/linux-yocto-rt_4.%.bbappend @@ -1 +1 @@ -include linux-yocto-tpm.inc +require linux-yocto-tpm.inc diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc b/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc index 276e154..4285531 100644 --- a/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc +++ b/meta-tpm/recipes-kernel/linux/linux-yocto-tpm.inc @@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:" -SRC_URI += " \ +SRC_URI += "\ ${@bb.utils.contains('DISTRO_FEATURES', 'tpm', \ 'file://tpm.scc file://tpm.cfg', '', d)} \ " diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg index ac18405..0ab3b78 100644 --- a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg +++ b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.cfg @@ -1,16 +1,3 @@ -.......................................................................... -. WARNING -. -. This file is a kernel configuration fragment, and not a full kernel -. configuration file. The final kernel configuration is made up of -. an assembly of processed fragments, each of which is designed to -. capture a specific part of the final configuration (e.g. platform -. configuration, feature configuration, and board specific hardware -. configuration). For more information on kernel configuration, please -. consult the product documentation. -. -.......................................................................... - CONFIG_TCG_TPM=y CONFIG_TCG_TIS=y CONFIG_TCG_ATMEL=y diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc index 90cfe56..046e8d6 100644 --- a/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc +++ b/meta-tpm/recipes-kernel/linux/linux-yocto/tpm.scc @@ -1,4 +1,3 @@ define KFEATURE_DESCRIPTION "TPM 1.x enablement" kconf hardware tpm.cfg - diff --git a/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend b/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend index 8fbd7ba..32bfc50 100644 --- a/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend +++ b/meta-tpm/recipes-kernel/linux/linux-yocto_4.%.bbappend @@ -1 +1 @@ -include linux-yocto-tpm.inc +require linux-yocto-tpm.inc diff --git a/meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch b/meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch new file mode 100644 index 0000000..3f5a144 --- /dev/null +++ b/meta-tpm/recipes-tpm/trousers/files/get-user-ps-path-use-POSIX-getpwent-instead-of-getpwe.patch @@ -0,0 +1,49 @@ +trousers: fix compiling with musl + +use POSIX getpwent instead of getpwent_r + +Upstream-Status: Submitted + +Signed-off-by: Armin Kuster + +Index: git/src/tspi/ps/tspps.c +=================================================================== +--- git.orig/src/tspi/ps/tspps.c ++++ git/src/tspi/ps/tspps.c +@@ -66,9 +66,6 @@ get_user_ps_path(char **file) + TSS_RESULT result; + char *file_name = NULL, *home_dir = NULL; + struct passwd *pwp; +-#if (defined (__linux) || defined (linux) || defined(__GLIBC__)) +- struct passwd pw; +-#endif + struct stat stat_buf; + char buf[PASSWD_BUFSIZE]; + uid_t euid; +@@ -96,24 +93,15 @@ get_user_ps_path(char **file) + #else + setpwent(); + while (1) { +-#if (defined (__linux) || defined (linux) || defined(__GLIBC__)) +- rc = getpwent_r(&pw, buf, PASSWD_BUFSIZE, &pwp); +- if (rc) { +- LogDebugFn("USER PS: Error getting path to home directory: getpwent_r: %s", +- strerror(rc)); +- endpwent(); +- return TSPERR(TSS_E_INTERNAL_ERROR); +- } +- +-#elif (defined (__FreeBSD__) || defined (__OpenBSD__)) + if ((pwp = getpwent()) == NULL) { + LogDebugFn("USER PS: Error getting path to home directory: getpwent: %s", + strerror(rc)); + endpwent(); ++#if (defined (__FreeBSD__) || defined (__OpenBSD__)) + MUTEX_UNLOCK(user_ps_path); ++#endif + return TSPERR(TSS_E_INTERNAL_ERROR); + } +-#endif + if (euid == pwp->pw_uid) { + home_dir = strdup(pwp->pw_dir); + break; -- cgit v1.2.3-54-g00ecf