Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/debloat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ debloat_paths=(
"/nix"
)

if [[ ! "$PROFILES" == *"devtools"* ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this i was getting:

‣  Running finalize script /home/debian/mnt/base/debloat.sh…
/work/finalize: line 42: PROFILES: unbound variable
‣ "/work/finalize" returned non-zero exit code 1.

I'm not sure if there is any danger in accepting an unbound value here.

if [[ "${PROFILES:-}" != *"devtools"* ]]; then
debloat_paths+=(
"/usr/share/bash-completion"
)
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_rust_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ build_rust_package() {
CARGO_TERM_COLOR='never'
cd '/build/$package'
cargo fetch
cargo build --release --frozen ${extra_features:+--features $extra_features}
cargo build -p $package --release --frozen ${extra_features:+--features $extra_features}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have more than one crate in the workspace, so i need to specify which one i want to build. Im not sure whether this change would effect other users of this script - need to check their crate names (lighthouse, reth and rbuilder).

"

# Cache and install the built binary
install -m 755 "$build_dir/target/release/$package" "$cached_binary"
install -m 755 "$cached_binary" "$dest_path"
}
}
6 changes: 6 additions & 0 deletions tdx-dummy-azure.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Include]
Include=base/mkosi.conf
Include=tdx-dummy-azure/mkosi.conf

[Config]
Profiles=azure
17 changes: 17 additions & 0 deletions tdx-dummy-azure/dummy-tdx-azure.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Dummy TDX server for azure attestation
After=network-setup.service
Wants=network-setup.service

[Service]
Type=exec
User=root
Group=root
ExecStart=/usr/bin/dummy-attestation-server server --listen-addr 0.0.0.0:8080 --server-attestation-type azure-tdx
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=minimal.target
18 changes: 18 additions & 0 deletions tdx-dummy-azure/mkosi.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -euxo pipefail

source scripts/build_rust_package.sh

# local package="$1"
# local version="$2"
# local git_url="$3"
# local provided_binary="$4"
# local extra_features="${5:-}"
# local extra_rustflags="${6:-}"
build_rust_package \
"dummy-attestation-server" \
"azure-attest-test02" \
"https://github.com/flashbots/attested-tls-proxy.git" \
"" \
"" \
"-l z -l zstd"
14 changes: 14 additions & 0 deletions tdx-dummy-azure/mkosi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Content]
WithNetwork=true
BuildScripts=tdx-dummy-azure/mkosi.build

Packages=libtss2-esys-3.0.2-0t64
libtss2-tctildr0t64

BuildPackages=ca-certificates
cargo
git
libtss2-dev
zlib1g-dev

PostInstallationScripts=tdx-dummy-azure/mkosi.postinst
8 changes: 8 additions & 0 deletions tdx-dummy-azure/mkosi.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -euxo pipefail

# Install systemd service units
SERVICE_DIR="$BUILDROOT/etc/systemd/system"
mkdir -p "$SERVICE_DIR"

install -m 644 "tdx-dummy-azure/dummy-tdx-azure.service" "$SERVICE_DIR/"