diff --git a/.github/workflows/build-toolchain.yaml b/.github/workflows/build-toolchain.yaml new file mode 100644 index 0000000..8fc2a12 --- /dev/null +++ b/.github/workflows/build-toolchain.yaml @@ -0,0 +1,54 @@ +--- +name: Build toolchain image + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: build-toolchain-image + cancel-in-progress: true + +jobs: + build_image: + name: Build toolchain image + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to image registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/kobo-ssh-toolchain + tags: | + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=ref,event=branch + type=ref,event=tag + + - name: Build image + uses: docker/build-push-action@v6 + id: build + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b56678e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,68 @@ +FROM debian:bookworm + +# Build dependencies +RUN \ + apt-get update -y \ + && dpkg --add-architecture armhf \ + && apt-get update -y \ + && apt-get install -y \ + autoconf \ + autogen \ + automake \ + bison \ + build-essential \ + cmake \ + cross-gcc-dev \ + crossbuild-essential-armhf \ + curl \ + file \ + flex \ + g++-arm-linux-gnueabihf \ + gawk \ + gcc-arm-linux-gnueabihf \ + git \ + gperf \ + help2man \ + libglu1-mesa-dev \ + libncurses-dev \ + libtool \ + libtool-bin \ + libtool-doc \ + libx11-dev \ + libx11-dev \ + libxext-dev \ + libxinerama-dev \ + mesa-common-dev \ + nasm \ + shtool \ + texinfo \ + unzip \ + wget \ + xorg-dev + +# Pull in crosstool-ng +RUN \ + git clone https://github.com/NiLuJe/crosstool-ng /crosstool-ng-sources + +# Build crosstool-ng +WORKDIR /crosstool-ng-sources +RUN \ + ./bootstrap \ + && ./configure \ + && make \ + && make install + +# Set up a temp dir to configure crosstool in +RUN \ + mkdir -p /crosstool-cfg \ + && /crosstool-cfg \ + && mkdir -p /home/crosstooluser/src \ + && ct-ng arm-kobo-linux-gnueabihf + +# Set up a temp user for crosstool to use +RUN \ + echo "CT_EXPERIMENTAL=y\n" >> .config \ + && echo "CT_ALLOW_BUILD_AS_ROOT=y\n" >> .config \ + && echo "CT_ALLOW_BUILD_AS_ROOT_SURE=y\n" >> .config \ + && mkdir -p /root/src \ + && ct-ng build diff --git a/README.md b/README.md index 1555d88..35b5517 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # kobo-ssh Build pipeline to compile Dropbear for Kobo + +Based on the work of https://github.com/obynio/kobopatch-ssh diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7190a60 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +}