Initial Commit
- initial default booting image
This commit is contained in:
26
package/tpm2-abrmd/Config.in
Normal file
26
package/tpm2-abrmd/Config.in
Normal file
@@ -0,0 +1,26 @@
|
||||
config BR2_PACKAGE_TPM2_ABRMD
|
||||
bool "tpm2-abrmd"
|
||||
depends on BR2_USE_WCHAR # libglib2
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
|
||||
depends on BR2_USE_MMU # libglib2
|
||||
depends on !BR2_STATIC_LIBS # tpm2-tss
|
||||
select BR2_PACKAGE_LIBGLIB2
|
||||
select BR2_PACKAGE_TPM2_TSS
|
||||
help
|
||||
A system daemon implementing the TPM2 access broker (TAB) &
|
||||
Resource Manager (RM) spec from the TCG. It should be started
|
||||
during the OS boot process. Communication between the daemon
|
||||
and clients using the TPM is done with a combination of DBus
|
||||
and Unix pipes.
|
||||
|
||||
The package also provides a client library for interacting
|
||||
with the daemon via TPM Command Transmission Interface (TCTI).
|
||||
It is intended for use with the SAPI library (libtss2-sys)
|
||||
like any other TCTI.
|
||||
|
||||
https://github.com/tpm2-software/tpm2-abrmd
|
||||
|
||||
comment "tpm2-abrmd needs a toolchain w/ dynamic library, wchar, threads"
|
||||
depends on BR2_USE_MMU
|
||||
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
|
||||
BR2_STATIC_LIBS
|
||||
69
package/tpm2-abrmd/S80tpm2-abrmd
Normal file
69
package/tpm2-abrmd/S80tpm2-abrmd
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="tpm2-abrmd"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
TABRMD_ARGS="--tcti=device --logger=syslog --max-connections=20"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
check_device() {
|
||||
if ! ls /dev/tpm[0-9]* > /dev/null 2>&1; then
|
||||
echo "no TPM device found, skipping."
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -x /sbin/udevd ]; then
|
||||
chown tss:tss /dev/tpm[0-9]* && chmod 660 /dev/tpm*
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
check_device
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon --start --background --chuid tss:tss --make-pidfile \
|
||||
--pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON" \
|
||||
-- ${TABRMD_ARGS}
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon --stop --pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
return "$status"
|
||||
fi
|
||||
while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \
|
||||
--exec "/usr/sbin/$DAEMON"; do
|
||||
sleep 0.1
|
||||
done
|
||||
rm -f "$PIDFILE"
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: tpm2-abrmd {start|stop|restart|reload}" >&2
|
||||
exit 1
|
||||
esac
|
||||
3
package/tpm2-abrmd/tpm2-abrmd.hash
Normal file
3
package/tpm2-abrmd/tpm2-abrmd.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed:
|
||||
sha256 d59aff34164aa705b05155b86607f6b66918a433104f754a3fcf76216dd9f465 tpm2-abrmd-3.0.0.tar.gz
|
||||
sha256 18c1bf4b1ba1fb2c4ffa7398c234d83c0d55475298e470ae1e5e3a8a8bd2e448 LICENSE
|
||||
33
package/tpm2-abrmd/tpm2-abrmd.mk
Normal file
33
package/tpm2-abrmd/tpm2-abrmd.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
################################################################################
|
||||
#
|
||||
# tpm2-abrmd
|
||||
#
|
||||
################################################################################
|
||||
|
||||
TPM2_ABRMD_VERSION = 3.0.0
|
||||
TPM2_ABRMD_SITE = https://github.com/tpm2-software/tpm2-abrmd/releases/download/$(TPM2_ABRMD_VERSION)
|
||||
TPM2_ABRMD_LICENSE = BSD-2-Clause
|
||||
TPM2_ABRMD_LICENSE_FILES = LICENSE
|
||||
TPM2_ABRMD_SELINUX_MODULES = tpm2
|
||||
TPM2_ABRMD_INSTALL_STAGING = YES
|
||||
TPM2_ABRMD_DEPENDENCIES = libglib2 tpm2-tss host-pkgconf
|
||||
TPM2_ABRMD_CONF_OPTS = \
|
||||
--disable-defaultflags \
|
||||
--with-systemdsystemunitdir=$(if $(BR2_INIT_SYSTEMD),/usr/lib/systemd/system,no) \
|
||||
--with-udevrulesdir=$(if $(BR2_PACKAGE_HAS_UDEV),/usr/lib/udev/rules.d,no) \
|
||||
--with-dbuspolicydir=/usr/share/dbus-1/system.d
|
||||
|
||||
# uses C99 code but forgets to pass -std=c99 when --disable-defaultflags is used
|
||||
TPM2_ABRMD_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -std=c99"
|
||||
|
||||
define TPM2_ABRMD_INSTALL_INIT_SYSTEMD
|
||||
$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) DESTDIR=$(TARGET_DIR) \
|
||||
install-systemdpresetDATA install-systemdsystemunitDATA
|
||||
endef
|
||||
|
||||
define TPM2_ABRMD_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 $(TPM2_ABRMD_PKGDIR)/S80tpm2-abrmd \
|
||||
$(TARGET_DIR)/etc/init.d/S80tpm2-abrmd
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user