Hello! I have a Yocto (Kirkstone) build for Raspberry Pi Zero 2W with Mender integrated. File and folder updates work fine, but rootfs updates do not. The rootfs file (ext4) does get written to the second partition (/dev/mmcblk0p3) correctly, but the system still boots from the first rootfs partition (/dev/mmcblk0p2).
It appears that the boot command line (/boot/efi/cmdline.txt) is not being written properly. It is always:
dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
I believe that this should be updated to /dev/mmcblk0p3 (or some environment variable).
Any ideas?
Thank you.
Hi @rubinstu,
Thanks for reaching out! So, in a standard Mender setup for Yocto on a Raspberry Pi, cmdline
does not provide the root partition. That is chosen by u-boot
, based on the current update state which is stored in the environment.
I have just given that a test build and validation run, and it seems to work as expected, with the one minor nitpick that I used scarthgap
as I don’t have a kirkstone
build ready at the moment.
So are you building something similar to meta-mender-community/kas/raspberrypi0-2w-64.yml at scarthgap · TheYoctoJester/meta-mender-community · GitHub? Can you give scarthgap
a try eventually?
Also sharing the relevant parts of your local.conf
, MACHINE and DISTRO might be helpful.
Greetz,
Josef
Josef, thanks for your response. I started from scratch using scarthgap (not Kirkstone) so we’re in sync.
I had one specific problem that I think fixed; my deployment was using Grub and not U-Boot. Adding this:
RPI_USE_U_BOOT = "1"
to local.conf switched the bootloader. But the problem still persists.
One thing I noticed is that in some examples, people include “meta-mender-raspberrypi” in bblayers. There is no such layer in the scarthgap branch of meta-mender. (It does exist in kirkstone.) Do we need "“meta-mender-raspberrypi”?
I tried the example using Kas from the community build, but I kind of made a mess of it. I think the instructions assume some things that I’m not clear on.
Here is an excerpt from my bblayers:
BBLAYERS ?= " \
/home/stuart/rpi-yocto/poky-scarthgap/meta \
/home/stuart/rpi-yocto/poky-scarthgap/meta-poky \
/home/stuart/rpi-yocto/poky-scarthgap/meta-yocto-bsp \
/home/stuart/rpi-yocto/poky-scarthgap/meta-raspberrypi \
/home/stuart/rpi-yocto/poky-scarthgap/meta-openembedded/meta-oe \
/home/stuart/rpi-yocto/poky-scarthgap/meta-openembedded/meta-python \
/home/stuart/rpi-yocto/poky-scarthgap/meta-openembedded/meta-networking \
/home/stuart/rpi-yocto/poky-scarthgap/meta-openembedded/meta-multimedia \
/home/stuart/rpi-yocto/poky-scarthgap/meta-ns-test \
/home/stuart/rpi-yocto/poky-scarthgap/meta-mender/meta-mender-core \
/home/stuart/rpi-yocto/poky-scarthgap/meta-mender/meta-mender-demo \
"
And highlights from local.conf:
MACHINE ??= "raspberrypi0-2w-64"
INIT_MANAGER = "systemd"
# Remove old images after builds
RM_OLD_IMAGE = "1"
ENABLE_UART = "1"
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
INHERIT += "extrausers"
IMAGE_INSTALL:append = " sudo"
# Default user name
USER_NAME = "nsuser"
PASSWD = "xxxxxxxxxxxxxxx"
EXTRA_USERS_PARAMS:append = "\
useradd -u 1200 -d /home/${USER_NAME} -s /bin/sh -p '${PASSWD}' ${USER_NAME}; \
usermod -a -G sudo ${USER_NAME}; \
"
# Add support for wifi and bluetooth
IMAGE_INSTALL:append = " linux-firmware-bcm43430 kernel-modules udev-rules-rpi"
# Add Networking
DISTRO_FEATURES:append = " bluez5 bluetooth wifi"
IMAGE_INSTALL:append = " linux-firmware-bcm43430 bluez5 i2c-tools python3-smbus bridge-utils hostapd iptables wpa-supplicant networkmanager"
# Mender Stuff
MENDER_EFI_LOADER = ""
MENDER_BOOT_PART_SIZE_MB = "64"
MENDER_STORAGE_TOTAL_SIZE_MB = "4096"
ARTIFACTIMG_FSTYPE = "ext4"
MENDER_ARTIFACT_NAME = "release-2"
INHERIT += " mender-full"
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "xxxxxxxxxxxxxxxx"
RPI_USE_U_BOOT = "1"
MENDER_BOOT_PART_SIZE_MB = "100"
# Deploy Image
IMAGE_FSTYPES += " sdimg rpi-sdimg"
Built with:
$ bitbake core-image-minimal
Thanks for the help!
Hi @rubinstu,
So you’re missing two things.
- the
meta-mender-raspberrypi
layer from meta-mender-community
, which brings the required patches to the u-boot
config, as well as correct setting for MENDER_EFI_LOADER
- the corresponding
MENDER_FEATURES
configuration:
IMAGE_INSTALL:append = " kernel-image kernel-devicetree"
IMAGE_FSTYPES:remove = " rpi-sdimg"
Those are noted in https://github.com/mendersoftware/meta-mender-community/kas/include/raspberrypi.yml.
If you add those, I’d expect the board to work right away.
Greetz,
Josef
Josef, this was exactly what was missing:
- meta-mender-raspberrypi layer (which I knew about but wasn’t completely clear on the details)
- “kernel-image kernel-devicetree” additions.
It’s working great now. Thank you!
1 Like