@@ -33,6 +33,10 @@ _exit_trap() {
3333 local status=$?
3434 set +o errexit
3535
36+ # Restore the override opteadm from /tmp before debug-evidence
37+ # collection runs, in case anything earlier in this trap or any
38+ # downstream tooling has overwritten the installed binary. The
39+ # /tmp copy is saved by the OPTE_COMMIT install block below.
3640 if [[ " x$OPTE_COMMIT " != " x" ]]; then
3741 pfexec cp /tmp/opteadm /opt/oxide/opte/bin/opteadm
3842 fi
@@ -134,19 +138,6 @@ z_swadm () {
134138 pfexec zlogin oxz_switch /opt/oxide/dendrite/bin/swadm $@
135139}
136140
137- # only set this if you want to override the version of opte/xde installed by the
138- # install_opte.sh script
139- OPTE_COMMIT=" "
140- if [[ " x$OPTE_COMMIT " != " x" ]]; then
141- curl -sSfOL https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/module/$OPTE_COMMIT /xde
142- pfexec rem_drv xde || true
143- pfexec mv xde /kernel/drv/amd64/xde
144- pfexec add_drv xde || true
145- curl -sSfOL https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/release/$OPTE_COMMIT /opteadm
146- chmod +x opteadm
147- cp opteadm /tmp/opteadm
148- pfexec mv opteadm /opt/oxide/opte/bin/opteadm
149- fi
150141
151142#
152143# XXX work around 14537 (UFS should not allow directories to be unlinked) which
@@ -197,6 +188,24 @@ ptime -m tar xvzf /input/package/work/package.tar.gz
197188# shellcheck source=/dev/null
198189source .github/buildomat/ci-env.sh
199190
191+ # Source the OPTE override (if any) from the canonical location and apply it.
192+ #
193+ # When set, download the xde driver and opteadm directly from buildomat and
194+ # swap them in. The deploy target is a ramdisk image without pkg(5), so we
195+ # use rem_drv/add_drv instead of the p5p approach used by install_opte.sh
196+ # and releng.
197+ source tools/opte_version_override
198+ if [[ " x$OPTE_COMMIT " != " x" ]]; then
199+ curl -sSfOL " https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/module/$OPTE_COMMIT /xde"
200+ pfexec rem_drv xde || true
201+ pfexec mv xde /kernel/drv/amd64/xde
202+ pfexec add_drv xde || true
203+ curl -sSfOL " https://buildomat.eng.oxide.computer/public/file/oxidecomputer/opte/release/$OPTE_COMMIT /opteadm"
204+ chmod +x opteadm
205+ cp opteadm /tmp/opteadm
206+ pfexec mv opteadm /opt/oxide/opte/bin/opteadm
207+ fi
208+
200209# Ask buildomat for the range of extra addresses that we're allowed to use, and
201210# break them up into the ranges we need.
202211
0 commit comments