The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.
Changelog
-
December 18th 2023:
- Rewrite as mender_x86_64_efi_defconfig is included in Buildroot mainline.
-
March 2nd, 2020:
- Bump kernel version to 5.5.7
- Move the board files form board/mender to board/mender/x86_64
- Refactored the post-build and post-image scripts.
- Add the four arguments to the post-build and post-image scripts.
- Update genimage-efi.cfg to ensure that all partitions line up properly.
- Update the readme.txt file to reflect the script argument changes.
- Added a “Emulation in qemu” section.
- Changed the data-part partition format from Fat32 to Ext4
- Added 2019.11.1 and 2020.02 to the Tests results.
- Removed 2019.11 from the Test results.
Board description
Generic X86_64 demonstration
Test results
The Buildroot Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other releases.
Buildroot | Build | Runtime |
---|---|---|
2019.08.2 | ||
2019.11.1 | ||
2020.02.x | ||
2023.02.x | ||
2023.11 |
Build Means that the Buildroot build using this Mender integration completes without errors and outputs images.
Runtime Means that Mender has been verified to work on the board. For U-Boot-based boards, the integration checklist has been verified.
Getting started
Prerequisites
- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Buildroot Manual
- NOTE. Instructions depend on which Buildroot version you intend to use.
Configuring the build
Setup Buildroot environment
Download the Buildroot version you want from here
Change directory to buildroot
:
cd buildroot
Configure build environment
Configure Buildroot:
make mender_x86_64_efi_defconfig
Configure Mender server URL (optional)
This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in Standalone deployments, due to lack of server configuration.
You can edit the board/mender/x86_64/overlay/etc/mender/mender.conf
file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using.
Build for Hosted Mender:
ServerURL = "https://hosted.mender.io"
TenantToken = "<copy token here>"
Build for Mender demo server:
ServerURL = "192.168.0.100"
Building the image
You can now proceed with building an image:
make
Using the build output
After a successful build, the images and build artifacts are placed in buildroot/output/images
The disk image sdcard.sdimg is used to provision the device storage for devices without Mender running already. Please proceed to the official documentation on provisioning a new device for steps to do this.
On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the Mender Artifact files, which have .mender
suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments.
Created a mender artifact
The mender artifact is automatically created in output/images/buildroot-x86_64-1.0.mender
### Emulation in qemu
========================
Run the emulation with:
qemu-system-x86_64 \
-M pc \
-bios </path/to/OVMF_CODE.fd> \
-drive file=output/images/disk.img,if=virtio,format=raw \
-net nic,model=virtio \
-net user
Note that </path/to/OVMF.fd> needs to point to a valid x86_64 UEFI
firmware image for qemu. It may be provided by your distribution as an
edk2 or OVMF package, in a path such as /usr/share/edk2/ovmf/OVMF_CODE.fd.
Optional arguments:
- -enable-kvm to speed up qemu. This requires a loaded kvm module on the host
system.
- Add -smp N to emulate an SMP system with N CPUs.
The login prompt will appear in the serial window.
Tested with QEMU 8.1.92 on Fedora 39