# Report BSP
# Picar 4wd image for Raspberry Pi 3 B+
## Download Dunfell
``git clone -b dunfell git://git.yoctoproject.org/poky.git && cd poky``
## Download meta-raspberrypi
``git clone git://git.yoctoproject.org/meta-raspberrypi -b dunfell``
## Untar our meta-picar-4wd
``tar -xzvf GISTRE2022_Picar4wd_ArthurCohen_MartinSchmidt_EstebanBlanc.tar.gz && cp -r GISTRE2022_Picar4wd_ArthurCohen_MartinSchmidt_EstebanBlanc/meta-picar-4wd ./``
## Create build-rpi build environment
``source poky/oe-init-build-env build-rpi``
## Add layer to build environment
``bitbake-layers add-layer ../meta-raspberrypi/ && bitbake-layers add-layer ../meta-picar-4wd/``
Use ``bitbake-layers show-layers`` to see if it worked
## Build the image
``MACHINE=raspberrypi3 bitbake picar-4wd-image``
# meta-picar-4wd content
```
$ tree meta-picar-4wd
../meta-picar-4wd/
├── conf
│ ├── distro
│ │ └── picar-4wd.conf
│ └── layer.conf
├── COPYING.MIT
├── README
├── recipes-core
│ └── images
│ └── picar-4wd-image.bb
├── recipes-devtools
│ └── python
│ ├── files
│ │ └── 0001-fix-lib-for-yocto.patch
│ └── python3-picar-4wd_416dfc6c381fd9f5d25d54aa785c46e8e9a27834.bb
└── recipes-example
└── python3-picar-4wd-examples
├── files
│ └── 0001-add-shebang-on-examples.patch
└── python3-picar-4wd-examples_416dfc6c381fd9f5d25d54aa785c46e8e9a27834.bb
```
## conf/distro/picar-4wd.conf
This file create a new distribution. It also enable I2C support on the Raspberry Pi.
## recipes-core/images/picar-4wd-image.bb
This file create a new image recipe. We have added OpenSSH and our picar-4wd packages to our image, and enabled creation of an rpi-sdimg file to be able to flash it on an sdcard more easily
## recipes-devtools/python/python3-picar-4wd_...bb
This is the recipe for the picar-4wd python module. We have added a patch (in the files directory) to fix the hardcoded config file location and stop the lib from trying to use apt in order to install its own dependency. We then installed the dependencies using RDEPENDS
## recipes-example/python3-picar-4wd-examples/python3-picar-4wd-examples_...bb
This is the recipe for the picar-4wd examples. Using do_install we can copy the examples to ``/usr/bin``