Skip to content

Commit 182b778

Browse files
authored
chore: 适配dadk 0.1.11 (DragonOS-Community#777)
* chore: 适配dadk 0.1.11
1 parent dd8e74e commit 182b778

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+138
-50
lines changed

.github/actions/import-toolchain/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
uses: actions/cache@v3
2424
env:
2525
cache-name: cache-build-tools
26-
dadk_version: 0.1.6
26+
dadk_version: 0.1.11
2727
with:
2828
path: |
2929
~/.cargo

.github/workflows/cache-toolchain.yml

+8-12
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/cache@v3
3535
env:
3636
cache-name: cache-build-tools
37-
dadk_version: 0.1.6
37+
dadk_version: 0.1.11
3838
with:
3939
path: |
4040
~/.cargo
@@ -78,18 +78,14 @@ jobs:
7878
7979
rustup default nightly
8080
81-
cargo install dadk --version 0.1.6
81+
cargo install dadk --version 0.1.11
8282
8383
84-
fork_toolchain_from="nightly-2023-08-15-x86_64-unknown-linux-gnu"
85-
custom_toolchain="nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu"
86-
custom_toolchain_dir="$(dirname $(rustc --print sysroot))/${custom_toolchain}"
87-
echo "Custom toolchain does not exist, creating..."
88-
rustup toolchain install ${fork_toolchain_from}
89-
rustup component add --toolchain ${fork_toolchain_from} rust-src
90-
rustup target add --toolchain ${fork_toolchain_from} x86_64-unknown-linux-musl
91-
cp -r $(dirname $(rustc --print sysroot))/${fork_toolchain_from} ${custom_toolchain_dir}
92-
self_contained_dir=${custom_toolchain_dir}/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained
93-
cp -f ${self_contained_dir}/crt1.o ${self_contained_dir}/rcrt1.o
84+
userapp_musl_toolchain="nightly-2023-08-15-x86_64-unknown-linux-gnu"
85+
86+
rustup toolchain install ${userapp_musl_toolchain}
87+
rustup component add --toolchain ${userapp_musl_toolchain} rust-src
88+
rustup target add --toolchain ${userapp_musl_toolchain} x86_64-unknown-linux-musl
89+
9490
9591

docs/introduction/build_system.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ make clean
276276
# 下载DragonStub
277277
git submodule update --init --recursive --force
278278

279-
make kernel -j $(nproc) && make write_diskimage && make qemu
279+
make run
280280
```
281281

282282
请注意,由于是在控制台运行qemu,当你想要退出的时候,输入`Ctrl+A`然后按`X`即可。

docs/userland/appdev/rust-quick-start.md

-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ cargo generate --git https://git.mirrors.dragonos.org/DragonOS-Community/Rust-Ap
3939
如果您需要移植别的库/程序到DragonOS,请参考模板内的配置。
4040

4141
由于DragonOS目前不支持动态链接,因此目前需要在RUSTFLAGS里面指定`-C target-feature=+crt-static -C link-arg=-no-pie`
42-
并且需要使用上文提到的工具链`nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu`

user/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(GARBAGE_PATTERNS)))
77

88
DADK_VERSION=$(shell dadk -V | awk 'END {print $$2}')
99
# 最小的DADK版本
10-
MIN_DADK_VERSION = 0.1.10
10+
MIN_DADK_VERSION = 0.1.11
1111
DADK_CACHE_DIR = $(ROOT_PATH)/bin/dadk_cache
1212

1313
ECHO:

user/apps/riscv_init/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ifeq ($(ARCH), x86_64)
2+
CROSS_COMPILE=x86_64-linux-musl-
3+
else ifeq ($(ARCH), riscv64)
4+
CROSS_COMPILE=riscv64-linux-musl-
5+
endif
6+
7+
CC=$(CROSS_COMPILE)gcc
8+
9+
.PHONY: all
10+
all: main.c
11+
$(CC) -static -o init main.c
12+
13+
.PHONY: install clean
14+
install: all
15+
mv init $(DADK_CURRENT_BUILD_DIR)/init
16+
17+
clean:
18+
rm init *.o
19+
20+
fmt:

user/apps/riscv_init/main.c

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <stdio.h>
2+
3+
int main() {
4+
while(1){
5+
printf("\033[43;37mHello, World!\033[0m\n");
6+
sleep(1);
7+
}
8+
return 0;
9+
}

user/apps/test-blockcache/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The toolchain we use.
22
# You can get it by running DragonOS' `tools/bootstrap.sh`
3-
TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu"
3+
TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux-gnu"
44
RUSTFLAGS+="-C target-feature=+crt-static -C link-arg=-no-pie"
55

66
# 如果是在dadk中编译,那么安装到dadk的安装目录中

user/dadk/config/about.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"clean": {
2121
"clean_command": "make clean"
2222
},
23-
"envs": []
23+
"envs": [],
24+
"target_arch": ["x86_64"]
2425
}

user/dadk/config/clear-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"install": {
2020
"in_dragonos_path": "/"
21-
}
21+
},
22+
"target_arch": ["x86_64"]
2223
}

user/dadk/config/core_utils-9.4.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222

2323
"build_once": true,
2424

25-
"install_once": true
25+
"install_once": true,
26+
"target_arch": ["x86_64"]
2627
}

user/dadk/config/dmesg-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/dog_0_1_0.dadk

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
"clean": {
2323
"clean_command": "make clean"
2424
},
25-
"envs": [],
25+
"envs": [
26+
{
27+
"key": "CC",
28+
"value": "x86_64-linux-musl-gcc"
29+
}
30+
],
2631
"build_once": false,
27-
"install_once": false
32+
"install_once": false,
33+
"target_arch": ["x86_64"]
2834
}

user/dadk/config/dragon_reach-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
},
2020
"install": {
2121
"in_dragonos_path": "/"
22-
}
22+
},
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/held-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
},
2020
"install": {
2121
"in_dragonos_path": "/"
22-
}
22+
},
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/http_server-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/musl_1_2_4.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
"envs": [],
2424
"build_once": true,
2525

26-
"install_once": true
26+
"install_once": true,
27+
"target_arch": ["x86_64"]
2728
}

user/dadk/config/nova_shell-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
},
2020
"install": {
2121
"in_dragonos_path": "/"
22-
}
22+
},
23+
"target_arch": ["x86_64"]
2324
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "riscv_init",
3+
"version": "0.1.0",
4+
"description": "临时的riscv下的初始化程序",
5+
"rust_target": null,
6+
"task_type": {
7+
"BuildFromSource": {
8+
"Local": {
9+
"path": "apps/riscv_init"
10+
}
11+
}
12+
},
13+
"depends": [],
14+
"build": {
15+
"build_command": "make install"
16+
},
17+
"install": {
18+
"in_dragonos_path": "/bin"
19+
},
20+
"clean": {
21+
"clean_command": "make clean"
22+
},
23+
"envs": [],
24+
"build_once": false,
25+
"install_once": false,
26+
"target_arch": ["riscv64"]
27+
}

user/dadk/config/tar_1_35.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"clean": {
2121
"clean_command": null
2222
},
23-
"envs": []
23+
"envs": [],
24+
"target_arch": ["x86_64"]
2425
}

user/dadk/config/test_alarm_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
},
2323
"envs": [],
2424
"build_once": false,
25-
"install_once": false
25+
"install_once": false,
26+
"target_arch": ["x86_64"]
2627
}

user/dadk/config/test_backlog_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
},
2323
"envs": [],
2424
"build_once": false,
25-
"install_once": false
25+
"install_once": false,
26+
"target_arch": ["x86_64"]
2627
}

user/dadk/config/test_bind-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_blockcache_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"clean": {
2121
"clean_command": "make clean"
2222
},
23-
"envs": []
23+
"envs": [],
24+
"target_arch": ["x86_64"]
2425
}

user/dadk/config/test_dup3_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"clean": {
2020
"clean_command": "make clean"
21-
}
21+
},
22+
"target_arch": ["x86_64"]
2223
}

user/dadk/config/test_for_robustfutex_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"clean": {
2121
"clean_command": "make clean"
2222
},
23-
"envs": []
23+
"envs": [],
24+
"target_arch": ["x86_64"]
2425
}

user/dadk/config/test_fstat-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"clean": {
2020
"clean_command": "make clean"
21-
}
21+
},
22+
"target_arch": ["x86_64"]
2223
}

user/dadk/config/test_fstatfs_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
},
2323
"envs": [],
2424
"build_once": false,
25-
"install_once": false
25+
"install_once": false,
26+
"target_arch": ["x86_64"]
2627
}

user/dadk/config/test_gettimeofday-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_kvm_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"clean": {
2121
"clean_command": "make clean"
2222
},
23-
"envs": []
23+
"envs": [],
24+
"target_arch": ["x86_64"]
2425
}

user/dadk/config/test_mkfifo-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"clean": {
2020
"clean_command": "make clean"
21-
}
21+
},
22+
"target_arch": ["x86_64"]
2223
}

user/dadk/config/test_mount_1_0_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"clean": {
2020
"clean_command": "make clean"
21-
}
21+
},
22+
"target_arch": ["x86_64"]
2223
}

user/dadk/config/test_pty-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_ramfs-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_shm-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_signal-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_socket-0.1.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"install": {
2020
"in_dragonos_path": "/"
21-
}
21+
},
22+
"target_arch": ["x86_64"]
2223
}

user/dadk/config/test_sqlite3-3.42.0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"clean": {
2020
"clean_command": "make clean"
2121
},
22-
"envs": []
22+
"envs": [],
23+
"target_arch": ["x86_64"]
2324
}

user/dadk/config/test_statfs_0_1_0.dadk

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
},
2323
"envs": [],
2424
"build_once": false,
25-
"install_once": false
25+
"install_once": false,
26+
"target_arch": ["x86_64"]
2627
}

0 commit comments

Comments
 (0)