Files
operating-system/buildroot-external/rootfs-overlay/usr/libexec/hassos-persists
Stefan Agner 39debca9fc Fix U-Boot environment handling (#1001)
* Use /run as default location for lock files for U-Boot tools

While there is a command line parameter to set the lock file explicitly,
there are other tools invoking fw_setenv (in particular rauc) which do
not set the lock file. Using /run by default makes fw_setenv use the
correct lock file in all situations.

* Don't explicitly set lock file location

Since we patch U-Boot tools to use /run by default setting it explicitly
is unnecessary.
2020-11-17 15:15:50 +01:00

31 lines
681 B
Bash
Executable File

#!/bin/sh
set -e
MACHINE_ID=$(cat /etc/machine-id)
###
# u-boot
if [ -e /usr/sbin/fw_setenv ]; then
# machine-id
if [ "$(fw_printenv -n MACHINE_ID)" != "${MACHINE_ID}" ]; then
echo "[INFO] set machine-id to ${MACHINE_ID}"
fw_setenv MACHINE_ID "${MACHINE_ID}"
else
echo "[INFO] machine-id is okay"
fi
###
# Barebox
else
# machine-id
if [ "$(barebox-state -g state.machine_id -i /etc/barebox-state.dtb)" != "${MACHINE_ID}" ]; then
echo "[INFO] set machine-id to ${MACHINE_ID}"
barebox-state -s "state.machine_id=${MACHINE_ID}" -i /etc/barebox-state.dtb
else
echo "[INFO] machine-id is okay"
fi
fi