-
Clone necessary repos
- Poky : https://github.com/yoctoproject/poky
- RaspberryPI : git://git.yoctoproject.org/meta-raspberrypi
- Navigate inside each of these repo directories, then checkout
scarthgapbranch
-
Create build container by running following commands
- Navigate to project directory in terminal
docker build -t poky-dev .
-
Run the built container using following command
docker run --rm -it -e LOCAL_UID=$(id -u) -e LOCAL_GID=$(id -g) -v $(pwd):$(pwd):Z poky-dev- This will run the container in interactive mode
-
Navigate to the project directory inside container(same directory path as the host project directory)
-
Navigate to poky project directory and run following commands
source oe-init-build-env- This will create build direcotry and navigate inside it.
- open conf/local.conf and set
MACHINEas needed- For qemu emulation image, set to
qemux86_64 - For raspberrypi, set to
raspberrypi
- For qemu emulation image, set to
-
Navigate back to poky/build directory
- Run
bitbake core-image-minimalto build the image
- Run
-
Once build is complete, image will be available under
poky/build/tmp/deploy/images/qemux86-64directory
This repository includes a helper script yocto-setup.sh to simplify the Docker build and Yocto build flow.
Examples:
- Build the Docker image:
./yocto-setup.sh docker-build
- Start an interactive build container:
./yocto-setup.sh shell
- Build the default Yocto image inside the container:
./yocto-setup.sh build
- Build a Raspberry Pi image:
./yocto-setup.sh build raspberrypi core-image-minimal
Available commands:
clone [branch]— clonepokyandmeta-raspberrypirepositories, default branchscarthgapdocker-build— build thepoky-devDocker imageshell— run an interactive container with the repository mountedbuild [machine] [image]— runbitbakeinside the containerall [branch]— clone repos and build the Docker image