Problem
Previously, we were using the beaglebone-yocto
machine type in our Yocto build for both BeagleBone Green and BeagleBoneGreen Gateway boards. At some point we were forced to override the machine type and instead create a separate machine configuration for each of these boards. This was done using the MACHINE_OVERRIDES
configuration variable so now we have bbg-beaglebone-yocto
and bbgg-beaglebone-yocto
machine types.
We then build our images using bitbake
bitbake mc:bbg-beaglebone-yocto:core-image-base
bitbake mc:bbgg-beaglebone-yocto:core-image-base
Then artifacts are generated for each
mender-artifact write rootfs-image \
--artifact-name bbg-os \
--device-type bbg-beaglebone-yocto \
--file tmp/deploy/images/bbg-beaglebone-yocto/out.ext4
mender-artifact write rootfs-image \
--artifact-name bbgg-os \
--device-type bbgg-beaglebone-yocto \
--file tmp/deploy/images/bbgg-beaglebone-yocto/out.ext4
The problem is that our artifacts were previously generated with the device-type
of beaglebone-yocto
but we want to update our devices with their machine-specific artifact.
Expected Outcome
What we need is some way to generate these new artifacts such that we can deploy bbg-beaglebone-yocto
to a device that currently has the device type of beaglebone-yocto
. This deployment should also update the device’s Device Type
in Mender to reflect the device type of the artifact.
We have attempted to solve this problem by adding beaglebone-yocto
as an additional --device-type
when generating our new artifacts (see command below). This allows us to install the new rootfs-image to our device however it does not actually update the device-type
of the device in Mender.
mender-artifact write rootfs-image \
--artifact-name bbgg-os \
--device-type bbgg-beaglebone-yocto \
--device-type beaglebone-yocto \
--file tmp/deploy/images/bbgg-beaglebone-yocto/out.ext4
The MENDER_DEVICE_TYPE
variable in our Yocto configuration is reporting the correct new value so that shouldn’t be the issue. (Found this using bitbake -e
)
/var/lib/mender/device_type
on the device itself is also still reporting beaglebone-yocto
instead of the new device type.
Is there any way to solve this problem without having to manually update /var/lib/mender/device_type
on the boards after deploying the new rootfs-image artifact?