mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 16:26:31 +00:00
chore: Bump dadk to 0.2.0 (#1058)
# 概述 把dadk版本升级到0.2.0 dadk 0.2.0能够提升编译速度,并且支持使用dadk对内核进行profiling。 新版dadk的文档: https://docs.dragonos.org.cn/p/dadk/ # 注意 这是一个breaking change,升级后,将无法使用dadk 0.2.0去编译旧的项目。如有需要,请手动降级到dadk 0.1.11: ```shell cargo install --git https://git.mirrors.dragonos.org.cn/DragonOS-Community/DADK --tag v0.1.11 ``` # 更改列表 * chore: 把管理用户程序编译的dadk配置文件改为新格式的 * feat: 使用新版dadk来创建\挂载\卸载磁盘镜像 * chore: bump dadk min version to 0.2.0 * chore: fix ci * chore: 更新github ci镜像到1.7 * doc: 添加文档 --------- Co-Authored-by: xuzihao <xuzihao@dragonos.org> Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
@ -13,3 +13,6 @@ musl-gcc -static -o hello hello.c
|
||||
|
||||
在移植现有程序时,可能需要配置`CFLAGS`和`LDFLAGS`,以及`CPPFLAGS`,以便正确地编译,具体请以实际为准。
|
||||
|
||||
## 配置dadk
|
||||
|
||||
请参考:[Quick Start | DADK](https://docs.dragonos.org.cn/p/dadk/user-manual/quickstart.html)
|
@ -8,4 +8,5 @@
|
||||
|
||||
rust-quick-start
|
||||
c-cpp-quick-start
|
||||
DADK文档 <https://docs.dragonos.org.cn/p/dadk/>
|
||||
快速使用DADK打包一个应用到DragonOS <https://docs.dragonos.org.cn/p/dadk/user-manual/quickstart.html>
|
||||
DADK完整文档 <https://docs.dragonos.org.cn/p/dadk/>
|
||||
|
@ -2,19 +2,14 @@
|
||||
|
||||
## 编译环境
|
||||
|
||||
  DragonOS与Linux具有部分二进制兼容性,因此可以使用Linux的Rust编译器进行编译,但是需要进行一些配置:
|
||||
|
||||
您可以参考DragonOS的`tools/bootstrap.sh`中,`initialize_userland_musl_toolchain()`函数的实现,进行配置。
|
||||
或者,只要运行一下bootstrap.sh就可以了。
|
||||
|
||||
主要是因为DragonOS还不支持动态链接,但是默认的工具链里面,包含了动态链接解释器相关的代码,因此像脚本内那样,进行替换就能运行。
|
||||
  DragonOS与Linux具有部分二进制兼容性,因此可以使用Linux的Rust编译器进行编译。
|
||||
|
||||
## 配置项目
|
||||
|
||||
### 从模板创建
|
||||
|
||||
:::{note}
|
||||
该功能需要dadk 0.1.4及以上版本方能支持
|
||||
该功能需要dadk 0.2.0及以上版本方能支持。旧版的请参考历史版本的DragonOS文档。
|
||||
:::
|
||||
|
||||
1. 使用DragonOS的tools目录下的`bootstrap.sh`脚本初始化环境
|
||||
@ -30,7 +25,7 @@ cargo generate --git https://git.mirrors.dragonos.org/DragonOS-Community/Rust-Ap
|
||||
```
|
||||
|
||||
4. 使用`cargo run`来运行项目
|
||||
5. 在DragonOS的`user/dadk/config`目录下,使用`dadk new`命令,创建编译配置,安装到DragonOS的`/`目录下。
|
||||
5. 在DragonOS的`user/dadk/config`目录下,参考模版[userapp_config.toml](https://github.com/DragonOS-Community/DADK/blob/main/dadk-config/templates/config/userapp_config.toml),创建编译配置,安装到DragonOS的`/`目录下。
|
||||
(在dadk的编译命令选项处,请使用Makefile里面的`make install`配置进行编译、安装)
|
||||
6. 编译DragonOS即可安装
|
||||
|
||||
|
Reference in New Issue
Block a user