Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/debian cross #43

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.20.0] - 2024-02-16
### Changed
- Update Linux Kernel to v6.5.9-ctsi-2 (rollup & yield replaced by cmio)
- Replace cartesi/toolchain by debian cross compiler

## [0.19.1] - 2023-12-05
### Fix
Expand Down Expand Up @@ -109,8 +113,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [0.2.0]
- [0.1.0]

[Unreleased]: https://github.com/cartesi/image-kernel/compare/v0.19.1...HEAD
[0.19.1]: https://github.com/cartesi/image-kernel/compare/v0.19.1
[Unreleased]: https://github.com/cartesi/image-kernel/compare/v0.20.0...HEAD
[0.20.0]: https://github.com/cartesi/image-kernel/compare/v0.20.0
[0.19.1]: https://github.com/cartesi/image-kernel/releases/tag/v0.19.1
[0.19.0]: https://github.com/cartesi/image-kernel/releases/tag/v0.19.0
[0.18.0]: https://github.com/cartesi/image-kernel/releases/tag/v0.18.0
[0.17.0]: https://github.com/cartesi/image-kernel/releases/tag/v0.17.0
Expand Down
39 changes: 35 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,51 @@
# limitations under the License.
#

ARG TOOLCHAIN_REPOSITORY=cartesi/toolchain
ARG TOOLCHAIN_VERSION=latest
FROM ${TOOLCHAIN_REPOSITORY}:${TOOLCHAIN_VERSION}
FROM debian:bookworm

ARG KERNEL_VERSION=0.0.0-ctsi-y
ARG KERNEL_TIMESTAMP="Thu, 01 Jan 1970 00:00:00 +0000"
ARG OPENSBI_VERSION=0.0.0-ctsi-y
ARG TARGETARCH

ENV DEBIAN_FRONTEND=noninteractive

ENV OLDPATH=$PATH

ENV BASE=/opt/riscv
ENV BUILD_BASE=$BASE/kernel

# install dependencies
# ------------------------------------------------------------------------------
RUN apt-get update && \
apt-get install --no-install-recommends -y \
bc \
bison \
build-essential \
ca-certificates \
flex \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross \
make \
python3 \
rsync \
wget

RUN \
wget -O /tmp/xgenext2fs.deb https://github.com/cartesi/genext2fs/releases/download/v1.5.3/xgenext2fs_${TARGETARCH}.deb && \
case ${TARGETARCH} in \
amd64) echo "a5e52d86d0bf4c2f9cc38370ea762dc5aee502a86abf8520798acbebd9d7f68f /tmp/xgenext2fs.deb" | sha256sum --check ;; \
arm64) echo "54051a31a10ba5e4f472b8eeaa47c82f3d2e744991995b8ef6981b4c1ba424c2 /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/*

# setup dirs
# ------------------------------------------------------------------------------
RUN \
adduser developer -u 499 --gecos ",,," --disabled-password && \
mkdir -p ${BUILD_BASE}/artifacts && \
chown -R developer:developer ${BUILD_BASE} && \
chmod go+w ${BUILD_BASE}
Expand All @@ -56,7 +84,10 @@ RUN tar xzf ${BUILD_BASE}/dep/opensbi-${OPENSBI_VERSION}.tar.gz \
# ------------------------------------------------------------------------------
ARG IMAGE_KERNEL_VERSION=0.0.0
COPY build.mk build.mk
RUN make -f build.mk KERNEL_TIMESTAMP="${KERNEL_TIMESTAMP}" IMAGE_KERNEL_VERSION="${IMAGE_KERNEL_VERSION}"
RUN make -f build.mk \
KERNEL_TIMESTAMP="${KERNEL_TIMESTAMP}" \
IMAGE_KERNEL_VERSION="${IMAGE_KERNEL_VERSION}" \
TOOLCHAIN_PREFIX=riscv64-linux-gnu

# deb headers
# ------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
.PHONY: all build download push run pull share copy clean checksum

MAJOR := 0
MINOR := 19
PATCH := 1
MINOR := 20
PATCH := 0
LABEL :=
IMAGE_KERNEL_VERSION?= $(MAJOR).$(MINOR).$(PATCH)$(LABEL)

Expand All @@ -30,7 +30,7 @@ TOOLCHAIN_TAG ?= 0.16.0

DEP_DIR := dep

KERNEL_VERSION ?= 6.5.9-ctsi-1
KERNEL_VERSION ?= 6.5.9-ctsi-2-output-unification-test1
KERNEL_SRCPATH := $(DEP_DIR)/linux-${KERNEL_VERSION}.tar.gz

OPENSBI_VERSION ?= 1.3.1-ctsi-1
Expand Down Expand Up @@ -120,7 +120,7 @@ $(DEP_DIR):
mkdir dep

$(KERNEL_SRCPATH): | $(DEP_DIR)
wget -O $@ https://github.com/cartesi/linux/archive/refs/tags/v$(KERNEL_VERSION).tar.gz
@wget -O $@ https://github.com/cartesi/linux/archive/v$(KERNEL_VERSION).tar.gz

$(OPENSBI_SRCPATH): | $(DEP_DIR)
wget -O $@ https://github.com/cartesi/opensbi/archive/refs/tags/v$(OPENSBI_VERSION).tar.gz
Expand Down
2 changes: 1 addition & 1 deletion shasumfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bfc4d196b90592a2a6bef83ead9e196da6ab6d5978b48ee5e8ccf02913355bc2 dep/linux-6.5.9-ctsi-1.tar.gz
7782a5012313ec2365c39590b93cab4565a0c7ea3586daa3bd0ad05b2a8fc869 dep/linux-6.5.9-ctsi-2-output-unification-test1.tar.gz
267da33a34a023d9dcff3e7d9a8d58e7caefaff65441e38ff0114e4683dff176 dep/opensbi-1.3.1-ctsi-1.tar.gz