Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise build.sh, add initial README.md #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Introduction

This builds Linux with rv64ilp32 for trying on K230 devices.

# Preparations

Please prepare toolchain, source tree and host packages before building.

## Toolchain preparation

Please get the [rv64ilp32 toolchain](https://github.com/ruyisdk/riscv-gnu-toolchain-rv64ilp32/releases) and unpack it in a folder, let's assume environment variable `RV64ILP32_TOOLCHAIN_HOME` points to that folder:

```
$ export RV64ILP32_TOOLCHAIN_HOME=<toolchain-install-root>
$ ls -F $RV64ILP32_TOOLCHAIN_HOME
riscv/
```

Please note that the `riscv64-unknown-linux-gnu-` toolchain is needed to build U-Boot, it can be from the [mainline toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.10.18/riscv64-glibc-ubuntu-22.04-gcc-nightly-2023.10.18-nightly.tar.gz). Let's assume this toolchain is available at folder specified by `MAINLINE` environment variable.

## Source tree preparation

Before building, please run the following commands to fetch the submodule sources:

```
$ git submodule update --init --recursive
```

## Host packages

The following host packages are also needed on Ubuntu:

```
$ sudo apt install libssl-dev mtools python3.10-venv
```

The [genimage tool](https://github.com/pengutronix/genimage/releases) is also needed. It can be build with the host C compiler like below:

```
$ cd genimage-17
$ ./configure
$ make
$ sudo make install
$ genimage -h
```

# Build

Run `build.sh` in top folder to see the list of targets:

```
PATH=$MAINLINE/bin:$PATH ./build.sh
```

The final image will be available in `output/` folder, which can be used on CanMV-K230 device. Read `build.sh` for more usage tips.
4 changes: 3 additions & 1 deletion build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ function cleanup_build() {
}

function usage() {
echo "Usage: $0 build/clean"
echo "Usage: $0 build <target>"
echo "Usage: $0 clean"
echo "Here <target> can be: linux, opensbi, uboot, rootfs, img, linux_opensbi_uboot, all"
}

function fault() {
Expand Down
Loading