No Description

Jun Yuan Tan d4fa6d0c72 dubhe: Update QEMU to support full B v0.94 extension 2 years ago
conf d4fa6d0c72 dubhe: Update QEMU to support full B v0.94 extension 2 years ago
recipes-benchmark acaa8a99eb dubhe: Update License for Coremark and Dhrystone 2 years ago
recipes-bsp e6afb6e927 dubhe: Update Repo for meta-starfive 2 years ago
recipes-devtools d4fa6d0c72 dubhe: Update QEMU to support full B v0.94 extension 2 years ago
recipes-extended 25a81b82ef dubhe: Added sample helloworld recipe on Dubhe 2 years ago
recipes-images cc464b2c8e dubhe: Update Dubhe initramfs image recipe 2 years ago
recipes-kernel e6afb6e927 dubhe: Update Repo for meta-starfive 2 years ago
tools e6afb6e927 dubhe: Update Repo for meta-starfive 2 years ago
README.md ec6c948693 dubhe: Added README file for Dubhe 2 years ago
setup.sh ab7a940526 starfive: copy setup script to root 2 years ago

README.md

Setting up meta-starfive

Guide to use meta-starfive using Yocto

Dependencies

First, you need to download the essential Yocto dependencies:

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat

Repo

Next, you will need to install repo from https://source.android.com/setup/develop#installing-repo.

Dependencies of repo include:

$ sudo apt install curl python python3-distutils

The steps to install repo are as below:

$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Setup

First, to use repo, you need to key in your Github email and username as follows:

$ git config –global user.email “your email”
$ git config -global user.name “your username”

Create a workspace

$ mkdir starfive-yocto && cd starfive-yocto
$ repo init -u git://gitlab.starfivetech.com/starfive-tech/meta-starfive.git -b hardknott-dev -m tools/manifests/starfive.xml
$ repo sync
$ repo start work --all

Update existing workspace

In order to bring all the layers up to date with upstream:

$ cd starfive-yocto
$ repo sync
$ repo rebase

Bitbake Environment Setup

$ . ./meta-starfive/setup.sh

Building Images

In meta-starfive, there are two different buildable machines that you can build for:

  • qemuriscv64: The 64-bit RISC-V machine
  • starfive-dubhe: The StarFive Dubhe machine

To build the image for starfive-dubhe machine:

$ MACHINE=starfive-dubhe bitbake dubhe-image-initramfs

NOTE: For your first build, it may take several hours to build the image.

Modifying the Kernel

To modify the kernel, you can use the devtool command line:

$ MACHINE=starfive-dubhe devtool modify virtual/kernel

The devtool command will fetch the source code and unpack them in the _‘build/workspace/sources/‘_ directory.

Now you can make your changes in your source code in the workspace directory.

Building the Kernel

After you had done your changes, you can build only the kernel by:

$ MACHINE=starfive-dubhe devtool build <kernel_name>

or 

$ MACHINE=starfive-dubhe bitbake virtual/kernel

You can obtain the image generated in the images folder _build/tmp-glibc/deploy/images/starfive-dubhe/_

Saving the Modification

Once you are happy with the changes, you can go to the source folder and commit your changes:

  • Go to _workspace/sources/_:
    • $ git status
    • $ git add .
    • $ git commit -m "Changes added"
  • Create a bbappend and patch file:
    • $ devtool finish <kernel_name> <layer_path>
  • Rebuilding the Image

    To rebuild your image, the steps include:

    $ MACHINE=starfive-dubhe bitbake dubhe-image-initramfs
    

    Rebuilding will take less time as the sstate-cache is saved during your first build.

    Extras

    In case you accidentally deleted files in the build/tmp/deploy/images/ directory and some of the files are not automatically re-created when you build the image again, you can rebuild and recreate the kernel files by:

    $ MACHINE=starfive-dubhe bitbake -c clean virtual/kernel
    $ MACHINE=starfive-dubhe bitbake virtual/kernel