Files
Jan Čermák 5511610ae4 Harmonize hassos/HassOS naming to haos across the tree (#4740)
* Harmonize systemd unit and helper-script prefixes to haos (#4725)

Rename the hassos-prefixed systemd units and their ExecStart helper
binaries to a consistent haos- prefix, and update all in-repo
references. Normalize the affected unit Description= strings as well.

Units renamed in this commit are not referred externally (except for
syslog identifiers used in Supervisor Host logs), so no other changes
should be needed.

* Rename hassos-config to haos-config with alias

Rename the hassos-config.service unit and its binary to the haos-
prefix. This unit is restarted by Supervisor in os/manager.py, so add
Alias= to avoid the need to try both variants there.

* Rename hassos-cli binary to haos-cli

* Change HassOS to HAOS in unit descriptions and comments

* Rename hassos->haos in Buildroot makefiles, scripts and configs

* Rename bootargs_hassos to bootargs_haos in U-Boot scripts

* Rename external Buildroot tree HASSOS to HAOS

Set external.desc name to HAOS and rename all BR2_EXTERNAL_HASSOS_PATH
references to BR2_EXTERNAL_HAOS_PATH accordingly.

* Rename hassos.conf service drop-ins to haos.conf

* Rename hassos.config kernel fragment to haos.config

* Rename hassos-blobs repo in package/bluetooth-rtl8723

The repo was renamed somewhere in the past and it now relies on an
internal GitHub redirect. Change the URL to match the new repo name.
2026-06-01 23:25:43 +02:00

41 lines
1.2 KiB
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
###
# GRUB
elif [ -e /usr/bin/grub-editenv ]; then
GRUBENV_FILE="$(grep '^grubenv=' < /etc/rauc/system.conf | cut -d= -f2)"
# machine-id
if [ "$(/usr/bin/grub-editenv "$GRUBENV_FILE" list | grep '^MACHINE_ID=' | cut -d= -f2)" != "${MACHINE_ID}" ]; then
echo "[INFO] set machine-id to ${MACHINE_ID}"
/usr/bin/grub-editenv "$GRUBENV_FILE" set "MACHINE_ID=${MACHINE_ID}"
else
echo "[INFO] machine-id is okay"
fi
else
if ! grep -q "systemd.machine_id=${MACHINE_ID}" /mnt/boot/cmdline.txt; then
echo "[INFO] set machine-id to ${MACHINE_ID}"
if sed -i "s/systemd.machine_id=[0-9a-fA-F]*/systemd.machine_id=${MACHINE_ID}/" /mnt/boot/cmdline.txt; then
sed -i "1 s/$/ systemd.machine_id=${MACHINE_ID}/" /mnt/boot/cmdline.txt
fi
else
echo "[INFO] machine-id is okay"
fi
fi