Yocto Customizing U-Boot: Difference between revisions

From Variscite Wiki
No edit summary
 
(46 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<!-- Set release according to "release" parameter in URL and use PYRO_V1.0_VAR-SOM-MX6 as default
<!-- Set release according to "release" parameter in URL and use PYRO_V1.0_VAR-SOM-MX6 as default
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{INIT_RELEASE_PARAM|RELEASE_PYRO_V1.0_VAR-SOM-MX6}}<!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_PYRO_V1.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:B2QT_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{COMMON_YOCTO_VARS}} <!-- Include common yocto variables <!--
--> {{#vardefine:ARCH_PREFIX | {{#varexists: FSLC_BSP_VERSION | -fslc | -poky }} }} <!--
--> {{#vardefine:ARCH_SUFFIX | {{#switch: {{#var:SOC_SERIES}}|imx8|imx9=-linux|-linux-gnueabi}} }} <!--
--> {{#vardefine:BB_ENV | {{#varexists: B2QT_GIT | MACHINE={{#var:MACHINE_NAME}} | }} }} <!--
-->                                {{#vardefine:BUILD_PAGE|Yocto_Build_Release}}  {{#vardefine:PLATFORM_OS|Yocto}}        <!-- Default to Yocto
--> {{#varexists:DEBIAN_NAME      | {{#vardefine:BUILD_PAGE|Debian_Build_Release}} {{#vardefine:PLATFORM_OS|Debian}}  | }} <!-- Debian
--> {{#varexists:B2QT_BSP_VERSION | {{#vardefine:BUILD_PAGE|B2QT_Build_Release}}  {{#vardefine:PLATFORM_OS|Boot2Qt}} | }} <!-- B2Qt
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Customizing U-Boot}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Yocto}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Customizing U-Boot}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Yocto}} __toc__
<br>
<br>
'''Choose one of the following three methods to customize U-Boot.'''<br>
'''Choose one of the following three methods to customize U-Boot.'''<br>
After following one of the below methods you can either bitbake your complete image (e.g. fsl-image-gui) and the updated U-Boot will be used, or you can bitbake U-Boot alone by running "bitbake virtual/bootloader" (see the {{Varlink|Yocto_Build_Release|{{#var:RELEASE_LINK}}|Build Yocto from source code}} page for the initial Yocto setup and for more info on using bitbake).<br>
{{#switch: {{#var:SOC_SERIES}}|imx8|imx9=
After following one of the below methods, you may use the updated U-Boot by either building your complete image (e.g. fsl-image-gui) or building a new imx-boot image by running "bitbake imx-boot -c deploy"  (see the {{Varlink|{{#var:BUILD_PAGE}}|{{#var:RELEASE_LINK}}|Build {{#var:PLATFORM_OS}} from source code}} page for the initial setup and for more info on using bitbake).<br>
To install the new imx-boot image (with the updated U-Boot) to an SD card, run:
$ sudo dd if=tmp/deploy/images/{{#var:MACHINE_NAME}}/imx-boot of=/dev/sdX bs=1K seek={{#var:U-BOOT_OFFSET}} conv=fsync
|
After following one of the below methods you can either bitbake your complete image (e.g. fsl-image-gui) and the updated U-Boot will be used, or you can bitbake U-Boot alone by running "{{#var:BB_ENV}} bitbake virtual/bootloader" (see the {{Varlink|{{#var:BUILD_PAGE}}|{{#var:RELEASE_LINK}}|Build {{#var:PLATFORM_OS}} from source code}} page for the initial setup and for more info on using bitbake).<br>
}}


= Add your own patches on top of our source code =
= Add your own patches on top of our source code =
Line 11: Line 26:
<br>
<br>
'''Setup Yocto''':<br>
'''Setup Yocto''':<br>
* Follow steps 1-3 of the {{Varlink2|Yocto Build Release|{{#var:RELEASE_LINK}}}} page.
* Follow steps 1-3 of the {{Varlink|{{#var:BUILD_PAGE}}|{{#var:RELEASE_LINK}}|Build {{#var:PLATFORM_OS}} from source code}} page.
* Follow the first part of step 4 of the same page, to source the setup-environment script (stop after that - don't build any image). E.g.:
* Follow the first part of step 4 of the same page, to source the setup-environment script (stop after that - don't build any image). E.g.:
$ cd {{#var:BUILD_FOLDER}}
{{#lst:Yocto_Platform_Customization|YOCTO_ENV_SETUP_X}}
$ MACHINE={{#var:MACHINE_NAME}} DISTRO={{#var:BUILD_DISTRO}} {{#var:BUILD_SCRIPT}} {{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|-b {{#var:BUILD_FOLDER_XWAYLAND}}|{{#var:BUILD_FOLDER_X11}}}}
{{#vardefine:LOCAL_BUILD_FOLDER|{{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|/workdir|{{#var:BUILD_FOLDER}}}}}}
{{#vardefine:SHELL_PROMPT|{{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|vari@yocto-{{#var:DOCKER_CONTAINER_INFO}}:/workdir|{{#var:BUILD_FOLDER}}}}}}
{{#vardefine:EDITOR|{{#if:{{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}}|nano|gedit}}}}
<br>
<br>
'''Get the source code''':<br>
'''Get the source code''':<br>
  $ bitbake -c unpack virtual/bootloader
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ {{#var:BB_ENV}} bitbake -c unpack virtual/bootloader
  $ mkdir -p ../local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ mkdir -p ../local_repos/uboot-imx
  $ cp -a tmp/work/{{#var:MACHINE_NAME_}}-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/. ../local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ cp -a tmp/work/{{#var:MACHINE_NAME_}}{{#var:ARCH_PREFIX}}{{#var:ARCH_SUFFIX}}/u-boot-variscite/<uboot version>/git/. ../local_repos/uboot-imx
  $ cd ../local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ cd ../local_repos/uboot-imx
  $ git reset --hard
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ git reset --hard
  $ git clean -fdx
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ git clean -fdx
<br>
<br>
'''Make your changes in the source code and create a patch''':<br>
'''Make your changes in the source code and create a patch''':<br>
You can use either diff or patch file types.<br>
You can use either diff or patch file types.<br>
{{#if: {{#var:BUILD_YOCTO_IN_DOCKER_CONTAINER}} | {{Note|'''Note:''' if, running {{#var:EDITOR}}, you see the error '''{{#var:EDITOR}}: command not found''' please install it with '''sudo apt install {{#var:EDITOR}}''' password '''ubuntu''' '''.}}}}
For example:
For example:
  $ cd {{#var:BUILD_FOLDER}}/local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ {{#var:EDITOR}} board/variscite/{{#var:U-BOOT_BOARD_NAME}}/{{#var:U-BOOT_BOARD_NAME}}.c
$ gedit board/variscite/{{#var:U-BOOT_BOARD_NAME}}/{{#var:U-BOOT_BOARD_NAME}}.c
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ {{#var:EDITOR}} include/configs/{{#var:U-BOOT_BOARD_NAME}}.h
  $ gedit include/configs/{{#var:U-BOOT_BOARD_NAME}}.h
  edit and save
  edit and save
   
   
  $ git diff > my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ git diff > my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff
<br>
<br>
'''Update the recipes to use your patch''':<br>
'''Update the recipes to use your patch''':<br>


Copy your patch:
Copy your patch:
  $ cd {{#var:BUILD_FOLDER}}/sources/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|meta-variscite-imx|meta-variscite-fslc}}/recipes-bsp/u-boot/
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ cd {{#var:LOCAL_BUILD_FOLDER}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot/
$ mkdir -p files
{{#var:SHELL_PROMPT}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot$ mkdir -p files
  $ cp {{#var:BUILD_FOLDER}}/local_repos/uboot-imx/my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff  files/
  {{#var:SHELL_PROMPT}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot$ cp {{#var:LOCAL_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:
  $ gedit u-boot-variscite.bbappend
  {{#var:SHELL_PROMPT}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot$ {{#var:EDITOR}} u-boot-variscite.bbappend


and append the following line to it:
and append the following line to it:
Line 48: Line 65:
  SRC_URI += "file://my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff"
  SRC_URI += "file://my_{{#var:U-BOOT_BOARD_NAME}}_changes.diff"


{{#ifexpr:{{#var:YOCTO_VERSION}}<3.1|
Also update the u-boot-fw-utils recipe:
Also update the u-boot-fw-utils recipe:
  $ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend
  {{#var:SHELL_PROMPT}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot$ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend
|}}


= Use a local repository =
= Use a local repository =
Line 55: Line 74:
<br>
<br>
'''Setup Yocto''':<br>
'''Setup Yocto''':<br>
* Follow steps 1-3 of the {{Varlink2|Yocto Build Release|{{#var:RELEASE_LINK}}}} page.
* Follow steps 1-3 of the {{Varlink|{{#var:BUILD_PAGE}}|{{#var:RELEASE_LINK}}|Build {{#var:PLATFORM_OS}} from source code}} page.
* Follow the first part of step 4 of the same page, to source the setup-environment script (stop after that - don't build any image). E.g.:
* Follow the first part of step 4 of the same page, to source the setup-environment script (stop after that - don't build any image). E.g.:
$ cd {{#var:BUILD_FOLDER}}
{{#lst:Yocto_Platform_Customization|YOCTO_ENV_SETUP_X}}
$ MACHINE={{#var:MACHINE_NAME}} DISTRO={{#var:BUILD_DISTRO}} {{#var:BUILD_SCRIPT}} {{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|-b {{#var:BUILD_FOLDER_XWAYLAND}}|{{#var:BUILD_FOLDER_X11}}}}
<br>
<br>
'''Get the source code''':<br>
'''Get the source code''':<br>
  $ bitbake -c unpack virtual/bootloader
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ {{#var:BB_ENV}} bitbake -c unpack virtual/bootloader
  $ mkdir -p {{#var:BUILD_FOLDER}}/local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ mkdir -p ../local_repos/uboot-imx
  $ cp -a tmp/work/{{#var:MACHINE_NAME_}}-fslc-linux-gnueabi/u-boot-variscite/1.0-r0/git/. {{#var:BUILD_FOLDER}}/local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ cp -a tmp/work/{{#var:MACHINE_NAME_}}{{#var:ARCH_PREFIX}}{{#var:ARCH_SUFFIX}}/u-boot-variscite/<uboot version>/git/. ../local_repos/uboot-imx
  $ cd {{#var:BUILD_FOLDER}}/local_repos/uboot-imx
{{#var:SHELL_PROMPT}}/{{#var:BUILD_FOLDER_ENV}}$ cd ../local_repos/uboot-imx
$ git reset --hard
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ git reset --hard
  $ git clean -fdx
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ git clean -fdx
<br>
<br>
'''Make your changes in the source code and commit them:'''<br>
'''Make your changes in the source code and commit them:'''<br>
After making changes in the source code ''you need to commit them''.<br>
After making changes in the source code ''you need to commit them''.<br>
For example:
For example:
  $ cd {{#var:BUILD_FOLDER}}/local_repos/uboot-imx
  {{#var:SHELL_PROMPT}}$ cd local_repos/uboot-imx
$ gedit board/variscite/{{#var:U-BOOT_BOARD_NAME}}/{{#var:U-BOOT_BOARD_NAME}}.c
{{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ {{#var:EDITOR}} board/variscite/{{#var:U-BOOT_BOARD_NAME}}/{{#var:U-BOOT_BOARD_NAME}}.c
  $ gedit include/configs/{{#var:U-BOOT_BOARD_NAME}}.h
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ {{#var:EDITOR}} include/configs/{{#var:U-BOOT_BOARD_NAME}}.h
  edit and save
  edit and save
   
   
  $ git commit -a -m "my_{{#var:U-BOOT_BOARD_NAME}}_changes"
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ git commit -a -m "my_{{#var:U-BOOT_BOARD_NAME}}_changes"


  To list all of the commits:
  To list all of the commits:
Line 85: Line 103:
<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>
  $ cd {{#var:BUILD_FOLDER}}/sources/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|meta-variscite-imx|meta-variscite-fslc}}/recipes-bsp/u-boot/
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ cd {{#var:LOCAL_BUILD_FOLDER}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot/


Create a u-boot-variscite.bbappend file:
Create a u-boot-variscite.bbappend file:
  $ gedit u-boot-variscite.bbappend
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ {{#var:EDITOR}} 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):
and append the following lines to it (see the previous section for listing the commits or getting the latest commit id):


  UBOOT_SRC = <nowiki>"git://${BSPDIR}/local_repos/uboot-imx;protocol=file"</nowiki>
  UBOOT_SRC = <nowiki>"git://${BSPDIR}/local_repos/uboot-imx;protocol=file"</nowiki>
  SRCBRANCH = "{{#var:U-BOOT_BRANCH}}" ''(or your own created branch)''
  SRCBRANCH{{#var:YOCTO_OVERRIDE_PREFIX}}{{#var:MACHINE_NAME}} = "{{#var:U-BOOT_BRANCH}}" ''(or your own created branch)''
  SRCREV = "''The commit id you'd like to use''"
  SRCREV{{#var:YOCTO_OVERRIDE_PREFIX}}{{#var:MACHINE_NAME}} = "''The commit id you'd like to use''"


{{#ifexpr:{{#var:YOCTO_VERSION}}<3.1|
Also update the u-boot-fw-utils recipe:
Also update the u-boot-fw-utils recipe:
  $ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend
|}}
<br>
<br>
{{note|For the SRCREV value you can also use "${AUTOREV}" during development to get the latest commit of the branch<br>
{{note|For the SRCREV value you can also use "${AUTOREV}" during development to get the latest commit of the branch<br>
(If you do so, make sure to run "bitbake -c cleansstate virtual/bootloader" before rebuilding U-Boot)}}
(If you do so, make sure to run "{{#var:BB_ENV}} bitbake -c cleansstate virtual/bootloader" before rebuilding U-Boot)}}


= Use your own remote repository on github =
= Use your own remote repository on github =
Line 113: Line 133:
<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>
  $ cd {{#var:BUILD_FOLDER}}/sources/{{#ifeq: {{#var:HARDWARE_NAME}}|DART-MX8M|meta-variscite-imx|meta-variscite-fslc}}/recipes-bsp/u-boot/
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ cd {{#var:LOCAL_BUILD_FOLDER}}/sources/{{#var:META_VARISCITE_REPO}}/recipes-bsp/u-boot/


Create a u-boot-variscite.bbappend file:
Create a u-boot-variscite.bbappend file:
  $ gedit u-boot-variscite.bbappend
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ {{#var:EDITOR}} 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):
and append the following lines to it (see the previous section for listing the commits or getting the latest commit id):
Line 124: Line 144:
  SRCREV = "''The commit id you'd like to use''"
  SRCREV = "''The commit id you'd like to use''"


{{#ifexpr:{{#var:YOCTO_VERSION}}<3.1|
Also update the u-boot-fw-utils recipe:
Also update the u-boot-fw-utils recipe:
  $ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend
  {{#var:SHELL_PROMPT}}/local_repos/uboot-imx$ cp u-boot-variscite.bbappend u-boot-fw-utils.bbappend
|}}
<br>
<br>
{{note|For the SRCREV value you can also use "${AUTOREV}" during development to get the latest commit of the branch<br>
{{note|For the SRCREV value you can also use "${AUTOREV}" during development to get the latest commit of the branch<br>
(If you do so, make sure to run "bitbake -c cleansstate virtual/bootloader" before rebuilding U-Boot)}}
(If you do so, make sure to run "{{#var:BB_ENV}} bitbake -c cleansstate virtual/bootloader" before rebuilding U-Boot)}}

Latest revision as of 17:44, 24 October 2024

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release RELEASE_PYRO_V1.0_VAR-SOM-MX6.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release


VAR-SOM-MX6 - Customizing U-Boot


Choose one of the following three methods to customize U-Boot.
After following one of the below methods you can either bitbake your complete image (e.g. fsl-image-gui) and the updated U-Boot will be used, or you can bitbake U-Boot alone by running " bitbake virtual/bootloader" (see the Build Yocto from source code page for the initial setup and for more info on using bitbake).

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:

Setup Yocto:

  • Follow steps 1-3 of the Build Yocto from source code page.
  • Follow the first part of step 4 of the same page, to source the setup-environment script (stop after that - don't build any image). E.g.:
$ cd ~/var-fslc-yocto
$ MACHINE=var-som-mx6 DISTRO=fslc-x11 . setup-environment build_x11



Get the source code:

~/var-fslc-yocto/build_x11$  bitbake -c unpack virtual/bootloader
~/var-fslc-yocto/build_x11$ mkdir -p ../local_repos/uboot-imx
~/var-fslc-yocto/build_x11$ cp -a tmp/work/var_som_mx6-fslc-linux-gnueabi/u-boot-variscite/<uboot version>/git/. ../local_repos/uboot-imx
~/var-fslc-yocto/build_x11$ cd ../local_repos/uboot-imx
~/var-fslc-yocto/local_repos/uboot-imx$ git reset --hard
~/var-fslc-yocto/local_repos/uboot-imx$ git clean -fdx


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

For example:

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

~/var-fslc-yocto/local_repos/uboot-imx$ git diff > my_mx6var_som_changes.diff


Update the recipes to use your patch:

Copy your patch:

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

Create a u-boot-variscite.bbappend file:

~/var-fslc-yocto/sources/meta-variscite-fslc/recipes-bsp/u-boot$ 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:

~/var-fslc-yocto/sources/meta-variscite-fslc/recipes-bsp/u-boot$ 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:

Setup Yocto:

  • Follow steps 1-3 of the Build Yocto from source code page.
  • Follow the first part of step 4 of the same page, to source the setup-environment script (stop after that - don't build any image). E.g.:
$ cd ~/var-fslc-yocto
$ MACHINE=var-som-mx6 DISTRO=fslc-x11 . setup-environment build_x11


Get the source code:

~/var-fslc-yocto/build_x11$  bitbake -c unpack virtual/bootloader
~/var-fslc-yocto/build_x11$ mkdir -p ../local_repos/uboot-imx
~/var-fslc-yocto/build_x11$ cp -a tmp/work/var_som_mx6-fslc-linux-gnueabi/u-boot-variscite/<uboot version>/git/. ../local_repos/uboot-imx
~/var-fslc-yocto/build_x11$ cd ../local_repos/uboot-imx
~/var-fslc-yocto/local_repos/uboot-imx$ git reset --hard
~/var-fslc-yocto/local_repos/uboot-imx$ git clean -fdx


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

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

~/var-fslc-yocto/local_repos/uboot-imx$ 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:

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

Create a u-boot-variscite.bbappend file:

~/var-fslc-yocto/local_repos/uboot-imx$ 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_var-som-mx6 = "imx_v2015.04_4.1.15_1.1.0_ga_var03" (or your own created branch)
SRCREV_var-som-mx6 = "The commit id you'd like to use"

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

~/var-fslc-yocto/local_repos/uboot-imx$ 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:

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

Create a u-boot-variscite.bbappend file:

~/var-fslc-yocto/local_repos/uboot-imx$ 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:

~/var-fslc-yocto/local_repos/uboot-imx$ 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)