Giter Club home page Giter Club logo

visionfive2-docker's Introduction

visionfive2-docker

Docker build environment for VisionFive 2 SBC

Building the docker image

Clone this repo and enter it, build the image.

git clone https://github.com/kng/visionfive2-docker.git
cd visionfive2-docker
./build.sh

If updating this repo or editing the Dockerfile, rebuild the image again.

Building firmware and kernel

All the scripts in mnt are from the Technical Reference Manual
You do not need to install any packages when running the container, it's all included in the build.
The directory mnt is bind-mounted to the container /mnt
When you run the scripts, the contents of the git pull and build etc will e in the mnt directory.

Enter the build environment with a command prompt with: ./shell.sh

Build scripts available:
build_kernel.sh build_opensbi.sh build_spl.sh build_u-boot.sh
These scripts just removes the directory before fetching it from git, so be aware any local changes in those will be wiped.

Quick build of everything:
./shell.sh build_all.sh

or manually for each step, making changes along the way.

u-boot: ./shell.sh build_u-boot.sh

OpenSBI: ./shell.sh build_opensbi.sh

SPL and payload: ./shell.sh build_spl.sh

Linux kernel: ./shell.sh build_kernel.sh

Alternatively, linux kernel based on a-wai/vf2-linux, this enables IPv6 and docker: ./shell.sh build_kernel_vf2.sh This also builds modules and installs them in mnt/lib/modules.

Busybox rootfs

Build the rootfs with: ./shell.sh build_rootfs.sh

If you want to test run it, make sure you have the proper qemu installed docker run --privileged --rm tonistiigi/binfmt:riscv
First build the image with ./rootfs_image.sh and then start a container shell with ./rootfs_shell.sh

Podman instead of Docker

If you're using podman, simply replace the above build.sh with podman_build.sh and shell.sh with podman_shell.sh

visionfive2-docker's People

Contributors

ankurkotwal avatar kng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

visionfive2-docker's Issues

expose built modules as well in e.g. mnt/lib/modules

Thank you for this great tool!
I already built several version of the kernel based on it and like the ease of use.
The only tweak I'm kind of missing, is the option to "expose" the modules as well.
I could imagine, that an additional mnt/lib/modules and the corresponding volume section in e.g. podman_shell.sh docker calls would do the trick.

#!/bin/bash
# if not running privileged
# either: chmod 777 $(pwd)/mnt
# or: -v $(pwd)/mnt:/mnt:Z \
podman run --rm \
-v "$(pwd)"/mnt:/mnt \
-v "$(pwd)"/mnt/lib/modules:/lib/modules \
--privileged \
-it localhost/visionfive2:latest "$@"

request vf2 docker tool to launch qemu for built image

I wish as part of your tools/scripts, there was another tool that would launch the image with qemu so we could run it without the actual hardware and try things out. At present I don't know how to run qemu against any vf2 image built be it buildroot, debian, archlinux, gentoo, fedora.

Thank you for listening.

podman scripts

If you prefer podman, you can do the following:

podman_build.sh

#!/bin/bash
podman build -t visionfive2:latest .
# NOTE:  -the . is to specify where to find the Dockerfile
# -built image is named localhost/visionfive2:latest

podman_shell.sh

#!/bin/bash
podman run --privileged --rm -v $(pwd)/mnt:/mnt -it localhost/visionfive2:latest $@

Afterwards:

time ./podman_shell.sh build_u-boot.sh
time ./podman_shell.sh build_opensbi.sh
time ./podman_shell.sh build_spl.sh
time ./podman_shell.sh build_kernel.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.