Skip to content

Instantly share code, notes, and snippets.

@bademux
Created September 28, 2025 17:36
Show Gist options
  • Select an option

  • Save bademux/a890a5c49e117cfa018ee80dedf4e559 to your computer and use it in GitHub Desktop.

Select an option

Save bademux/a890a5c49e117cfa018ee80dedf4e559 to your computer and use it in GitHub Desktop.
build Openwrt
# run with `docker build --progress=plain -f buildopenwrt.Dockerfile --output type=tar,dest=out.tar .`
FROM debian:13-slim AS builder
# revision (tag or commitId) can be obtained with `source /etc/openwrt_release && echo $DISTRIB_REVISION`
ARG REV="e74cd41744df015e770ed533d0be8e5b1f03765e"
RUN apt update && apt install -y --no-install-recommends git ca-certificates build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext libncurses5-dev libssl-dev python3-setuptools rsync swig unzip zlib1g-dev file wget
RUN useradd --system user
USER user
WORKDIR /home/user
RUN git init && git remote add origin https://github.com/openwrt/openwrt.git && \
git fetch origin --depth=1 $REV && \
git reset --hard FETCH_HEAD
RUN ./scripts/feeds update -a && ./scripts/feeds install -a
RUN cat <<EOF > .config
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
CONFIG_TARGET_x86_64_DEVICE_generic=y
CONFIG_ALL_KMODS=y
CONFIG_HSA_AMD=y
EOF
RUN make defconfig
RUN make -j$(nproc) download
RUN make -j$(nproc) V=s IGNORE_ERRORS=1 KERNEL_CONFIG_MODE=oldconfig
FROM scratch AS export-stage
COPY --from=builder /home/user/bin/targets/x86/64/packages/kmod-drm-amdgpu*.apk /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment