Skip to content

Commit

Permalink
fixup! fixup! Replace BBL with OpenSBI
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolitzer committed Nov 29, 2023
1 parent b3f1cf8 commit fb68385
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
31 changes: 15 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# limitations under the License.
#

.PHONY: all build download push run pull share copy clean clean-config checksum
.PHONY: all build download push run pull share copy clean checksum

MAJOR := 0
MINOR := 17
MINOR := 18
PATCH := 0
LABEL :=
IMAGE_KERNEL_VERSION?= $(MAJOR).$(MINOR).$(PATCH)$(LABEL)
Expand All @@ -27,11 +27,14 @@ UNAME:=$(shell uname)
TAG ?= devel
TOOLCHAIN_REPOSITORY ?= cartesi/toolchain
TOOLCHAIN_TAG ?= 0.15.0
KERNEL_VERSION ?= 5.15.63-ctsi-y
KERNEL_SRCPATH := dep/linux-${KERNEL_VERSION}.tar.gz
OPENSBI_VERSION ?= opensbi-1.2-ctsi-y
OPENSBI_SRCPATH := dep/opensbi-${OPENSBI_VERSION}.tar.gz
KERNEL_CONFIG ?= configs/default-linux-config

KERNEL_VERSION ?= 6.5.9
KERNEL_BRANCH ?= chore/migrate-cartesi-config
KERNEL_SRCPATH := dep/linux-$(KERNEL_VERSION).tar.gz

OPENSBI_VERSION ?= 1.3.1
OPENSBI_BRANCH ?= ports/opensbi-1.3.1
OPENSBI_SRCPATH := dep/opensbi-$(OPENSBI_VERSION).tar.gz

CONTAINER_BASE := /opt/cartesi/kernel

Expand Down Expand Up @@ -103,9 +106,6 @@ run-as-root:
-v `pwd`:$(CONTAINER_BASE) \
$(IMG) $(CONTAINER_COMMAND)

config: CONTAINER_COMMAND := $(CONTAINER_BASE)/scripts/update-linux-config
config: run-as-root

env:
@echo KERNEL_VERSION="$(KERNEL_VERSION)"
@echo IMAGE_KERNEL_VERSION="$(IMAGE_KERNEL_VERSION)"
Expand All @@ -119,9 +119,12 @@ copy:
docker rm -v $$ID

$(KERNEL_SRCPATH):
wget -O $@ https://github.com/cartesi/linux/archive/refs/heads/linux-$(KERNEL_VERSION).tar.gz
wget -O $@ https://github.com/cartesi/linux/archive/refs/heads/$(KERNEL_BRANCH).tar.gz

clean: clean-config
$(OPENSBI_SRCPATH):
wget -O $@ https://github.com/cartesi/opensbi/archive/refs/heads/$(OPENSBI_BRANCH).tar.gz

clean:
rm -f $(HEADERS) $(IMAGE) $(LINUX) $(SELFTEST)

depclean: clean
Expand All @@ -135,7 +138,3 @@ shasumfile: $(KERNEL_SRCPATH) $(OPENSBI_SRCPATH)
@shasum -a 256 $^ > $@

download: checksum

$(OPENSBI_SRCPATH): URL=https://github.com/cartesi/opensbi/archive/${OPENSBI_VERSION}.tar.gz
$(OPENSBI_SRCPATH): | dep
T=`mktemp` && wget "$(URL)" -O $$T && mv $$T $@ || rm $$T
14 changes: 8 additions & 6 deletions build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ KERNEL_VERSION ?= $(shell make -sC $(LINUX_DIR) kernelversion)
KERNEL_TIMESTAMP ?= $(shell date -Ru)
IMAGE_KERNEL_VERSION?= 0.0.0
HEADERS := artifacts/linux-headers-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).tar.xz
IMAGE := artifacts/linux-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).bin
LINUX := artifacts/linux-opensbi-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).bin
LINUX_ELF := artifacts/linux-opensbi-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).elf
IMAGE := artifacts/linux-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).bin
LINUX_ELF := artifacts/linux-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).elf
SELFTEST := artifacts/linux-selftest-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).ext2
CROSS_DEB_FILENAME := artifacts/linux-libc-dev-riscv64-cross-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).deb
NATIVE_DEB_FILENAME := artifacts/linux-libc-dev-$(KERNEL_VERSION)-v$(IMAGE_KERNEL_VERSION).deb
Expand Down Expand Up @@ -105,14 +105,16 @@ run-selftest:
# clone (for non CI environment)
# ------------------------------------------------------------------------------
clone: LINUX_BRANCH ?= linux-5.15.63-ctsi-y
clone: OPENSBI_BRANCH ?= opensbi-1.2-ctsi-y
clone: OPENSBI_BRANCH ?= ports/opensbi-1.3.1
clone:
git clone --depth 1 --branch $(LINUX_BRANCH) \
[email protected]:cartesi/linux.git $(LINUX_DIR) || \
cd $(LINUX_DIR) && git pull
git clone --depth 1 --branch $(OPENSBI_BRANCH) \
cd $(LINUX_DIR) && git pull || \
true
git clone --branch $(OPENSBI_BRANCH) \
[email protected]:cartesi/opensbi.git $(OPENSBI_DIR) || \
cd $(OPENSBI_DIR) && git pull
cd $(OPENSBI_DIR) && git pull || \
true

run: IMG=cartesi/toolchain:devel
run:
Expand Down
4 changes: 2 additions & 2 deletions shasumfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ba052ec5118d21b0bbea3bdcd866a81b3b68029f69464074ca26f0cda4447bb9 dep/linux-5.15.63-ctsi-y.tar.gz
dad6cc6b0efeb3fd34d80199279dbaf7217c2f2179a5fdb639c3829e62f6b44a dep/opensbi-opensbi-1.2-ctsi-y.tar.gz
7d8655bc907ca1a11a574cd5298c8128356f1f880e67bcac3903184fe1842c03 dep/linux-6.5.9.tar.gz
8612991208442ba95a216d7fec30e70f901e1305ab321b6e828c977f83b9a497 dep/opensbi-1.3.1.tar.gz

0 comments on commit fb68385

Please sign in to comment.