Skip to content

Commit

Permalink
FPGA CI: Fix NTP clock sync, panic-after-softlock, and systemd init o…
Browse files Browse the repository at this point in the history
…rder (#1277)

* fpga-image: Use softlock_panic sysctl correctly.

Previously, we were setting this as if it was a timeout value, but it's
actually just a boolean.

See
https://www.infradead.org/~mchehab/kernel_docs/admin-guide/sysctl/kernel.html#softlockup-panic

* fpga-image: Run startup script after everything else.

Before this change, systemd hadn't fully initialized when the startup
script was run (as it was blocking continued startup).

* fpga-image: Synchronize clock via NTP.

GitHub rejects runners with a local clock that varies by more than 15
minutes. Unfortunately, the RTC on the zcu104 boards is terrible,
drifting more than 30 seconds a day.
  • Loading branch information
korran authored Jan 18, 2024
1 parent e7d8de2 commit 73a4c1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ci-tools/fpga-image/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
if [[ -z "${SKIP_DEBOOTSTRAP}" ]]; then
(rm -rf out/rootfs || true)
mkdir -p out/rootfs
debootstrap --include git,curl,ca-certificates,locales,libicu72,sudo,vmtouch,fping,rdnssd --arch arm64 --foreign bookworm out/rootfs
debootstrap --include git,curl,ca-certificates,locales,libicu72,sudo,vmtouch,fping,rdnssd,dbus,systemd-timesyncd --arch arm64 --foreign bookworm out/rootfs
chroot out/rootfs /debootstrap/debootstrap --second-stage
chroot out/rootfs useradd runner --shell /bin/bash --create-home

Expand All @@ -42,8 +42,10 @@ if [[ -z "${SKIP_DEBOOTSTRAP}" ]]; then
chroot out/rootfs bash -c 'echo iface end0 inet6 auto >> /etc/network/interfaces'
chroot out/rootfs bash -c 'echo nameserver 2001:4860:4860::6464 > /etc/resolv.conf'
chroot out/rootfs bash -c 'echo nameserver 2001:4860:4860::64 >> /etc/resolv.conf'
chroot out/rootfs bash -c 'echo kernel.softlockup_panic = 60 >> /etc/sysctl.conf'
chroot out/rootfs bash -c 'echo kernel.softlockup_panic = 1 >> /etc/sysctl.conf'
chroot out/rootfs bash -c 'echo kernel.sysrq = 1 >> /etc/sysctl.conf'
chroot out/rootfs bash -c 'echo "[Time]" > /etc/systemd/timesyncd.conf'
chroot out/rootfs bash -c 'echo "NTP=time.google.com" >> /etc/systemd/timesyncd.conf'

# Comment this line out if you don't trust folks with physical access to the
# uart
Expand Down
3 changes: 2 additions & 1 deletion ci-tools/fpga-image/startup-script.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Wants=network-online.target
Conflicts=serial-getty@ttyPS0.service

[Service]
Type=oneshot
Type=idle
Restart=no
StandardInput=tty-force
StandardOutput=tty-force
StandardError=tty-force
Expand Down

0 comments on commit 73a4c1e

Please sign in to comment.