forked from AMDEPYC/sev-certify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeacon-report.sh
More file actions
executable file
·41 lines (35 loc) · 1.29 KB
/
Copy pathbeacon-report.sh
File metadata and controls
executable file
·41 lines (35 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/bash
set -euo pipefail
SEV_VERSIONS=("3.0-0")
SEV_CERT_FILE=""
SET_MILESTONE="${SET_MILESTONE:-false}"
# Determine OS name and version
if [ -f /etc/os-release ]; then
. /etc/os-release
OS_NAME="${ID}"
OS_VERSION="${VERSION_ID}"
OS_LABEL="${OS_NAME}-${OS_VERSION}"
else
OS_NAME="$(uname -s)"
OS_VERSION=""
OS_LABEL="${OS_NAME}"
fi
# Loop over to generate beacon report for all SEV certificates
for sev_version in "${SEV_VERSIONS[@]}"; do
# Build title
if [ -n "$OS_VERSION" ]; then
SEV_TITLE="${OS_NAME} ${OS_VERSION} SEV version ${sev_version}"
else
SEV_TITLE="${OS_NAME} SEV version ${sev_version}"
fi
# Obtain SEV Version Content
SEV_CERT_FILE="${HOME:-/root}/sev_certificate_v${sev_version}.txt"
# Call beacon
if [ -e "${SEV_CERT_FILE}" ] && [ -z "$(grep "❌" "${SEV_CERT_FILE}")" ] && [ "${SET_MILESTONE}" == "true" ]; then
# Add milestone if no errors encountered and if this is a release build.
beacon report --title "$SEV_TITLE" --body "$SEV_CERT_FILE" --label "certificate" --label "os-${OS_LABEL}" --milestone "v${sev_version}"
else
beacon report --title "$SEV_TITLE" --body "$SEV_CERT_FILE" --label "certificate" --label "os-${OS_LABEL}"
fi
echo "Published SEV certificate via beacon with title: $SEV_TITLE"
done