title: Extra commands in raspberry pi u-boot using yocto
body: <p>I want to add a custom command in raspberry pi u-boot using yocto
  I was able add custom in using make by following the answers provided here <a href="https://stackoverflow.com/questions/60913034/implement-custom-u-boot-command">Implement custom u-boot command</a></p>
  
  <p>Now I want add it using yocto in raspberry pi. 
  But first I want to just add the timer command in u-boot which is present in <code>misc.c</code> in u-boot source where we just have to add the <code>CONFIG_CMD_TIMER=y</code> in the defconfig file</p>
  
  <p>I tried the following setup till now</p>
  
  <ol>
  <li>cloned poky</li>
  <li>cloned meta-raspberrypi </li>
  <li>Enabled u-boot and uart in local.conf</li>
  <li>created a custom layer (custom layer added in <code>bblayers.conf</code>) to add the command config</li>
  </ol>
  
  <p>Details of the recipe in the custom layer</p>
  
  <ol>
  <li>create the following directory structure</li>
  </ol>
  
  <pre><code>meta-custom-layer/recipes-bsp/u-boot/
  </code></pre>
  
  <ol start="2">
  <li>created a <code>.bbappend</code> file containing the following content</li>
  </ol>
  
  <pre><code>$ cat meta-custom-layer/recipes-bsp/u-boot/u-boot_%.bbappend
  FILESEXTRAPATHS_prepend := "${THISDIR}:"
  SRC_URI += " file://rpi_3_defconfig.patch;patchdir=${S}/configs "
  </code></pre>
  
  <ol start="3">
  <li>contents of the <code>meta-custom-layer/recipes-bsp/u-boot/</code></li>
  </ol>
  
  <pre><code>$ ls -l meta-custom-layer/recipes-bsp/u-boot/
  drwxr-xr-x 2 bhargav bhargav 4096 May 16 22:04 files
  -rw-r--r-- 1 bhargav bhargav  107 May 16 22:04 u-boot_%.bbappend
  
  $ cat meta-custom-layer/recipes-bsp/u-boot/files/rpi_3_defconfig.patch
  CONFIG_CMD_TIMER=y
  </code></pre>
  
  <ol start="4">
  <li>while build u-boot getting the following error</li>
  </ol>
  
  <pre><code>$ bitbake u-boot
  Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:00
  Loaded 2875 entries from dependency cache.
  NOTE: Resolving any missing task queue dependencies
  
  Build Configuration:
  BB_VERSION           = "1.46.0"
  BUILD_SYS            = "x86_64-linux"
  NATIVELSBSTRING      = "universal"
  TARGET_SYS           = "aarch64-poky-linux"
  MACHINE              = "raspberrypi3-64"
  DISTRO               = "poky"
  DISTRO_VERSION       = "3.1"
  TUNE_FEATURES        = "aarch64 cortexa53 crc"
  TARGET_FPU           = ""
  meta                 
  meta-poky            
  meta-yocto-bsp       = "master:2e11d97b6c95e89aa1f9d3603a966c94c442469e"
  meta-raspberrypi     = "master:45ee64377bcc511380edf59191abc90c1ddb210e"
  meta-shell           = "master:81fd3448f603a56409389247443439cad4fdaa67"
  meta-oe              = "master:679bb4912613f3860e8527557602251e5e5f2c41"
  meta-python2         = "master:2684086f91e7074324081196c8a5f9945d39650e"
  
  Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:00
  Sstate summary: Wanted 16 Found 8 Missed 8 Current 135 (50% match, 94% complete)
  NOTE: Executing Tasks
  WARNING: u-boot-1_2020.04-r0 do_fetch: Failed to fetch URL file://rpi_3_defconfig.patch;patchdir=/home/bhargav/RPI3/Build/poky/build/tmp/work/raspberrypi3_64-poky-linux/u-boot/1_2020.04-r0/git/configs, attempting MIRRORS if available
  ERROR: u-boot-1_2020.04-r0 do_fetch: Fetcher failure: Unable to find file file://rpi_3_defconfig.patch;patchdir=/home/bhargav/RPI3/Build/poky/build/tmp/work/raspberrypi3_64-poky-linux/u-boot/1_2020.04-r0/git/configs anywhere. The paths that were searched were:
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/poky
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/poky
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/poky
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/poky
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/raspberrypi3-64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/raspberrypi3-64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/raspberrypi3-64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/raspberrypi3-64
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/raspberrypi3
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/raspberrypi3
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/raspberrypi3
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/raspberrypi3
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/aarch64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/aarch64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/aarch64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/aarch64
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/rpi
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/rpi
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/rpi
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/rpi
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/aarch64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/aarch64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/aarch64
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/aarch64
      /home/bhargav/RPI3/Build/meta-shell/recipes-bsp/u-boot/
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot-2020.04/
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot/
      /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/files/
      /home/bhargav/RPI3/Build/poky/build/downloads
  ERROR: u-boot-1_2020.04-r0 do_fetch: Fetcher failure for URL: 'file://rpi_3_defconfig.patch;patchdir=/home/bhargav/RPI3/Build/poky/build/tmp/work/raspberrypi3_64-poky-linux/u-boot/1_2020.04-r0/git/configs'. Unable to fetch URL from any source.
  ERROR: Logfile of failure stored in: /home/bhargav/RPI3/Build/poky/build/tmp/work/raspberrypi3_64-poky-linux/u-boot/1_2020.04-r0/temp/log.do_fetch.13694
  ERROR: Task (/home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot_2020.04.bb:do_fetch) failed with exit code '1'
  NOTE: Tasks Summary: Attempted 592 tasks of which 591 didn't need to be rerun and 1 failed.
  
  Summary: 1 task failed:
    /home/bhargav/RPI3/Build/poky/meta/recipes-bsp/u-boot/u-boot_2020.04.bb:do_fetch
  Summary: There was 1 WARNING message shown.
  Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
  </code></pre>
  
  <p>So what am I missing here ? I'm using a raspberry pi 3B+ . </p>