-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#7] Setup Build/Package Support for Ubuntu
- Loading branch information
Showing
11 changed files
with
296 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Check packager OS is Ubuntu | ||
OS_NAME=$(awk -F= '/^NAME/{print $2}' /etc/os-release) | ||
if [ "$OS_NAME" != "\"Ubuntu\"" ]; then | ||
echo "Error: DEBs must be built with Ubuntu" | ||
exit 1 | ||
fi | ||
|
||
# Find package directory | ||
cd $( dirname "${BASH_SOURCE[0]}" ) | ||
|
||
# Ensure clean build environment | ||
rm -rf BUILD | ||
mkdir BUILD | ||
|
||
# Navigate to build directory | ||
cd BUILD | ||
|
||
# Build HIRS_ProvisionerTPM2 DEB | ||
cmake ../.. | ||
|
||
# If the current directory is empty, there may be an existing CmakeCache.txt | ||
# file that prevents cmake from building in the current directory | ||
if ! [ "$(ls -A)" ]; then | ||
echo "CMake failed to generate files in the target directory. Is there " | ||
echo "an existing CMakeCache.txt file in the CMake source directory? " | ||
echo "If so, delete it." | ||
exit 1 | ||
fi | ||
make | ||
cpack | ||
|
||
# Move HIRS_ProvisionerTPM2 DEB | ||
rm -f ../../../package/deb/DEBS/HIRSProvisionerTPM2.0*.deb | ||
if [ ! -d "../../../package/deb/DEBS" ]; then | ||
mkdir -p ../../../package/deb/DEBS | ||
fi | ||
mv *.deb ../../../package/deb/DEBS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
HIRS_SITE_CONFIG="/etc/hirs/hirs-site.config" | ||
|
||
mkdir -p /var/log/hirs/provisioner | ||
ln -s -f /usr/local/bin/hirs-provisioner-tpm2 /usr/sbin/hirs-provisioner-tpm2 | ||
ln -s -f /usr/local/bin/tpm_aca_provision /usr/sbin/tpm_aca_provision | ||
|
||
if [ ! -f $HIRS_SITE_CONFIG ]; then | ||
# Create template site config if it does not exist | ||
cat <<DEFAULT_SITE_CONFIG_FILE > $HIRS_SITE_CONFIG | ||
#******************************************* | ||
#* HIRS site configuration properties file | ||
#******************************************* | ||
|
||
# Client configuration | ||
CLIENT_HOSTNAME=$(hostname -f) | ||
TPM_ENABLED= | ||
IMA_ENABLED= | ||
|
||
# Site-specific configuration | ||
ATTESTATION_CA_FQDN= | ||
ATTESTATION_CA_PORT=8443 | ||
BROKER_FQDN= | ||
BROKER_PORT=61616 | ||
PORTAL_FQDN= | ||
PORTAL_PORT=8443 | ||
|
||
DEFAULT_SITE_CONFIG_FILE | ||
|
||
echo "$HIRS_SITE_CONFIG not found - a template has been created" | ||
echo "Set your site configuration manually in $HIRS_SITE_CONFIG, then run 'hirs-provisioner-tpm2 provision' to provision this system" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.