Skip to content

Commit

Permalink
2024S: build offline
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf2019 committed Feb 25, 2024
1 parent b80d52a commit 1733719
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

4 changes: 3 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ test-code-job:
script:
- git clone https://github.com/LearningOS/rCore-Tutorial-Checker-2024S.git ci-user
- git clone https://github.com/LearningOS/rCore-Tutorial-Test-2024S.git ci-user/user
- cd ci-user && make test CHAPTER=`echo $CI_COMMIT_REF_NAME | grep -oP 'ch\K[0-9]'` passwd=$BASE_TEST_TOKEN
- cp -r $HOME/os-vendor os/vendor
- cp -r $HOME/user-vendor ci-user/user/vendor
- cd ci-user && make test CHAPTER=`echo $CI_COMMIT_REF_NAME | grep -oP 'ch\K[0-9]'` passwd=$BASE_TEST_TOKEN OFFLINE=1
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,18 @@ RUN rustup --version && \
cargo --version && \
rustc --version

# 2.3 Env
RUN cargo install cargo-binutils; \
rustup target add riscv64gc-unknown-none-elf; \
rustup component add rust-src; \
rustup component add llvm-tools-preview; \
rustup component add rustfmt; \
rustup component add clippy;

# 3. Cargo vendor
WORKDIR ${HOME}
COPY os/vendor ./os-vendor
COPY user/vendor ./user-vendor

# Ready to go
WORKDIR ${HOME}
3 changes: 3 additions & 0 deletions os/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ MODE := release
KERNEL_ELF := target/$(TARGET)/$(MODE)/os
KERNEL_BIN := $(KERNEL_ELF).bin
DISASM_TMP := target/$(TARGET)/$(MODE)/asm
OFFLINE :=

# BOARD
BOARD := qemu
Expand Down Expand Up @@ -32,10 +33,12 @@ DISASM ?= -x
build: env $(KERNEL_BIN)

env:
ifeq ($(OFFLINE),)
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils
rustup component add rust-src
rustup component add llvm-tools-preview
endif

$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@
Expand Down

0 comments on commit 1733719

Please sign in to comment.