Skip to content

Commit 8a6b394

Browse files
author
liu_fanyi
committed
update dockerfile
1 parent 1aa0325 commit 8a6b394

File tree

4 files changed

+94
-10
lines changed

4 files changed

+94
-10
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* 额,编译环境使用的nix和flake+direnv,我是在nixos下直接使用的
88

99
## 分两个部分
10-
### 第一个部分是直接在rustsbi中判断hart0则直接运行embassy与hart1的u-boot并行运行
10+
### 第一个部分是直接在rustsbi中判断是hart0则直接运行embassy,与hart1的u-boot并行运行
1111
* 在rustsbi的branch:`xingguang-embassy-in-rustsbi`
1212
* 这个rustsbi依赖特定的embassy,一并在submodule下面已经fork到我的仓库里,并进行了相应的修改(只添加了一个feature)
1313
* 直接在`rustsbi/`目录下编译rustsbi: ` cargo -vv prototyper --payload ../work/u-boot/u-boot.bin --fdt ../work/u-boot/arch/riscv/dts/starfive_visionfive2.dtb`
@@ -22,3 +22,41 @@
2222
* mkimage同上
2323
* 然后使用串口烧录即可
2424

25+
26+
## 2025-7-13 更新使用docker
27+
```bash
28+
## 获取子仓库
29+
git submodule init
30+
git submodule update
31+
cd project
32+
## build dockerfile
33+
docker buildx build . -t async-summary
34+
## docker run
35+
## 注意proxy设置成自己的或者不设置
36+
## 注意-v后面接的目录设置成自己的async-summary目录
37+
docker run -it -e http_proxy="192.168.1.100:7890" -e https_proxy="192.168.1.100:7890" --name async-summary --privileged -v /home/liu/async-summary:/home async-summary /bin/bash
38+
## 后续不需要重新run,再进入使用
39+
## docker start -ai async-summary
40+
## 下面在docker内部进行编译
41+
## 首先编译embassy_app的单独文件
42+
cd /home/project/code/embassy_app
43+
cargo build -Z build-std --release
44+
## 然后生成bin文件供给rustsbi加载
45+
rust-objcopy --binary-architecture=riscv64 target/riscv64imc/release/embassy_app -O binary embassy_app.bin
46+
## 编译rustsbi
47+
cd /home/project/code/rustsbi
48+
cargo -vv prototyper --payload ../work/u-boot/u-boot.bin --fdt ../work/u-boot/arch/riscv/dts/starfive_visionfive2.dtb
49+
## 生成最终的镜像文件img
50+
cd /home/project/code/
51+
mkimage -f payload_image.its -A riscv -O u-boot -T firmware visionfive2_fw_payload.img
52+
```
53+
54+
## 串口烧录文件visionfive2_fw_payload.img
55+
* 使用工具[Tera Term VT](https://teratermproject.github.io/index-en.html)
56+
* 拨码拨到uart
57+
* 按reset
58+
* 文件->传输->XMODEM->发送, 选择jh7110-recovery-20230322.bin
59+
* 选2
60+
* 文件->传输->XMODEM->发送, 选择刚才编译出来的visionfive2_fw_payload.img
61+
* 拨码拨回正常位置
62+
* 按reset

project/Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
FROM ubuntu:24.04
22

3-
ENV HTTP_PROXY="http://172.17.0.1:20171"
4-
ENV HTTPS_PROXY="http://172.17.0.1:20171"
5-
ENV http_proxy="http://172.17.0.1:20171"
6-
ENV https_proxy="http://172.17.0.1:20171"
3+
4+
# 设置环境变量,避免交互式配置
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
8+
# 复制本地的 ubuntu.sources 到镜像中
9+
COPY ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
710

811
RUN set -eux \
912
&& apt-get update \
1013
&& apt-get -yq upgrade \
1114
&& apt-get -yq install \
12-
build-essential automake libtool texinfo bison flex gawk g++ git xxd curl wget gdisk gperf cpio bc screen texinfo unzip libgmp-dev libmpfr-dev libmpc-dev libssl-dev libncurses-dev libglib2.0-dev libpixman-1-dev libyaml-dev patchutils python3-pip zlib1g-dev device-tree-compiler dosfstools mtools kpartx rsync \
15+
build-essential u-boot-tools automake libtool texinfo bison flex gawk g++ git xxd curl wget gdisk gperf cpio bc screen texinfo unzip libgmp-dev libmpfr-dev libmpc-dev libssl-dev libncurses-dev libglib2.0-dev libpixman-1-dev libyaml-dev patchutils python3-pip zlib1g-dev device-tree-compiler dosfstools mtools kpartx rsync \
1316
&& rm -rf /var/lib/apt/lists/* \
1417
&& exit 0
1518

19+
# warning: 添加了自己的proxy用来加速rust
20+
# ENV HTTP_PROXY="http://192.168.1.100:7890"
21+
# ENV HTTPS_PROXY="http://192.168.1.100:7890"
22+
# ENV http_proxy="http://192.168.1.100:7890"
23+
# ENV https_proxy="http://192.168.1.100:7890"
24+
1625
RUN set -eux \
1726
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
1827

@@ -21,8 +30,6 @@ ENV PATH="/root/.cargo/bin:${PATH}"
2130
RUN set -eux \
2231
&& ls -lah /root/ && ls -lah /root/.cargo/ && rustc --version
2332

24-
RUN set -eux \
25-
&& rustup target add armv7-unknown-linux-gnueabihf
2633

2734
RUN set -eux \
28-
&& rustup target add wasm32-unknown-unknown
35+
&& cargo install cargo-binutils

project/code/rustsbi

project/ubuntu.sources

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Types: deb
2+
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu
3+
Suites: noble noble-updates noble-backports
4+
Components: main restricted universe multiverse
5+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
6+
7+
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
8+
Types: deb-src
9+
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu
10+
Suites: noble noble-updates noble-backports
11+
Components: main restricted universe multiverse
12+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
13+
14+
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
15+
Types: deb
16+
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu
17+
Suites: noble-security
18+
Components: main restricted universe multiverse
19+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
20+
21+
Types: deb-src
22+
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu
23+
Suites: noble-security
24+
Components: main restricted universe multiverse
25+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
26+
27+
# 预发布软件源,不建议启用
28+
29+
# Types: deb
30+
# URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu
31+
# Suites: noble-proposed
32+
# Components: main restricted universe multiverse
33+
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
34+
35+
# Types: deb-src
36+
# URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu
37+
# Suites: noble-proposed
38+
# Components: main restricted universe multiverse
39+
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

0 commit comments

Comments
 (0)