From d050ae42f2628289695abd7c4ac1b6df17cea7a6 Mon Sep 17 00:00:00 2001 From: Marcelo Politzer Date: Thu, 30 Nov 2023 15:57:07 -0300 Subject: [PATCH] feat: add xgenext2fs --- .github/workflows/build.yml | 2 ++ CHANGELOG.md | 1 + Dockerfile | 7 +++++-- Makefile | 17 ++++++++++++----- shasumfile | 1 + 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9de56ac..958adab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f7059..cea5732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated rustup to 1.26.0 - Updated rust to 1.74.0 - Updated debian bookworm base image +- Added xgenext2fs to the image ## [0.15.0] - 2023-08-11 ### Added diff --git a/Dockerfile b/Dockerfile index d4dd38c..e149ec0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,9 @@ FROM debian:bookworm-20231120 as ct-ng-builder LABEL maintainer="Machine Reference Unit " 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 @@ -27,15 +29,16 @@ ENV BASE "/opt/riscv" ENV BUILD_BASE "/tmp/build" +COPY xgenext2fs_${TARGETARCH}.deb /tmp/genext2fs.deb 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 /tmp/genext2fs.deb \ wget vim wget curl zip unzip libexpat-dev python3 help2man && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* \ RUN \ adduser developer -u 499 --gecos ",,," --disabled-password && \ diff --git a/Makefile b/Makefile index 6ffd371..c368363 100644 --- a/Makefile +++ b/Makefile @@ -16,18 +16,22 @@ .PHONY: build push download clean checksum +ARCH ?= amd64 TOOLCHAIN_SUFFIX ?= TOOLCHAIN_TAG ?= devel$(TOOLCHAIN_SUFFIX) 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 +GENEXT2FS_SRCPATH := xgenext2fs_amd64.deb 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) . + docker build --no-cache -t cartesi/toolchain:${TOOLCHAIN_TAG} $(BUILD_ARGS) . push: docker push cartesi/toolchain:${TOOLCHAIN_TAG} @@ -51,14 +55,17 @@ run-as-root: # fetch the public cartesi linux sources if none was provided $(KERNEL_SRCPATH): @wget -O $@ https://github.com/cartesi/linux/archive/v$(KERNEL_VERSION).tar.gz +$(GENEXT2FS_SRCPATH): + wget -O $@ https://github.com/cartesi/genext2fs/releases/download/v${GENEXT2FS_VERSION}/xgenext2fs_${ARCH}.deb -shasumfile: $(KERNEL_SRCPATH) + +shasumfile: $(KERNEL_SRCPATH) $(GENEXT2FS_SRCPATH) @shasum -a 256 $^ > $@ -checksum: $(KERNEL_SRCPATH) +checksum: $(KERNEL_SRCPATH) $(GENEXT2FS_SRCPATH) @shasum -ca 256 shasumfile download: checksum clean: - rm -f $(KERNEL_SRCPATH) + rm -f $(KERNEL_SRCPATH) $(GENEXT2FS_SRCPATH) diff --git a/shasumfile b/shasumfile index 410f06a..1a08919 100644 --- a/shasumfile +++ b/shasumfile @@ -1 +1,2 @@ bfc4d196b90592a2a6bef83ead9e196da6ab6d5978b48ee5e8ccf02913355bc2 linux-6.5.9-ctsi-1.tar.gz +f34bc34253209f6c024b97723eac7573eccb7ab62034d3d99e60df438c3458a5 xgenext2fs_amd64.deb