Preparing a release configuration Yocto image (for Raspberry Pi)
IMAGE_LINGUAS = " "
IMAGE_FEATURES += "read-only-rootfs"
IMAGE_INSTALL += "\
packagegroup-core-boot \
kernel-module-xxx \
busybox-udhcpc \
ntpdate \
ncurses \
"
IMAGE_ROOTFS_SIZE="0"
IMAGE_OVERHEAD_FACTOR="1.15"
IMAGE_ROOTFS_EXTRA_SPACE="1"
RPI_KERNEL_DEVICETREE_OVERLAYS = ""
RPI_KERNEL_DEVICETREE ?= " \
bcm2710-rpi-3-b.dtb \
bcm2710-rpi-3-b-plus.dtb \
bcm2711-rpi-4-b.dtb \
bcm2710-rpi-cm3.dtb \
bcm2711-rpi-cm4.dtb \
"
No need to have all the possible dtb overlays on the boot partition. Just explicitly list the models that need to be supported.
WKS_FILE = "sdimage-xxx.wks"
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 128 --overhead-factor 1.1
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 128
SERIAL_CONSOLES_CHECK = ""
SERIAL_CONSOLES = ""
USE_VT = "0"
Disabling run time serial consoles check is required for the read-only rootfs, but disabling consoles sure reduces attack surface and might also save some space as well.
DISTRO_FEATURES="ipv4 zeroconf vfat sysvinit"
MACHINE_FEATURES:remove="apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
NO_RECOMMENDATIONS = "1"
Comments
Post a Comment