Generic x86_64

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 :test_works: :test_works:
2019.11.1 :test_works: :test_works:
2020.02.x :test_works: :test_works:
2023.02.x :test_works: :test_works:
2023.11 :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

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
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

Hi,

I’ve just tried to follow the guide using “2020.02” but ‘make’ exits with an error when compiling like below. The same apply for “2019.11.1” but with a different error (Kernel headers expected 5.3.x but got 5.5.x). Is that something anyone has seen before?

Regards Peter

/home/mint/buildroot/output/host/bin/x86_64-buildroot-linux-uclibc-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -ansi -fomit-frame-pointer -fstack-protector-strong -W -Wall -Wunreachable-code -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -D_XOPEN_SOURCE -D_GNU_SOURCE -DVERSION="" -c -o consoles.o consoles.c
/home/mint/buildroot/output/host/lib/gcc/x86_64-buildroot-linux-uclibc/8.3.0/…/…/…/…/x86_64-buildroot-linux-uclibc/bin/ld: cannot find -lssp_nonshared
/home/mint/buildroot/output/host/lib/gcc/x86_64-buildroot-linux-uclibc/8.3.0/…/…/…/…/x86_64-buildroot-linux-uclibc/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit status
: recipe for target ‘killall5’ failed
make[1]: *** [killall5] Error 1
make[1]: *** Waiting for unfinished jobs…
make[1]: Leaving directory ‘/home/mint/buildroot/output/build/sysvinit-2.96/src’
package/pkg-generic.mk:266: recipe for target ‘/home/mint/buildroot/output/build/sysvinit-2.96/.stamp_built’ failed
make: *** [/home/mint/buildroot/output/build/sysvinit-2.96/.stamp_built] Error 2

This is extremely old but I feel obligated to reply (partially to bump this thread as well)
mender_x86_64_efi_defconfig is now included in mainline buildroot and should work out of the box.

I have a pending patch set to bump all the mender packages to their latest versions as well!

1 Like

Thanks a lot @aduskett! Blunt question, care to drop a link to the revision after merge here so we have a defined state for further reference?

Greetz,
Josef