From dcc87c9d45ecca00ca6881aa83bcffa6bb5ed414 Mon Sep 17 00:00:00 2001 From: David Marceau Date: Tue, 5 Dec 2023 22:27:56 -0500 Subject: [PATCH 1/3] Update README.md for more podman specific steps the added podman specific steps. additional python-related packages needed to be installed by the Dockerfile for the following build scripts to succeed. --- README.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0647958..7fbeee5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # visionfive2-docker Docker build environment for VisionFive 2 SBC -## Building the docker image -Clone this repo and enter it, build the image. +## Building the docker container +Clone this repo and enter it, build the container. ``` git clone https://github.com/kng/visionfive2-docker.git cd visionfive2-docker @@ -52,7 +52,82 @@ Build the rootfs with: 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 +## All Build Steps With Podman -If you're using podman, simply replace the above `build.sh` with `podman_build.sh` and `shell.sh` with `podman_shell.sh` +Please note we only use `podman_build.sh` to build the podman container holding ubuntu and the pre-requisite packages. +### 1. Clone this repository + +``` +cd ~ +git clone https://github.com/kng/visionfive2-docker.git +cd ~/visionfive2-docker +``` + +### 2. Prepare the Dockerfile for the Podman Ubuntu Container with the Starfive Pre-Requisite Packages + +The **Dockerfile** needs a few python3 packages to work otherwise you get build errors. In this case **python3.8** as the default for this **ubuntu:bionic**. + +Here is what I believe the Dockerfile should contain: + +``` +cat Dockerfile +FROM ubuntu:bionic +MAINTAINER sa2kng + +RUN apt-get -y update &&\ + apt -y upgrade &&\ + apt-get -y install \ + bc \ + bison \ + ca-certificates \ + cpio \ + device-tree-compiler \ + flex \ + gcc \ + gcc-riscv64-linux-gnu \ + git \ + kmod \ + libncurses-dev \ + libssl-dev \ + make \ + xz-utils \ + software-properties-common &&\ + add-apt-repository ppa:deadsnakes/ppa &&\ + apt update &&\ + apt-get -y install python3.8 &&\ + apt-get -y install python3-dev &&\ + apt-get -y install python3-pip &&\ + apt-get -y install python3-venv &&\ + rm -rf /var/lib/apt/lists/* + +ENV PATH="/mnt:${PATH}" +WORKDIR /mnt +CMD "bash" + +``` + +### 3. Build The Podman Ubuntu Container With Starfive Pre-Requisite Packages + +NOTE: this builds the container image named **localhost/visionfive2:latest** + +``` +cd ~/visionfive2-docker +./podman_build.sh +``` + +### 4. Build the rest with that Podman Ubuntu Container + +NOTE: Make sure to run the previous step podman_build.sh step which builds container image named **localhost/visionfive2:latest**. +The following steps then use podman_shell.sh command to load up that container image named **localhost/visionfive2:latest** and run their respective build scripts. + +``` +cd ~/visionfive2-docker +./podman_shell.sh build_u-boot.sh +./podman_shell.sh build_opensbi.sh +./podman_shell.sh build_spl.sh +./podman_shell.sh build_kernel.sh +./podman_shell.sh build_rootfs.sh +``` + +Voila. I do hope it works for you. Cheers. From 56a9b8ae5f1ecbca46546a1f06d3267835669418 Mon Sep 17 00:00:00 2001 From: David Marceau Date: Tue, 5 Dec 2023 22:56:09 -0500 Subject: [PATCH 2/3] Update README.md needed to sudo mknod within the build_rootfs.sh script successfully. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7fbeee5..376b985 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ RUN apt-get -y update &&\ apt-get -y install python3-dev &&\ apt-get -y install python3-pip &&\ apt-get -y install python3-venv &&\ + apt-get -y install sudo &&\ rm -rf /var/lib/apt/lists/* ENV PATH="/mnt:${PATH}" From 4fd4b2716d5da6691962ee5f992bf54f6d7a8001 Mon Sep 17 00:00:00 2001 From: David Marceau Date: Thu, 7 Dec 2023 22:08:50 -0500 Subject: [PATCH 3/3] Update README.md the build_rootfs.sh script needs to be handled differently. added instructions on how to proceed for mknod commands to succeed. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 376b985..160ae38 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ cd ~/visionfive2-docker ./podman_shell.sh build_opensbi.sh ./podman_shell.sh build_spl.sh ./podman_shell.sh build_kernel.sh -./podman_shell.sh build_rootfs.sh +./podman_shell.sh fakeroot /bin/bash build_rootfs.sh ``` Voila. I do hope it works for you. Cheers.