From 6e9245d8585e40b57fdddcb8253c75512299d80a Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Thu, 26 Dec 2024 01:27:07 +0800 Subject: [PATCH] Add make defconfig & oldconfig, cache AX_ROOT --- .github/workflows/build.yml | 13 ++++++++++--- .gitignore | 2 ++ Makefile | 10 ++++++---- scripts/get_deps.sh | 3 --- scripts/set_ax_root.sh | 3 +++ 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20ac70b..0cb4369 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,12 +148,19 @@ jobs: - name: Build c/redis for x86_64-pc-oslab run: make PLATFORM=x86_64-pc-oslab A=c/redis FEATURES=driver-ixgbe,driver-ramdisk SMP=4 + - run: make PLATFORM=aarch64-raspi4 defconfig - name: Build rust/helloworld for aarch64-raspi4 - run: make PLATFORM=aarch64-raspi4 A=rust/helloworld + run: make PLATFORM=aarch64-raspi4 SMP=4 A=rust/helloworld - name: Build rust/fs/shell for aarch64-raspi4 - run: make PLATFORM=aarch64-raspi4 A=rust/fs/shell FEATURES=driver-bcm2835-sdhci + run: make PLATFORM=aarch64-raspi4 SMP=4 A=rust/fs/shell FEATURES=driver-bcm2835-sdhci BUS=mmio + + - run: make PLATFORM=aarch64-bsta1000b defconfig - name: Build rust/helloworld for aarch64-bsta1000b - run: make PLATFORM=aarch64-bsta1000b A=rust/helloworld + run: make PLATFORM=aarch64-bsta1000b SMP=8 A=rust/helloworld + + - run: make PLATFORM=aarch64-phytium-pi defconfig + - name: Build rust/helloworld for aarch64-phytium-pi + run: make PLATFORM=aarch64-phytium-pi SMP=4 A=rust/helloworld build-for-std: runs-on: ${{ matrix.os }} diff --git a/.gitignore b/.gitignore index 8d0b86a..f12e028 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /.vscode /.arceos /.cargo +/.axconfig.* +/.axroot .DS_Store Cargo.lock *.o diff --git a/Makefile b/Makefile index 118312c..c44ddd4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ A ?= rust/helloworld -AX_ROOT ?= $(PWD)/.arceos +AX_ROOT ?= $(shell cat .axroot 2>/dev/null) APP := $(A) ifeq ($(filter /%,$(A)),) @@ -8,12 +8,14 @@ ifeq ($(filter /%,$(A)),) endif endif +$(if $(V), $(info AX_ROOT: "$(AX_ROOT)")) + all: build -ax_root: +chaxroot: @./scripts/set_ax_root.sh $(AX_ROOT) -build run justrun debug disasm disk_img clean clean_c: ax_root +defconfig oldconfig build run justrun debug disasm disk_img clean clean_c: @make -C $(AX_ROOT) A=$(APP) $@ test: @@ -23,4 +25,4 @@ else @./scripts/app_test.sh endif -.PHONY: all ax_root build run justrun debug disasm disk_img clean clean_c test +.PHONY: all chaxroot defconfig oldconfig build run justrun debug disasm disk_img clean clean_c test diff --git a/scripts/get_deps.sh b/scripts/get_deps.sh index 8ee684f..2339e7f 100755 --- a/scripts/get_deps.sh +++ b/scripts/get_deps.sh @@ -5,7 +5,4 @@ AX_ROOT=.arceos test ! -d "$AX_ROOT" && echo "Cloning repositories ..." || true test ! -d "$AX_ROOT" && git clone https://github.com/arceos-org/arceos "$AX_ROOT" --depth=1 || true -echo "Copying Cargo.lock ..." -cp "$AX_ROOT/Cargo.lock" Cargo.lock - $(dirname $0)/set_ax_root.sh $AX_ROOT diff --git a/scripts/set_ax_root.sh b/scripts/set_ax_root.sh index a9f65db..6ee7423 100755 --- a/scripts/set_ax_root.sh +++ b/scripts/set_ax_root.sh @@ -11,3 +11,6 @@ mkdir -p .cargo sed -e "s|%AX_ROOT%|$AX_ROOT|g" scripts/config.toml.temp > .cargo/config.toml echo "Set AX_ROOT (ArceOS directory) to $AX_ROOT" + +cp "$AX_ROOT/Cargo.lock" Cargo.lock +echo "$1" > .axroot