From 6c7f966c2f3e3ed299168fc97ae346a85cc6e322 Mon Sep 17 00:00:00 2001 From: MemoryShore <105195940+MemoryShore@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:07:30 +0800 Subject: [PATCH] =?UTF-8?q?NovaShell=E6=9B=BF=E6=8D=A2=E4=B8=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4shell=20(#456)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NovaShell替换为默认shell * delete some envvar * 自动从dragonos镜像站更新dadk * 更新github ci环境 * 修复yml格式问题 * 更新novashell到95738b235f --------- Co-authored-by: longjin --- .github/workflows/cache-toolchain.yml | 15 ++++++++++++++- kernel/src/syscall/mod.rs | 3 ++- user/Makefile | 6 +++--- user/dadk/config/dragon_reach-0.1.0.dadk | 2 +- user/dadk/config/nova_shell-0.1.0.dadk | 23 +++++++++++++++++++++++ 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 user/dadk/config/nova_shell-0.1.0.dadk diff --git a/.github/workflows/cache-toolchain.yml b/.github/workflows/cache-toolchain.yml index 18981633..40b47ca3 100644 --- a/.github/workflows/cache-toolchain.yml +++ b/.github/workflows/cache-toolchain.yml @@ -57,5 +57,18 @@ jobs: rustup component add rustfmt rustup component add rustfmt --toolchain nightly-2023-01-21-x86_64-unknown-linux-gnu rustup component add rustfmt --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu - cargo install dadk --version 0.1.2 + cargo install dadk --version 0.1.6 + + # Create custom Rust toolchain + fork_toolchain_from="nightly-2023-08-15-x86_64-unknown-linux-gnu" + custom_toolchain="nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu" + custom_toolchain_dir="$(dirname $(rustc --print sysroot))/${custom_toolchain}" + echo "Custom toolchain does not exist, creating..." + rustup toolchain install ${fork_toolchain_from} + rustup component add --toolchain ${fork_toolchain_from} rust-src + rustup target add --toolchain ${fork_toolchain_from} x86_64-unknown-linux-musl + cp -r $(dirname $(rustc --print sysroot))/${fork_toolchain_from} ${custom_toolchain_dir} + self_contained_dir=${custom_toolchain_dir}/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained + cp -f ${self_contained_dir}/crt1.o ${self_contained_dir}/rcrt1.o + diff --git a/kernel/src/syscall/mod.rs b/kernel/src/syscall/mod.rs index 00ea010d..cc1891fe 100644 --- a/kernel/src/syscall/mod.rs +++ b/kernel/src/syscall/mod.rs @@ -1114,7 +1114,8 @@ impl Syscall { } SYS_MADVISE => { - kwarn!("SYS_MADVISE has not yet been implemented"); + // 这个太吵了,总是打印,先注释掉 + // kwarn!("SYS_MADVISE has not yet been implemented"); Ok(0) } SYS_GETTID => Self::gettid().map(|tid| tid.into()), diff --git a/user/Makefile b/user/Makefile index f11ae341..8f6ee75d 100644 --- a/user/Makefile +++ b/user/Makefile @@ -14,7 +14,7 @@ current_CFLAGS := $(CFLAGS) DADK_VERSION=$(shell dadk -V | awk 'END {print $$2}') # 最小的DADK版本 -MIN_DADK_VERSION = 0.1.5 +MIN_DADK_VERSION = 0.1.6 DADK_CACHE_DIR = $(ROOT_PATH)/bin/dadk_cache # 旧版的libc安装路径 @@ -32,7 +32,7 @@ ifeq ("$(DADK_VERSION)", "") @echo "\nYou can install dadk by running the following command:" @echo "\n\tcargo install dadk" @echo "\nOr you can install dadk from source by running the following command:" - @echo "\n\tcargo install --git https://github.com/DragonOS-Community/DADK.git" + @echo "\n\tcargo install --git https://git.mirrors.dragonos.org.cn/DragonOS-Community/DADK.git --tag v$(MIN_DADK_VERSION)" @echo "\n" @echo "Auto installing dadk..." CC=gcc AS=as AR=ar LD=ld OBJCOPY=objcopy NM=nm cargo install dadk @@ -43,7 +43,7 @@ else ifneq ($(shell printf '%s\n%s' "$(DADK_VERSION)" "$(MIN_DADK_VERSION)" | sort -V | head -n1), $(MIN_DADK_VERSION)) @echo "dadk version is too low, please update to $(MIN_DADK_VERSION) or higher version" @echo "Updating dadk..." - CC=gcc AS=as AR=ar LD=ld OBJCOPY=objcopy NM=nm cargo install dadk || (echo "dadk update failed" && exit 1) + CC=gcc AS=as AR=ar LD=ld OBJCOPY=objcopy NM=nm cargo install --git https://git.mirrors.dragonos.org.cn/DragonOS-Community/DADK.git --tag v$(MIN_DADK_VERSION) || (echo "dadk update failed" && exit 1) @echo "dadk updated" endif endif diff --git a/user/dadk/config/dragon_reach-0.1.0.dadk b/user/dadk/config/dragon_reach-0.1.0.dadk index 9d35a9c6..bcfb3e51 100644 --- a/user/dadk/config/dragon_reach-0.1.0.dadk +++ b/user/dadk/config/dragon_reach-0.1.0.dadk @@ -6,7 +6,7 @@ "BuildFromSource": { "Git": { "url" : "https://git.mirrors.dragonos.org/DragonOS-Community/DragonReach.git", - "revision": "d70ac4ed6b" + "revision": "4768985ade" } } }, diff --git a/user/dadk/config/nova_shell-0.1.0.dadk b/user/dadk/config/nova_shell-0.1.0.dadk new file mode 100644 index 00000000..f1d79db5 --- /dev/null +++ b/user/dadk/config/nova_shell-0.1.0.dadk @@ -0,0 +1,23 @@ +{ + "name": "NovaShell", + "version": "0.1.0", + "description": "NovaShell程序", + "task_type": { + "BuildFromSource": { + "Git": { + "url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git", + "revision": "95738b235f" + } + } + }, + "depends": [], + "build": { + "build_command": "make install" + }, + "clean": { + "clean_command": "make clean" + }, + "install": { + "in_dragonos_path": "/" + } +}