Skip to content

Commit 7d5120f

Browse files
committed
Fix efi stub for measured boot + other misc tweaks for azure build
1 parent 2152d79 commit 7d5120f

File tree

7 files changed

+35
-3244
lines changed

7 files changed

+35
-3244
lines changed

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM ubuntu:25.04
2+
3+
RUN apt-get update && apt-get install -y \
4+
curl git sudo qemu-system-x86 qemu-utils \
5+
debian-archive-keyring systemd-boot reprepro xz-utils
6+
7+
RUN adduser --disabled-password --gecos '' nix && \
8+
echo "nix ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/nix && \
9+
chmod 0440 /etc/sudoers.d/nix
10+
11+
COPY --chown=nix:nix . /home/nix/mkosi
12+
RUN mkdir -p /home/nix/mkosi/mkosi.packages /home/nix/mkosi/mkosi.cache \
13+
/home/nix/mkosi/mkosi.builddir /home/nix/mkosi/build /nix && \
14+
chown -R nix:nix /home/nix/mkosi /nix
15+
16+
USER nix
17+
RUN curl -L https://nixos.org/nix/install | sh -s -- --no-daemon && \
18+
mkdir -p ~/.config/nix ~/.cache/mkosi/ && \
19+
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
20+
RUN /home/nix/.nix-profile/bin/nix develop -c /bin/true
21+
22+
WORKDIR /home/nix/mkosi
23+
ENTRYPOINT ["/home/nix/.nix-profile/bin/nix", "develop", "-c", "/bin/bash"]

base/base.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ KernelCommandLine=console=tty0 console=ttyS0,115200n8 mitigations=auto,nosmt spe
2222
SkeletonTrees=base/mkosi.skeleton
2323
FinalizeScripts=base/debloat.sh
2424
PostInstallationScripts=base/debloat-systemd.sh
25+
PostInstallationScripts=base/efi-stub.sh
2526
BuildScripts=base/mkosi.build
2627

2728
CleanPackageMetadata=true

base/efi-stub.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Use a version of systemd-boot that is compatible with measured-boot script
5+
SYSTEMD_BOOT_URL="https://snapshot.debian.org/archive/debian/20240314T094714Z/pool/main/s/systemd/systemd-boot-efi_255.4-1_amd64.deb"
6+
TEMP_DEB="$BUILDROOT/systemd-boot.deb"
7+
curl -L -o "$TEMP_DEB" "$SYSTEMD_BOOT_URL"
8+
mkosi-chroot dpkg -i /systemd-boot.deb
9+
rm -f "$TEMP_DEB"

bob/mkosi.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ make_git_package \
2929
# Build ssh-pubkey-server
3030
make_git_package \
3131
"ssh-pubkey-server" \
32-
"second-key" \
32+
"multi-key" \
3333
"https://github.com/flashbots/ssh-pubkey-server" \
3434
'go build -trimpath -ldflags "-s -w -buildid= -X github.com/flashbots/go-template/common.Version=v1.0.0" -o ./build/ssh-pubkey-server cmd/httpserver/main.go' \
3535
"build/ssh-pubkey-server:/usr/bin/ssh-pubkey-server"

bob/mkosi.extra/etc/systemd/system/ssh-pubkey-server.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Requires=searcher-container.service
55

66
[Service]
77
Type=simple
8-
ExecStart=/usr/bin/ssh-pubkey-server --listen-addr=127.0.0.1:5001 --container-ssh-pubkey-file /etc/searcher/ssh_hostkey/host_key.pub --host-ssh-pubkey-file /etc/dropbear/dropbear_ed25519_host_key.pub
8+
ExecStart=/usr/bin/ssh-pubkey-server --listen-addr=127.0.0.1:5001 --ssh-pubkey-file=/etc/searcher/ssh_hostkey/host_key.pub --ssh-pubkey-file=/etc/dropbear/dropbear_ed25519_host_key.pub
99
Restart=always
1010
RestartSec=5
1111

bob/mkosi.postinst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ mkdir "$BUILDROOT/etc/dropbear"
2828
mkdir "$BUILDROOT/etc/systemd/system/minimal.target.wants"
2929
for service in \
3030
network-setup.service \
31-
azure-complete-provisioning.service \
3231
openntpd.service \
3332
logrotate.service \
3433
searcher-log-reader.service \

0 commit comments

Comments
 (0)