Skip to content

Commit

Permalink
feat: add xgenext2fs to image
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolitzer committed Nov 30, 2023
1 parent 6ca34e5 commit 77ceccc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Docker
on: [push]
env:
KERNEL_VERSION: 6.5.9-ctsi-1
GENEXT2FS_VERSION: 1.15.3
jobs:
build:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -62,6 +63,7 @@ jobs:
push: true
build-args: |
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
GENEXT2FS_VERSION=${{ env.GENEXT2FS_VERSION }}
TOOLCHAIN_CONFIG=configs/ct-ng-config${{ matrix.config }}
project: ${{ vars.DEPOT_PROJECT }}
token: ${{ secrets.DEPOT_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for Linux/ARM64 images
- Added support fot the GitHub registry
- Added support for building multiple toolchains (RV64G and RV64IMA)
- Added xgenext2fs to image

### Changed
- Changed base image from Ubuntu 22.04 to Debian Bookworm
Expand Down
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,39 @@ FROM debian:bookworm-20231120 as ct-ng-builder
LABEL maintainer="Machine Reference Unit <https://discord.com/channels/600597137524391947/1107965671976992878>"

ARG KERNEL_VERSION # define on makefile or CI
ARG GENEXT2FS_VERSION # define on makefile or CI
ARG TOOLCHAIN_CONFIG=configs/ct-ng-config
ARG TARGETARCH

ENV DEBIAN_FRONTEND=noninteractive

ENV BASE "/opt/riscv"

ENV BUILD_BASE "/tmp/build"



RUN \
apt-get update && \
apt-get install --no-install-recommends -y \
build-essential autoconf automake libtool libtool-bin autotools-dev \
git make pkg-config patchutils gawk bison flex ca-certificates gnupg \
device-tree-compiler libmpc-dev libmpfr-dev libgmp-dev rsync cpio \
libusb-1.0-0-dev texinfo gperf bc zlib1g-dev libncurses-dev genext2fs \
libusb-1.0-0-dev texinfo gperf bc zlib1g-dev libncurses-dev \
wget vim wget curl zip unzip libexpat-dev python3 help2man && \
rm -rf /var/lib/apt/lists/*

RUN \
wget -O /tmp/xgenext2fs.deb https://github.com/cartesi/genext2fs/releases/download/v${GENEXT2FS_VERSION}/xgenext2fs_${TARGETARCH}.deb && \
case ${TARGETARCH} in \
amd64) echo "f34bc34253209f6c024b97723eac7573eccb7ab62034d3d99e60df438c3458a5 /tmp/xgenext2fs.deb" | sha256sum --check ;; \
arm64) echo "9e6cee8e9e9e8bb5b0c51f666b848ea7a1a97e663058dcdb37a17bde76ad221a /tmp/xgenext2fs.deb" | sha256sum --check ;; \
esac && \
apt-get update && \
apt-get install --no-install-recommends -y \
/tmp/xgenext2fs.deb && \
rm -rf /var/lib/apt/lists/*

RUN \
adduser developer -u 499 --gecos ",,," --disabled-password && \
mkdir -m 775 -p $BASE $BUILD_BASE && \
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ TOOLCHAIN_CONFIG ?= configs/ct-ng-config$(TOOLCHAIN_SUFFIX)
CONTAINER_BASE := /opt/cartesi/toolchain$(TOOLCHAIN_SUFFIX)
KERNEL_VERSION ?= 6.5.9-ctsi-1
KERNEL_SRCPATH := linux-$(KERNEL_VERSION).tar.gz
GENEXT2FS_VERSION ?= 1.15.3

BUILD_ARGS = --build-arg TOOLCHAIN_CONFIG=$(TOOLCHAIN_CONFIG) \
--build-arg KERNEL_VERSION=$(KERNEL_VERSION)
--build-arg KERNEL_VERSION=$(KERNEL_VERSION) \
--build-arg GENEXT2FS_VERSION=$(GENEXT2FS_VERSION)

build: checksum
docker build -t cartesi/toolchain:${TOOLCHAIN_TAG} $(BUILD_ARGS) .
Expand Down

0 comments on commit 77ceccc

Please sign in to comment.