Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,31 @@ This layer depends on:

## Quick Start with kas

1. Install kas build tool from PyPi (sudo pip3 install kas)
2. Set the `machine: ` in kas-poky-rpi.yml to one of the supported boards (see conf/machine/*.conf)
3. kas build meta-raspberrypi/kas-poky-rpi.yml
4. Use bmaptool to copy the generated .wic.bz2 file to the SD card
5. Boot your RPI
1. Install the kas build tool from PyPI:

To adjust the build configuration with specific options (I2C, SPI, ...), simply add
a section as follows:
```
pip3 install kas
```

2. Select the appropriate machine configuration file from `kas/`
(for example `raspberrypi4.yml`, `raspberrypi3-64.yml`, etc.)

3. Run the build:

```
kas build meta-raspberrypi/kas/<machine>.yml
```

4. Use `bmaptool` to copy the generated `.wic.bz2` image to the SD card

5. Boot your Raspberry Pi

The kas configuration is split into a shared `base.yml` and per-machine
configuration files. Machine selection is done by choosing the appropriate
kas file rather than editing a `machine` variable.

To adjust the build configuration with specific options (I2C, SPI, etc.),
extend the configuration by adding a `local_conf_header` section, for example:

```
local_conf_header:
Expand All @@ -92,10 +109,16 @@ local_conf_header:
RPI_EXTRA_CONFIG = "dtoverlay=disable-bt"
```

To configure the machine, you have to update the `machine` variable.
And the same for the `distro`.
Additional configurations can be layered by including extra kas files. For example,
to enable runtime testing with `testimage`:

```
kas build meta-raspberrypi/kas/raspberrypi4.yml:meta-raspberrypi/kas/testimage.yml
```

For further details, see the kas documentation:
https://kas.readthedocs.io/en/latest/index.html

For further information, you can read more at <https://kas.readthedocs.io/en/latest/index.html>

## Contributing

Expand Down
3 changes: 0 additions & 3 deletions conf/layer.conf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small note: this file change will clash with PR #1593 - which I think also has a good chance to be accepted (similar to this). It looks like a fly-by improvement in both PRs, though this one seems to be a bit more complete (due to the change in rpi-default-settings.inc also) - ping @JianpengChang

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think relevant part of PR 1593 is incomplete, as the parselogs_rpi.py is not removed. That file is no longer relevant, as OE Core changes 2+ years ago, and parselogs now uses txt files to indicate ignores.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice the oe-core commit. My changes do have defects — please ignore the related parts.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ BBFILES_DYNAMIC += " \
meta-python:${LAYERDIR}/dynamic-layers/meta-python/*/*/*.bb \
meta-python:${LAYERDIR}/dynamic-layers/meta-python/*/*/*.bbappend \
"

DEFAULT_TEST_SUITES:remove:rpi = "parselogs"
DEFAULT_TEST_SUITES:append:rpi = " parselogs_rpi"
6 changes: 0 additions & 6 deletions conf/machine/include/rpi-default-settings.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# RaspberryPi BSP default settings

IMAGE_CLASSES += "sdcard_image-rpi"

# RPI kernel has errors of its own which should be filtered
# therefore use parselogs_rpi test instead of parselogs from oe-core
#
DEFAULT_TEST_SUITES:append:rpi = " parselogs_rpi"
DEFAULT_TEST_SUITES:remove:rpi = " parselogs"
18 changes: 18 additions & 0 deletions conf/machine/raspberrypi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,21 @@ UBOOT_MACHINE = "rpi_config"
SERIAL_CONSOLES ?= "115200;ttyAMA0"

ARMSTUB ?= "armstub.bin"

#
# Below are variables ONLY needed for running with Yocto/OE's runqemu script
#
IMAGE_CLASSES += "qemuboot"

QB_SYSTEM_NAME = "qemu-system-arm"
QB_MACHINE = "-machine raspi1ap"
QB_MEM = "-m 512"
QB_DTB = "bcm2708-rpi-b-plus.dtb"
QB_NETWORK_DEVICE = "-device usb-net,netdev=net0,mac=@MAC@"
QB_KERNEL_ROOT = "/dev/sda"
# The dwc_otg.fiq_fsm_enable setting is necessary to get USB devices (both disk and net) working. Without this, boot hangs
# The initcall_blacklist=bcm2835_pm_driver_init is needed to workaround boot issues. Seems like the PM HW emulation isn't present
QB_KERNEL_CMDLINE_APPEND = "rootwait initcall_blacklist=bcm2835_pm_driver_init earlycon=pl011,0x20201000 dwc_otg.fiq_fsm_enable=0"
QB_RNG = ""
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device usb-storage,drive=disk0"
QB_DEFAULT_FSTYPE = "ext3"
18 changes: 18 additions & 0 deletions conf/machine/raspberrypi0.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,21 @@ MACHINEOVERRIDES =. "raspberrypi:"
include conf/machine/raspberrypi.conf

SERIAL_CONSOLES ?= "115200;ttyAMA0"

#
# Below are variables ONLY needed for running with Yocto/OE's runqemu script
#
IMAGE_CLASSES += "qemuboot"

QB_SYSTEM_NAME = "qemu-system-arm"
QB_MACHINE = "-machine raspi0"
QB_MEM = "-m 512"
QB_DTB = "bcm2708-rpi-zero.dtb"
QB_NETWORK_DEVICE = "-device usb-net,netdev=net0,mac=@MAC@"
QB_KERNEL_ROOT = "/dev/sda"
# The dwc_otg.fiq_fsm_enable setting is necessary to get USB devices (both disk and net) working. Without this, boot hangs
# The initcall_blacklist=bcm2835_pm_driver_init is needed to workaround boot issues. Seems like the PM HW emulation isn't present
QB_KERNEL_CMDLINE_APPEND = "rootwait initcall_blacklist=bcm2835_pm_driver_init earlycon=pl011,0x20201000 dwc_otg.fiq_fsm_enable=0"
QB_RNG = ""
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device usb-storage,drive=disk0"
QB_DEFAULT_FSTYPE = "ext3"
9 changes: 5 additions & 4 deletions conf/machine/raspberrypi2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ QB_SYSTEM_NAME = "qemu-system-arm"
QB_MACHINE = "-machine raspi2b"
QB_MEM = "-m 1024"
QB_DTB = "bcm2709-rpi-2-b.dtb"
QB_NET = "none"
QB_KERNEL_ROOT = "/dev/mmcblk0"
QB_KERNEL_CMDLINE_APPEND = "rootwait"
QB_NETWORK_DEVICE = "-device usb-net,netdev=net0,mac=@MAC@"
QB_KERNEL_ROOT = "/dev/sda"
# The dwc_otg.fiq_fsm_enable setting is necessary to get USB devices (both disk and net) working. Without this, boot hangs
QB_KERNEL_CMDLINE_APPEND = "rootwait earlycon=pl011,0x3f201000 dwc_otg.fiq_fsm_enable=0"
QB_RNG = ""
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=sd,format=raw"
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device usb-storage,drive=disk0"
QB_DEFAULT_FSTYPE = "ext3"
16 changes: 16 additions & 0 deletions conf/machine/raspberrypi3-64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ SERIAL_CONSOLES ?= "115200;ttyS0"

VC4DTBO ?= "vc4-fkms-v3d"
ARMSTUB ?= "armstub8.bin"

#
# Below are variables ONLY needed for running with Yocto/OE's runqemu script
#
IMAGE_CLASSES += "qemuboot"

QB_SYSTEM_NAME = "qemu-system-aarch64"
QB_MACHINE = "-machine raspi3b"
QB_MEM = "-m 1024"
QB_DTB = "bcm2837-rpi-3-b.dtb"
QB_NETWORK_DEVICE = "-device usb-net,netdev=net0,mac=@MAC@"
QB_KERNEL_ROOT = "/dev/sda"
QB_KERNEL_CMDLINE_APPEND = "rootwait earlycon=pl011,0x3f201000"
QB_RNG = ""
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device usb-storage,drive=disk0"
QB_DEFAULT_FSTYPE = "ext3"
16 changes: 16 additions & 0 deletions conf/machine/raspberrypi4-64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,19 @@ KERNEL_IMAGETYPE_DIRECT ?= "Image"
KERNEL_BOOTCMD ?= "booti"

ARMSTUB ?= "armstub8-gic.bin"

#
# Below are variables ONLY needed for running with Yocto/OE's runqemu script
#
IMAGE_CLASSES += "qemuboot"

QB_SYSTEM_NAME = "qemu-system-aarch64"
QB_MACHINE = "-machine raspi4b"
QB_MEM = "-m 2048"
QB_DTB = "bcm2711-rpi-4-b.dtb"
QB_NETWORK_DEVICE = "-device usb-net,netdev=net0,mac=@MAC@"
QB_KERNEL_ROOT = "/dev/sda"
QB_KERNEL_CMDLINE_APPEND = "rootwait earlycon=pl011,mmio32,0xfe201000"
QB_RNG = ""
QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device usb-storage,drive=disk0"
QB_DEFAULT_FSTYPE = "ext3"
27 changes: 14 additions & 13 deletions kas-poky-rpi.yml → kas/base.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json
#
header:
version: 8
version: 14

machine: raspberrypi4
machine: unset
distro: poky
target:
- core-image-base

defaults:
repos:
branch: master

repos:
meta-raspberry:

bitbake:
url: https://git.openembedded.org/bitbake
path: layers/bitbake
branch: master
layers:
bitbake: disabled

openembedded-core:
url: https://git.openembedded.org/openembedded-core
path: layers/openembedded-core
branch: master
layers:
meta:

meta-yocto:
url: https://git.yoctoproject.org/meta-yocto
path: layers/meta-yocto
branch: master
layers:
meta-poky:
meta-yocto-bsp:

meta-openembedded:
url: http://git.openembedded.org/meta-openembedded
path: layers/meta-openembedded
branch: master
layers:
meta-oe:
meta-python:
Expand All @@ -44,16 +45,20 @@ repos:
meta-qt5:
url: https://github.com/meta-qt5/meta-qt5/
path: layers/meta-qt5
branch: master

env:
BB_LOGCONFIG: ""
BB_HASHSERVE: "auto"

bblayers_conf_header:
standard: |
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""

local_conf_header:
reduce_diskspace: |
INHERIT += "rm_work_and_downloads"
INHERIT += "rm_work"
standard: |
CONF_VERSION = "2"
PACKAGE_CLASSES = "package_rpm"
Expand All @@ -72,7 +77,3 @@ local_conf_header:
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
license: |
# Uncomment next line to allow the license
# See: linux-firmware-rpidistro in docs/ipcompliance.md
#LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
8 changes: 8 additions & 0 deletions kas/raspberrypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

machine: raspberrypi
8 changes: 8 additions & 0 deletions kas/raspberrypi0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

machine: raspberrypi0
8 changes: 8 additions & 0 deletions kas/raspberrypi2-64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

machine: raspberrypi2-64
8 changes: 8 additions & 0 deletions kas/raspberrypi2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

machine: raspberrypi2
14 changes: 14 additions & 0 deletions kas/raspberrypi3-64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

local_conf_header:
license: |
# Uncomment next line to allow the license
# See: linux-firmware-rpidistro in docs/ipcompliance.md
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"

machine: raspberrypi3-64
14 changes: 14 additions & 0 deletions kas/raspberrypi3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

local_conf_header:
license: |
# Uncomment next line to allow the license
# See: linux-firmware-rpidistro in docs/ipcompliance.md
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"

machine: raspberrypi3
14 changes: 14 additions & 0 deletions kas/raspberrypi4-64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

local_conf_header:
license: |
# Uncomment next line to allow the license
# See: linux-firmware-rpidistro in docs/ipcompliance.md
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"

machine: raspberrypi4-64
14 changes: 14 additions & 0 deletions kas/raspberrypi4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14
includes:
- kas/base.yml

local_conf_header:
license: |
# Uncomment next line to allow the license
# See: linux-firmware-rpidistro in docs/ipcompliance.md
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"

machine: raspberrypi4
28 changes: 28 additions & 0 deletions kas/testimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json

header:
version: 14

local_conf_header:
testimage: |
IMAGE_CLASSES += "testimage"
TESTIMAGE_AUTO = "1"
# Don't testimage initramfs
TESTIMAGE_AUTO:pn-core-image-initramfs-boot = "0"
kvm: |
QEMU_USE_KVM = ""
slirp: |
TEST_RUNQEMUPARAMS = "slirp"
sshd: |
IMAGE_FEATURES += "ssh-server-dropbear"
sshkeys: |
CORE_IMAGE_EXTRA_INSTALL += "ssh-pregen-hostkeys"
sshpregen: |
# Allow the use of the pregen keys as this is CI so safe
COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi = "raspberrypi"
COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi0 = "raspberrypi0"
COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi2 = "raspberrypi2"
COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi3-64 = "raspberrypi3-64"
COMPATIBLE_MACHINE:pn-ssh-pregen-hostkeys:raspberrypi4-64 = "raspberrypi4-64"
failing_tests: |
TEST_SUITES:remove = "parselogs"
12 changes: 0 additions & 12 deletions lib/oeqa/runtime/cases/parselogs_rpi.py

This file was deleted.

Loading