1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-07-08 07:23:46 +01:00
Files
operating-system/buildroot-external/scripts/rauc.sh
T
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

63 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
set -e
function prepare_rauc_signing() {
local key="/build/key.pem"
local cert="/build/cert.pem"
if [ ! -f "${key}" ]; then
echo "Generating a self-signed certificate for development"
"${BR2_EXTERNAL_HAOS_PATH}"/scripts/generate-signing-key.sh "${cert}" "${key}"
fi
}
function write_rauc_config() {
mkdir -p "${TARGET_DIR}/etc/rauc"
local ota_compatible
ota_compatible="$(haos_rauc_compatible)"
export ota_compatible
export BOOTLOADER PARTITION_TABLE_TYPE BOOT_SPL
(
"${HOST_DIR}/bin/tempio" \
-template "${BR2_EXTERNAL_HAOS_PATH}/ota/system.conf.gtpl"
) > "${TARGET_DIR}/etc/rauc/system.conf"
}
function install_rauc_certs() {
local cert="/build/cert.pem"
if [ "${DEPLOYMENT}" == "development" ]; then
# Contains development and release certificate
cp "${BR2_EXTERNAL_HAOS_PATH}/ota/dev-ca.pem" "${TARGET_DIR}/etc/rauc/keyring.pem"
else
cp "${BR2_EXTERNAL_HAOS_PATH}/ota/rel-ca.pem" "${TARGET_DIR}/etc/rauc/keyring.pem"
fi
# Add local self-signed certificate (if not trusted by the dev or release
# certificate it is a self-signed certificate, dev-ca.pem contains both)
if ! openssl verify -CAfile "${BR2_EXTERNAL_HAOS_PATH}/ota/dev-ca.pem" -no-CApath "${cert}"; then
echo "Adding self-signed certificate to keyring."
openssl x509 -in "${cert}" -text >> "${TARGET_DIR}/etc/rauc/keyring.pem"
fi
}
function install_bootloader_config() {
if [ "${BOOTLOADER}" == "uboot" ]; then
# shellcheck disable=SC1117
echo -e "/dev/disk/by-partlabel/hassos-bootstate\t0x0000\t${BOOT_ENV_SIZE}" > "${TARGET_DIR}/etc/fw_env.config"
fi
# Fix MBR
if [ "${PARTITION_TABLE_TYPE}" == "mbr" ]; then
mkdir -p "${TARGET_DIR}/usr/lib/udev/rules.d"
cp -f "${BR2_EXTERNAL_HAOS_PATH}/bootloader/mbr-part.rules" "${TARGET_DIR}/usr/lib/udev/rules.d/"
fi
}