Jun Yuan Tan ec6c948693 dubhe: Added README file for Dubhe | 2 years ago | |
---|---|---|
conf | 2 years ago | |
recipes-bsp | 2 years ago | |
recipes-devtools | 2 years ago | |
recipes-images | 2 years ago | |
recipes-kernel | 2 years ago | |
tools | 2 years ago | |
README.md | 2 years ago |
Guide to use meta-starfive using Yocto
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
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
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”
$ 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
In order to bring all the layers up to date with upstream:
$ cd starfive-yocto
$ repo sync
$ repo rebase
$ . ./meta-starfive/setup.sh
In meta-starfive, there are two different buildable machines that you can build for:
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.
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.
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/_
Once you are happy with the changes, you can go to the source folder and commit your changes:
$ git status
$ git add .
$ git commit -m "Changes added"
$ devtool finish <kernel_name> <layer_path>
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.
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