Yocto Customizing U-Boot: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 30: Line 30:


Copy your patch:
Copy your patch:
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
$ cd {{#var:BUILD_FOLDER}}/sources/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|meta-variscite-imx|meta-variscite-fslc}}/recipes-bsp/u-boot/
<br>
$ cd {{#var:BUILD_FOLDER}}/sources/meta-variscite-imx/recipes-bsp/u-boot/
  $ mkdir -p files
  $ mkdir -p files
  $ cp {{#var:BUILD_FOLDER}}/local_repos/uboot-imx/my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff  files/
  $ cp {{#var:BUILD_FOLDER}}/local_repos/uboot-imx/my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff  files/
|
<br>
$ cd {{#var:BUILD_FOLDER}}/sources/meta-variscite-fslc/recipes-bsp/u-boot/
$ mkdir -p files
$ cp {{#var:BUILD_FOLDER}}/local_repos/uboot-imx/my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff  files/
}}


Create a u-boot-variscite.bbappend file:
Create a u-boot-variscite.bbappend file:
Line 80: Line 72:
<br>
<br>
'''Update the recipes to use the local repository instead of the default one:'''<br>
'''Update the recipes to use the local repository instead of the default one:'''<br>
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
$ cd {{#var:BUILD_FOLDER}}/sources/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|meta-variscite-imx|meta-variscite-fslc}}/recipes-bsp/u-boot/
<br>
$ cd {{#var:BUILD_FOLDER}}/sources/meta-variscite-imx/recipes-bsp/u-boot/
|
<br>
$ cd {{#var:BUILD_FOLDER}}/sources/meta-variscite-fslc/recipes-bsp/u-boot/
}}


Create a u-boot-variscite.bbappend file:
Create a u-boot-variscite.bbappend file:
Line 114: Line 100:
<br>
<br>
'''Update the recipes to use your remote repository instead of the default one''':<br>
'''Update the recipes to use your remote repository instead of the default one''':<br>
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
$ cd {{#var:BUILD_FOLDER}}/sources/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|meta-variscite-imx|meta-variscite-fslc}}/recipes-bsp/u-boot/
<br>
$ cd {{#var:BUILD_FOLDER}}/sources/meta-variscite-imx/recipes-bsp/u-boot/
|
<br>
$ cd {{#var:BUILD_FOLDER}}/sources/meta-variscite-fslc/recipes-bsp/u-boot/
}}


Create a u-boot-variscite.bbappend file:
Create a u-boot-variscite.bbappend file:

Revision as of 12:24, 3 July 2018

VAR-SOM-MX6 - Customizing U-Boot

Choose one of the following three methods to customize U-Boot and build it using Yocto:

Add your own patches on top of our source code

Using this method Yocto will take the source code from our default remote repository, and apply your patches to it before building it:

Get the source code by cloning our repository:

$ cd ~/var-fslc-yocto
$ mkdir -p local_repos
$ cd local_repos
$ git clone https://github.com/varigit/uboot-imx.git
$ cd uboot-imx
$ git checkout imx_v2015.04_4.1.15_1.1.0_ga_var03


Make your changes in the source code and create a patch:
You can use either diff or patch file types.
For example:

$ cd ~/var-fslc-yocto/local_repos/uboot-imx
$ gedit board/variscite/mx6var_som/mx6var_som.c
$ gedit include/configs/mx6var_som.h
edit and save

$ git diff > my_mx6var_som_changes.diff


Update the recipes to use your patch:

Copy your patch:

$ cd ~/var-fslc-yocto/sources/meta-variscite-fslc/recipes-bsp/u-boot/
$ mkdir -p files
$ cp ~/var-fslc-yocto/local_repos/uboot-imx/my_mx6var_som_changes.diff  files/

Create a u-boot-variscite.bbappend file:

$ gedit u-boot-variscite.bbappend

and append the following line to it:

SRC_URI += "file://my_mx6var_som_changes.diff"

Also update the u-boot-fw-utils recipe:

$ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend

Use a local repository

Using this method Yocto will take the U-Boot source from a local repository instead of our remote ones on github:

Get the source code by cloning our repository:

$ cd ~/var-fslc-yocto
$ mkdir -p local_repos
$ cd local_repos
$ git clone https://github.com/varigit/uboot-imx.git
$ cd uboot-imx
$ git checkout imx_v2015.04_4.1.15_1.1.0_ga_var03


Make your changes in the source code and commit them:
After making changes in the source code you need to commit them.
For example:

$ cd ~/var-fslc-yocto/local_repos/uboot-imx
$ gedit board/variscite/mx6var_som/mx6var_som.c
$ gedit include/configs/mx6var_som.h
edit and save

$ git commit -a -m "my_mx6var_som_changes"
To list all of the commits:
$ git log
Get the latest commit id:
$ git rev-parse HEAD


Update the recipes to use the local repository instead of the default one:

$ cd ~/var-fslc-yocto/sources/meta-variscite-fslc/recipes-bsp/u-boot/

Create a u-boot-variscite.bbappend file:

$ gedit u-boot-variscite.bbappend

and append the following lines to it (see the previous section for listing the commits or getting the latest commit id):

UBOOT_SRC = "git://${BSPDIR}/local_repos/uboot-imx;protocol=file"
SRCBRANCH = "imx_v2015.04_4.1.15_1.1.0_ga_var03" (or your own created branch)
SRCREV = "The commit id you'd like to use"

Also update the u-boot-fw-utils recipe:

$ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend


For the SRCREV value you can also use "${AUTOREV}" during development to get the latest commit of the branch
(If you do so, make sure to run "bitbake -c cleansstate virtual/bootloader" before rebuilding U-Boot)

Use your own remote repository on github

Using this method Yocto will take the source code from your own remote repository on github:

Create your own github account and upload your proprietary U-Boot to a new repository:
For example, you can fork our repository to your own account by visiting the following link and clicking on "Fork" at the top right of the screen.
Alternatively, you can clone our repository to your local machine, and push it later to your own account.

https://github.com/varigit/uboot-imx/tree/imx_v2015.04_4.1.15_1.1.0_ga_var03


Update the recipes to use your remote repository instead of the default one:

$ cd ~/var-fslc-yocto/sources/meta-variscite-fslc/recipes-bsp/u-boot/

Create a u-boot-variscite.bbappend file:

$ gedit u-boot-variscite.bbappend

and append the following lines to it (see the previous section for listing the commits or getting the latest commit id):

UBOOT_SRC = "git://github.com/your_account/uboot-imx.git;protocol=git"
SRCBRANCH = "imx_v2015.04_4.1.15_1.1.0_ga_var03" (or your own created branch)
SRCREV = "The commit id you'd like to use"

Also update the u-boot-fw-utils recipe:

$ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend


For the SRCREV value you can also use "${AUTOREV}" during development to get the latest commit of the branch
(If you do so, make sure to run "bitbake -c cleansstate virtual/bootloader" before rebuilding U-Boot)