Skip to content

Commit

Permalink
chore: 修复编译镜像未能正确安装工具链的问题 (#1071)
Browse files Browse the repository at this point in the history
Signed-off-by: longjin <[email protected]>
  • Loading branch information
fslongjin authored Dec 7, 2024
1 parent 6e85059 commit c09af90
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
name: Format check ${{ matrix.arch }}
runs-on: ubuntu-latest
continue-on-error: true
container: dragonos/dragonos-dev:v1.7
container: dragonos/dragonos-dev:v1.8

strategy:
matrix:
arch: [x86_64, riscv64]

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.7"
- run: echo "Running in dragonos/dragonos-dev:v1.8"
- uses: actions/checkout@v3

- name: Format check
Expand All @@ -35,14 +35,14 @@ jobs:
name: Kernel static test ${{ matrix.arch }}
runs-on: ubuntu-latest
continue-on-error: true
container: dragonos/dragonos-dev:v1.7
container: dragonos/dragonos-dev:v1.8

strategy:
matrix:
arch: [x86_64, riscv64]

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.7"
- run: echo "Running in dragonos/dragonos-dev:v1.8"

- uses: actions/checkout@v3

Expand All @@ -55,10 +55,10 @@ jobs:

build-x86_64:
runs-on: ubuntu-latest
container: dragonos/dragonos-dev:v1.7
container: dragonos/dragonos-dev:v1.8

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.7"
- run: echo "Running in dragonos/dragonos-dev:v1.8"

- uses: actions/checkout@v3
- name: build the DragonOS
Expand All @@ -77,10 +77,10 @@ jobs:
build-riscv64:
runs-on: ubuntu-latest
container: dragonos/dragonos-dev:v1.7
container: dragonos/dragonos-dev:v1.8

steps:
- run: echo "Running in dragonos/dragonos-dev:v1.7"
- run: echo "Running in dragonos/dragonos-dev:v1.8"

- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion tools/BUILD_CONTAINER_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.7
v1.8
21 changes: 11 additions & 10 deletions tools/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DEFAULT_INSTALL="false"
export RUSTUP_DIST_SERVER=${RUSTUP_DIST_SERVER:-https://rsproxy.cn}
export RUSTUP_UPDATE_ROOT=${RUSTUP_UPDATE_ROOT:-https://rsproxy.cn/rustup}
export RUST_VERSION="${RUST_VERSION:-nightly-2024-11-05}"
export RUST_VERSION_OLD="${RUST_VERSION:-nightly-2024-07-23}"

banner()
{
Expand Down Expand Up @@ -65,7 +66,7 @@ install_ubuntu_debian_pkg()
lsb-release \
llvm-dev libclang-dev clang gcc-multilib \
gcc build-essential fdisk dosfstools dnsmasq bridge-utils iptables libssl-dev pkg-config \
sphinx make git
python3-sphinx make git
# 必须分开安装,否则会出现错误
sudo "$1" install -y \
gcc-riscv64-unknown-elf gcc-riscv64-linux-gnu gdb-multiarch
Expand Down Expand Up @@ -233,21 +234,21 @@ rustInstall() {
echo "正在安装DragonOS所需的rust组件...首次安装需要一些时间来更新索引,请耐心等待..."
cargo install cargo-binutils
cargo install bpf-linker
rustup toolchain install nightly-2024-11-05-x86_64-unknown-linux-gnu
rustup toolchain install $RUST_VERSION-x86_64-unknown-linux-gnu
rustup toolchain install $RUST_VERSION_OLD-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain $RUST_VERSION-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-11-05-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain $RUST_VERSION_OLD-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-none --toolchain $RUST_VERSION-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-none --toolchain nightly-2024-11-05-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl --toolchain nightly-2024-11-05-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-none --toolchain $RUST_VERSION_OLD-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl --toolchain $RUST_VERSION-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-musl --toolchain $RUST_VERSION_OLD-x86_64-unknown-linux-gnu

rustup toolchain install $RUST_VERSION-riscv64gc-unknown-linux-gnu --force-non-host
rustup toolchain install nightly-2024-11-05-riscv64gc-unknown-linux-gnu --force-non-host
rustup toolchain install $RUST_VERSION_OLD-riscv64gc-unknown-linux-gnu --force-non-host
rustup target add riscv64gc-unknown-none-elf --toolchain $RUST_VERSION-riscv64gc-unknown-linux-gnu
rustup target add riscv64imac-unknown-none-elf --toolchain $RUST_VERSION-riscv64gc-unknown-linux-gnu
rustup target add riscv64gc-unknown-none-elf --toolchain nightly-2024-11-05-riscv64gc-unknown-linux-gnu
rustup target add riscv64imac-unknown-none-elf --toolchain nightly-2024-11-05-riscv64gc-unknown-linux-gnu
rustup target add riscv64gc-unknown-none-elf --toolchain $RUST_VERSION_OLD-riscv64gc-unknown-linux-gnu
rustup target add riscv64imac-unknown-none-elf --toolchain $RUST_VERSION_OLD-riscv64gc-unknown-linux-gnu

rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add rust-src
Expand Down Expand Up @@ -338,9 +339,9 @@ cargo install dadk || exit 1
bashpath=$(cd `dirname $0`; pwd)

# 编译安装musl交叉编译工具链
bash ${bashpath}/install_musl_gcc.sh || (echo "musl交叉编译工具链安装失败" && exit 1)
$SHELL ${bashpath}/install_musl_gcc.sh || (echo "musl交叉编译工具链安装失败" && exit 1)
# 编译安装grub
bash ${bashpath}/grub_auto_install.sh || (echo "grub安装失败" && exit 1)
$SHELL ${bashpath}/grub_auto_install.sh || (echo "grub安装失败" && exit 1)

# 解决kvm权限问题
USR=$USER
Expand Down
3 changes: 2 additions & 1 deletion tools/change_rust_src.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ echo "正在为rust换源"

sparse="false"

CONFIG_FILE=~/.cargo/config.toml
CARGO_HOME=${CARGO_HOME:-~/.cargo}
CONFIG_FILE=$CARGO_HOME/config.toml
# 创建父目录
if [ ! -d ~/.cargo ]; then
mkdir -p ~/.cargo
Expand Down

0 comments on commit c09af90

Please sign in to comment.