Skip to content

Commit

Permalink
feat: add xgenext2fs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Politzer committed Nov 30, 2023
1 parent 6ca34e5 commit d050ae4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 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 @@ -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
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ 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"

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 && \
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
1 change: 1 addition & 0 deletions shasumfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bfc4d196b90592a2a6bef83ead9e196da6ab6d5978b48ee5e8ccf02913355bc2 linux-6.5.9-ctsi-1.tar.gz
f34bc34253209f6c024b97723eac7573eccb7ab62034d3d99e60df438c3458a5 xgenext2fs_amd64.deb

0 comments on commit d050ae4

Please sign in to comment.