| Message ID | 20250225100912.1623970-1-adam.duskett@amarulasolutions.com |
|---|---|
| State | Accepted |
| Delegated to: | Julien Olivain |
| Headers | show |
| Series | [1/2] board/mender/x86_64/post-build.sh: fix device_type location | expand |
On 25/02/2025 11:09, Adam Duskett wrote: > 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> Series applied to master, thanks.
diff --git a/board/mender/x86_64/post-build.sh b/board/mender/x86_64/post-build.sh index 5e6967ebd1..9e909e9281 100755 --- a/board/mender/x86_64/post-build.sh +++ b/board/mender/x86_64/post-build.sh @@ -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 "${@}"
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> --- board/mender/x86_64/post-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)