Generic x86_64

The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.

Changelog

  • 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 :test_works: :test_works:
2019.11.1 :test_works: :test_works:
2020.02 :test_works: :test_works:

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

Set the Buildroot tag you are building for:

export BR2_TAG="2020.02"

Clone or download buildroot:

git clone git://git.buildroot.net/buildroot -b ${BR2_TAG}

Clone this repository:

git clone https://github.com/aduskett/buildroot-mender-configs.git -b x86_66

Change directory to buildroot:

cd buildroot

copy all files from buildroot-mender-configs:

cp -rf ../buildroot-mender-configs/* ./

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

In the root buildroot directory, type make menuconfig and go to System configuration
At the bottom of the screen is the field: Extra arguments passed to custom scripts
Change --generate-mender-image=false to --generate-mender-image=true

You may wish to change --build-version=2019.11.1 to a version that best suits your particular needs, as this option changes the mender version information.

Then re-run

make

The mender file will automatically be generated after the build is complete, which can be found in output/images/

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 4.1.1 on Fedora 31

2 Likes

Not sure why but I don’t have edit access here. It looks like the command to clone the buildroot-mender-configs repo chopped of the last character in the branch name.

Also, the instructions for configuring the Mender server are not correct; they seem to be assuming Yocto.

It was not posted as a wiki, updated. Should be able to edit now

Edit: It was not @aduskett fault, and was a setting missing in this category to make posts “wiki” by default

Thanks for the feedback! I fixed both issues.

1 Like

All;

I updated the x86_64 branch to work with Buildroot 2019.11.1 and 2020.02 and added a changelog at the top of the OP.

1 Like