From 895f7d62f21ec1989f0f6d000979818a10a7fc6e Mon Sep 17 00:00:00 2001 From: weilinfox Date: Tue, 19 Mar 2024 00:40:58 +0800 Subject: [PATCH 1/5] Latest milkv duo image failed to run dynamically linked binaries --- .../developmentside/sources/coremark/index.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/zh/usedirection/developmentside/sources/coremark/index.md b/docs/zh/usedirection/developmentside/sources/coremark/index.md index b58f62aa..b9749a7d 100644 --- a/docs/zh/usedirection/developmentside/sources/coremark/index.md +++ b/docs/zh/usedirection/developmentside/sources/coremark/index.md @@ -49,3 +49,52 @@ coremark.exe: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, vers «Ruyi milkv-venv» $ ruyi-deactivate $ ``` + +## 在最新的 Milkv Duo 镜像上运行 + +传送 coremark 二进制的 Milkv Duo, Milkv Duo 的 IP 地址请按实际情况更改。 + +```bash +$ scp -O ./coremark.exe root@192.168.42.1:~ +``` + +在 Milkv Duo 上运行 + +```bash +[root@milkv-duo]~# ./coremark.exe +-sh: ./coremark.exe: not found +``` + +若出现这样的错误,则需要静态链接的二进制。 + +```bash +«Ruyi milkv-venv» $ make PORT_DIR=linux64 LFLAGS_END=-static link +riscv64-plct-linux-gnu-gcc -O2 -Ilinux64 -I. -DFLAGS_STR=\""-O2 -static"\" -DITERATIONS=0 core_list_join.c core_main.c core_matrix.c core_state.c core_util.c linux64/core_portme.c -o ./coremark.exe -static +Link performed along with compile +«Ruyi milkv-venv» $ file coremark.exe +coremark.exe: ELF 64-bit LSB executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), statically linked, BuildID[sha1]=1548f6b30560e1ca6f3fa8ba3ef6aea4188feacf, for GNU/Linux 4.15.0, with debug_info, not stripped +``` + +重新上传后运行 + +```bash +[root@milkv-duo]~# ./coremark.exe +2K performance run parameters for coremark. +CoreMark Size : 666 +Total ticks : 14911 +Total time (secs): 14.911000 +Iterations/Sec : 2011.937496 +Iterations : 30000 +Compiler version : GCC13.1.0 +Compiler flags : -O2 -static +Memory location : Please put data memory location here + (e.g. code in flash, data on heap etc) +seedcrc : 0xe9f5 +[0]crclist : 0xe714 +[0]crcmatrix : 0x1fd7 +[0]crcstate : 0x8e3a +[0]crcfinal : 0x5275 +Correct operation validated. See readme.txt for run and reporting rules. +CoreMark 1.0 : 2011.937496 / GCC13.1.0 -O2 -static / Heap +``` + From e6ba876cc56d2f205d1b34a206d1ec20850e6e23 Mon Sep 17 00:00:00 2001 From: weilinfox Date: Tue, 19 Mar 2024 00:42:00 +0800 Subject: [PATCH 2/5] Fix codeblock format Signed-off-by: weilinfox --- docs/zh/usedirection/operationside/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/zh/usedirection/operationside/index.md b/docs/zh/usedirection/operationside/index.md index d143112d..cfd561b9 100644 --- a/docs/zh/usedirection/operationside/index.md +++ b/docs/zh/usedirection/operationside/index.md @@ -4,8 +4,7 @@ 可以通过下载安装最新的 ruyi 包管理器工具并执行以下命令为设备安装系统: -``` -bash +```bash $ ruyi device provision ``` From 602124d56cc8ee88decca1a761b4eef2222415d2 Mon Sep 17 00:00:00 2001 From: weilinfox Date: Tue, 19 Mar 2024 00:50:02 +0800 Subject: [PATCH 3/5] Fix some code and format Signed-off-by: weilinfox --- docs/zh/usecase/rvbook/index.md | 21 ++++++------- docs/zh/usecase/setupos/index.md | 9 +----- docs/zh/usecase/x86pc/index.md | 30 +++++++++---------- .../developmentside/environments/index.md | 8 ++--- 4 files changed, 31 insertions(+), 37 deletions(-) diff --git a/docs/zh/usecase/rvbook/index.md b/docs/zh/usecase/rvbook/index.md index 39d8902c..6206ade3 100644 --- a/docs/zh/usecase/rvbook/index.md +++ b/docs/zh/usecase/rvbook/index.md @@ -10,13 +10,13 @@ ## ruyi工具的安装 -1. [可选] 清除ruyi缓存 +1. [可选] 清除当前已经安装的 ruyi 工具及其所有数据 ```bash ruyi self uninstall --purge ``` -2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:在[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/) 或 [ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。 +2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:从[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/) 或 [ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。 ```bash # 下载riscv64版本的ruyi,将其放到path路径下,并赋予其可执行权限 @@ -97,16 +97,16 @@ sed -i 's/\bgcc\b/riscv64-plctxthead-linux-gnu-gcc/g' linux64/core_portme.mak 11. 执行交叉编译和构建,得到可执行程序coremark.exe - ```bash - make PORT_DIR=linux64 link - ls -al #新增可执行程序coremark.exe - ``` +```bash +make PORT_DIR=linux64 link +ls -al #新增可执行程序coremark.exe +``` 12. 查看rv64可执行程序文件属性信息。 - ```bash - file coremark.exe - # 命令回显信息显示了文件的架构相关信息 - ``` +```bash +file coremark.exe +# 命令回显信息显示了文件的架构相关信息 +``` ## 运行验证 @@ -115,3 +115,4 @@ sed -i 's/\bgcc\b/riscv64-plctxthead-linux-gnu-gcc/g' linux64/core_portme.mak ```bash ./coremark.exe ``` + diff --git a/docs/zh/usecase/setupos/index.md b/docs/zh/usecase/setupos/index.md index 19473bcb..08ff99f3 100644 --- a/docs/zh/usecase/setupos/index.md +++ b/docs/zh/usecase/setupos/index.md @@ -17,9 +17,6 @@ ruyi device provision 该命令将会返回工具目前所支持的RISC-V开发板,选择开发板后将返回所有支持指定开发板的操作系统: ``` - - - RuyiSDK Device Provisioning Wizard This is a wizard intended to help you install a system on your device for your @@ -56,8 +53,6 @@ Choice? (1-9) 以上,以 Sipeed LicheePi 4A 为例,需要为其安装镜像,只需要输入对应的序号:7 ``` - - Choice? (1-9) 7 The device has the following variants. Please choose the one corresponding to your hardware at hand: @@ -83,8 +78,6 @@ We are about to download and install the following packages for your device: Proceed? (y/N) - ``` - -您只需要按照引导提示一步步执行即可。 \ No newline at end of file +您只需要按照引导提示一步步执行即可。 diff --git a/docs/zh/usecase/x86pc/index.md b/docs/zh/usecase/x86pc/index.md index 2d7e5ef6..a8d61c7a 100644 --- a/docs/zh/usecase/x86pc/index.md +++ b/docs/zh/usecase/x86pc/index.md @@ -6,17 +6,17 @@ 硬件环境:x86_64 -软件环境:ubuntu 22.04 +软件环境:Ubuntu 22.04 ## ruyi工具的安装 -1. [可选] 清除ruyi缓存 +1. [可选] 清除当前已经安装的 ruyi 工具及其所有数据 ```bash ruyi self uninstall --purge ``` -2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:在[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/) 或 [ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。 +2. 下载 ruyi 工具并为其赋可执行权限并配置到环境变量中:从[ruyi GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/) 或 [ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/)下载最新的ruyi工具。 ```bash @@ -55,7 +55,7 @@ ruyi list ruyi list -v ``` -7. 安装gnu:ruyi install `` +7. 安装工具链:ruyi install `` ```bash ruyi install gnu-upstream @@ -83,13 +83,13 @@ ruyi venv -t gnu-upstream -e qemu-user-riscv-upstream generic venv1 11. 查看虚拟环境bin目录下已安装的工具链、模拟器 ```bash -ls venv1/bin +ls venv1/bin ``` 12. 激活虚拟环境 ``` -. venv1/bin/ruyi-activate +. venv1/bin/ruyi-activate ``` 13. 检查虚拟环境中编译工具的版本信息 @@ -117,23 +117,23 @@ sed -i 's/\bgcc\b/riscv64-unknown-linux-gnu-gcc/g' linux64/core_portme.mak 16. 执行交叉编译和构建,得到可执行程序coremark.exe - ```bash - make PORT_DIR=linux64 link - ls -al #新增可执行程序coremark.exe - ``` +```bash +make PORT_DIR=linux64 link +ls -al #新增可执行程序coremark.exe +``` 17. 查看rv64可执行程序文件属性信息。 - ```bash - file coremark.exe - # 命令回显信息显示了文件的架构相关信息 - ``` +```bash +file coremark.exe +# 命令回显信息显示了文件的架构相关信息 +``` ## qemu-user 模式下运行 riscv64 coremark 可执行程序 18. qemu user模式下执行riscv64 coremark可执行程序 ```bash -ruyi-qemu coremark.exe +ruyi-qemu coremark.exe ``` 19. 退出虚拟环境 diff --git a/docs/zh/usedirection/developmentside/environments/index.md b/docs/zh/usedirection/developmentside/environments/index.md index 7985243f..25dd05ee 100644 --- a/docs/zh/usedirection/developmentside/environments/index.md +++ b/docs/zh/usedirection/developmentside/environments/index.md @@ -60,22 +60,22 @@ options: ```bash # 使用 GNU 上游工具链配置 RISC-V 编译环境: -$ ruyi venv -t gnu-upstream generic venv1 +$ ruyi venv -t gnu-upstream generic ./generic-venv # 使用 PLCT 工具链配置 Milkv-Duo 编译环境: $ ruyi venv -t gnu-plct milkv-duo ./milkv-venv # 使用 LLVM 上游工具链配置 RISC-V 编译环境: -$ ruyi venv -t llvm-upstream --sysroot-from gnu-upstream generic ./llvm_venv +$ ruyi venv -t llvm-upstream --sysroot-from gnu-upstream generic ./llvm-venv # 使用平头哥工具链配置荔枝派 4A 编译环境: $ ruyi venv -t gnu-plct-xthead-20231212 sipeed-lpi4a ./sipeed-venv # 使用上游 QEMU 模拟器运行交叉编译的 RISC-V 二进制 -$ ruyi venv -t gnu-plct generic -e qemu-user-riscv-upstream ./qemu_venv +$ ruyi venv -t gnu-plct generic -e qemu-user-riscv-upstream ./qemu-venv # 使用平头哥 QEMU 模拟器运行交叉编译的 RISC-V 二进制 -$ ruyi venv -t gnu-plct-xthead sipeed-lpi4a -e qemu-user-riscv-xthead ./qemu_venv +$ ruyi venv -t gnu-plct-xthead sipeed-lpi4a -e qemu-user-riscv-xthead ./xthead-qemu-venv ``` ## 在虚拟环境下编译 From e67743cf83d6d80b4394316084f6b48bf0f1c414 Mon Sep 17 00:00:00 2001 From: weilinfox Date: Tue, 19 Mar 2024 00:53:06 +0800 Subject: [PATCH 4/5] v0.6.0 dependency change Signed-off-by: weilinfox --- docs/zh/ruyi/getstarted/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/zh/ruyi/getstarted/index.md b/docs/zh/ruyi/getstarted/index.md index d772a81b..e36845a3 100644 --- a/docs/zh/ruyi/getstarted/index.md +++ b/docs/zh/ruyi/getstarted/index.md @@ -16,6 +16,8 @@ $ sudo apt-get install wget git tar bzip2 xz-utils zstd $ sudo apt-get install wget git tar bzip2 xz zstd ``` +注意从 v0.6.0 版本开始 RUYI 包管理不再依赖 git,而是使用 pygit2 作为替代方案。 + ## 安装 RUYI 包管理器 从 [GitHub Releases](https://github.com/RuyiSDK/ruyi/releases/) 或 [ISCAS 镜像源](https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases)下载最新版本,选择合适架构的预编译二进制下载,当前 RUYI 包管理支持 amd64 、arm64、 riscv64 架构编译环境。 @@ -226,7 +228,6 @@ $ ruyi self uninstall --purge -y 执行如下命令并按照引导执行即可下载所需系统镜像,为设备安装系统: -``` -bash +```bash $ ruyi device provision ``` From 2571cb2a8c0a78bbfcc0c1dffff368861b4172ac Mon Sep 17 00:00:00 2001 From: weilinfox Date: Tue, 19 Mar 2024 01:00:41 +0800 Subject: [PATCH 5/5] Add v0.6.0 feature Signed-off-by: weilinfox --- docs/.vitepress/config.mts | 3 +- docs/zh/ruyi/updates/0.6.0.md | 83 +++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 docs/zh/ruyi/updates/0.6.0.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 450a5de4..aad11bd1 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -57,7 +57,8 @@ export default defineConfig({ items: [ { text: 'v0.3.0 版本新增特性', link: '/zh/ruyi/updates/0.3.0' }, { text: 'v0.4.0 版本新增特性', link: '/zh/ruyi/updates/0.4.0' }, - { text: 'v0.5.0 版本新增特性', link: '/zh/ruyi/updates/0.5.0' } + { text: 'v0.5.0 版本新增特性', link: '/zh/ruyi/updates/0.5.0' }, + { text: 'v0.6.0 版本新增特性', link: '/zh/ruyi/updates/0.6.0' } ] } ] diff --git a/docs/zh/ruyi/updates/0.6.0.md b/docs/zh/ruyi/updates/0.6.0.md new file mode 100644 index 00000000..d18cce2d --- /dev/null +++ b/docs/zh/ruyi/updates/0.6.0.md @@ -0,0 +1,83 @@ +# v0.6.0 版本新增特性 + ++ 使用 pygit2 替代对 git 的依赖 ++ SiFive HiFive Unmatched 镜像支持增加到 5 种 + +## 安装 v0.6.0 + +在 amd64 架构环境安装: + +```bash +$ wget https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/0.6.0/ruyi.amd64 +$ chmod +x ./ruyi.amd64 +$ sudo cp ./ruyi.amd64 /usr/local/bin/ruyi +``` + +在 riscv64 架构环境安装: + +```bash +$ wget https://mirror.iscas.ac.cn/RuyiSDK/ruyi/releases/0.6.0/ruyi.riscv64 +$ chmod +x ./ruyi.riscv64 +$ sudo cp ./ruyi.riscv64 /usr/local/bin/ruyi +``` + +检查安装版本: + +```bash +$ ruyi version +Ruyi 0.6.0 +Copyright (C) 2023 Institute of Software, Chinese Academy of Sciences (ISCAS). +All rights reserved. +License: Apache-2.0 +``` + +## 依赖变化 + +从 v0.6.0 版本开始 RUYI 包管理不再依赖 git,而是使用 pygit2 作为替代方案。 + +## 板卡镜像刷写 + +在 0.6.0 版本, SiFive HiFive Unmatched 镜像支持增加到 5 种。 + +板卡支持列表: + +| 开发板 | 版本 | 镜像 | 刷写方式 | +|:-:|:-:|:-:|:-:| +| Allwinner Nezha D1 | Allwinner Nezha D1 (generic variant) | openEuler RISC-V (base system) for Allwinner D1 | dd | +| | | openEuler RISC-V (XFCE) for Allwinner D1 | dd | +| Canaan Kendryte K230 | Canaan Kendryte K230 (generic variant) | Canaan Kendryte K230 Official CanMV Debian SDK | dd | +| | | Canaan Kendryte K230 Official CanMV Ubuntu SDK | dd | +| Milk-V Duo | Milk-V Duo (64M RAM) | Milk-V Duo Official buildroot SDK (64M RAM) | dd | +| | | Milk-V Duo Official buildroot SDK (64M RAM, with Python) | dd | +| | Milk-V Duo (256M RAM) | Milk-V Duo Official buildroot SDK (256M RAM) | dd | +| | | Milk-V Duo Official buildroot SDK (256M RAM, with Python) | dd | +| Milk-V Pioneer Box | Milk-V Pioneer Box (v1.3) | openEuler RISC-V (base system) for Milk-V Pioneer (rootfs on NVMe) | dd | +| | | openEuler RISC-V (XFCE) for Milk-V Pioneer (rootfs on NVMe) | dd | +| | | RevyOS for Milk-V Pioneer | dd | +| | Milk-V Pioneer Box (v1.2) | openEuler RISC-V (base system) for Milk-V Pioneer (rootfs on NVMe) | dd | +| | | openEuler RISC-V (XFCE) for Milk-V Pioneer (rootfs on NVMe) | dd | +| | Milk-V Pioneer Box (v1.1) | openEuler RISC-V (base system) for Milk-V Pioneer (rootfs on NVMe) | dd | +| | | openEuler RISC-V (XFCE) for Milk-V Pioneer (rootfs on NVMe) | dd | +| SiFive HiFive Unmatched | SiFive HiFive Unmatched (generic variant) | openEuler RISC-V (base system) for SiFive HiFive Unmatched | dd | +| | | openKylin for SiFive HiFive Unmatched | dd | +| | | openEuler RISC-V (XFCE) for SiFive HiFive Unmatched | dd | +| | | OpenWrt for SiFive HiFive Unmatched | dd | +| | | Ubuntu Server for SiFive HiFive Unmatched | dd | +| Sipeed Lichee RV | Sipeed Lichee RV (generic variant) | openEuler RISC-V (base system) for Allwinner D1 | dd | +| | | openEuler RISC-V (XFCE) for Allwinner D1 | dd | +| Sipeed LicheePi 4A | Sipeed LicheePi 4A (8G RAM) | openEuler RISC-V (headless) for Sipeed LicheePi 4A (8G RAM) | fastboot | +| | | openEuler RISC-V (XFCE) for Sipeed LicheePi 4A (8G RAM) | fastboot | +| | | RevyOS for Sipeed LicheePi 4A (8G RAM) | fastboot | +| | Sipeed LicheePi 4A (16G RAM) | openEuler RISC-V (headless) for Sipeed LicheePi 4A (16G RAM) | fastboot | +| | | openEuler RISC-V (XFCE) for Sipeed LicheePi 4A (16G RAM) | fastboot | +| | | RevyOS for Sipeed LicheePi 4A (16G RAM) | fastboot | +| StarFive VisionFive | StarFive VisionFive (generic variant) | openEuler RISC-V (base system) for StarFive VisionFive | dd | +| | | openEuler RISC-V (XFCE) for StarFive VisionFive | dd | +| StarFive VisionFive2 | StarFive VisionFive2 (generic variant) | openEuler RISC-V (base system) for StarFive VisionFive2 | dd | +| | | openEuler RISC-V (XFCE) for StarFive VisionFive2 | dd | + +刷写工具根据板卡的不同依赖 ``dd`` 和 ``fastboot`` 命令, RUYI 将自动调用 ``sudo`` 提权。 + +需要注意的是一些镜像的解包需要占用大量的磁盘空间,使用 RUYI 工具刷写镜像前请务必留足磁盘空间; +一些厂家提供的镜像在刷写后并不会自动扩展分区来充分利用整块磁盘,而需要用户自行扩展磁盘分区大小。 +