control agent can now uboot commands

This commit is contained in:
2026-04-04 20:19:25 +08:00
parent 4f490ab37e
commit 517cc2e01d
19 changed files with 579 additions and 69 deletions

View File

@@ -0,0 +1,15 @@
FROM alpine:latest AS cacerts
FROM scratch
ARG VERSION
ENV VERSION=${VERSION}
WORKDIR /
COPY bin/ctl-linux-aarch64-${VERSION} ./ctl
COPY out/fw_printenv ./
COPY out/fw_setenv ./
COPY --from=cacerts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/ctl"]
CMD ["agent"]

View File

@@ -0,0 +1,41 @@
FROM alpine:3.22 AS build
RUN apk add --no-cache \
build-base \
bison \
flex \
linux-headers \
file \
binutils \
tar
WORKDIR /src
ARG UBOOT_TAR
ARG UBOOT_VERSION
COPY ${UBOOT_TAR} /tmp/
RUN tar zxf "/tmp/$(basename "${UBOOT_TAR}")"
RUN make tools-only_defconfig
# Build the env tools using the supported target.
RUN make -j"$(nproc)" \
HOSTCC=gcc \
HOSTLD=gcc \
HOSTCFLAGS='-O2' \
HOSTLDFLAGS='-static' \
envtools
# fw_setenv is the same program; create the link ourselves.
RUN ln -sf fw_printenv tools/env/fw_setenv
RUN file tools/env/fw_printenv tools/env/fw_setenv
RUN readelf -d tools/env/fw_printenv || true
RUN ! readelf -d tools/env/fw_printenv | grep -q '(NEEDED)'
FROM scratch AS export
COPY --from=build /src/tools/env/fw_printenv /fw_printenv
COPY --from=build /src/tools/env/fw_setenv /fw_setenv