* Allow easy move data partition * Cleanup handling systemd * Improve handling * fix pipeline * pipeline * fix shell handling * fix scripts * Add bin folder * fix lint * Fix service handling * Fix loading * hide output * Fix handling
31 lines
681 B
Bash
Executable File
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
|