board/mender/x86_64/post-build.sh: fix device_type location

Currently, the post-build.sh script adds device_type to /var/lib/mender,
however, this doesn't work for two reasons:
 1) /data/ mounts to /var/lib/mender
 2) The device_type location in mender.conf points to /etc/mender/device_type.

This leads to an error during the bootstrap process because mender reads the
default device_type file installed by mender.mk in /etc/mender, leading to the
following error:

```
Error while handling bootstrap Artifact, continuing: invalid bootstrap
Artifact: readHeaderV3: handleHeaderReads: image
(device types [buildroot-x86_64]) not compatible with device BUILDROOT_DEVICE
```

Set the creation of the device_type file in board/mender/x86_64/post-build.sh
to /etc/mender/device_type to fix the error.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Adam Duskett
2025-02-25 11:09:11 +01:00
committed by Julien Olivain
parent b19976abc9
commit 14a7e99b6d

View File

@@ -42,7 +42,7 @@ mender_fixup() {
main() {
parse_args "${@}"
mender_fixup
echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/var/lib/mender/device_type"
echo "device_type=${DEVICE_TYPE}" > "${TARGET_DIR}/etc/mender/device_type"
}
main "${@}"