Rename hassos to haos (#1213)

* Change HASSOS_ID from hassos to haos

Use a rauc install-check hook to make this update compatible with OS
releases using hassos in the compatible string.

* Use home-assistant as organization in CPE_NAME

Align with Home Assistant core which uses home-assistant with a dash as
organization in CPE_NAME.
This commit is contained in:
Stefan Agner 2021-03-09 15:27:12 +01:00 committed by GitHub
parent 28e3b109b7
commit 66e5ea3b4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 4 deletions

View File

@ -33,7 +33,7 @@ $(TARGETS_CONFIG): %-config:
$(TARGETS): %: $(RELEASE_DIR) %-config
@echo "build $@"
$(MAKE) -C $(BUILDROOT) BR2_EXTERNAL=$(BUILDROOT_EXTERNAL) VERSION_DEV=$(VERSION_DEV)
cp -f $(O)/images/hassos_* $(RELEASE_DIR)/
cp -f $(O)/images/haos_* $(RELEASE_DIR)/
# Do not clean when building for one target
ifneq ($(words $(filter $(TARGETS),$(MAKECMDGOALS))), 1)

View File

@ -2,6 +2,6 @@ VERSION_MAJOR=6
VERSION_BUILD=0
HASSOS_NAME="Home Assistant OS"
HASSOS_ID="hassos"
HASSOS_ID="haos"
DEPLOYMENT="development"

View File

@ -2,7 +2,28 @@
##
# Hooks
env
case "$1" in
install-check)
if [ "$RAUC_MF_COMPATIBLE" = "$RAUC_SYSTEM_COMPATIBLE" ]; then
exit 0
fi
# Be compatible with hassos OS ID
# shellcheck disable=SC2039
rauc_os_compatible=${RAUC_MF_COMPATIBLE/haos-/hassos-}
if [ "$rauc_os_compatible" = "$RAUC_SYSTEM_COMPATIBLE" ]; then
exit 0
fi
echo "Compatible does not match!" 1>&2
exit 10
;;
slot-install)
# Use install handlers below
;;
*)
exit 1
;;
esac
# Handle boot hocks
if [ "${RAUC_SLOT_CLASS}" = "boot" ]; then

View File

@ -32,6 +32,7 @@ function create_ota_update() {
echo "version=$(hassos_version)"
echo "[hooks]"
echo "filename=hook"
echo "hooks=install-check"
echo "[image.boot]"
echo "filename=boot.vfat"
echo "hooks=install"

View File

@ -26,7 +26,7 @@ install_hassos_cli
echo "ID=${HASSOS_ID}"
echo "VERSION_ID=$(hassos_version)"
echo "PRETTY_NAME=\"${HASSOS_NAME} $(hassos_version)\""
echo "CPE_NAME=cpe:2.3:o:home_assistant:${HASSOS_ID}:$(hassos_version):*:${DEPLOYMENT}:*:*:*:${BOARD_ID}:*"
echo "CPE_NAME=cpe:2.3:o:home-assistant:${HASSOS_ID}:$(hassos_version):*:${DEPLOYMENT}:*:*:*:${BOARD_ID}:*"
echo "HOME_URL=https://hass.io/"
echo "VARIANT=\"${HASSOS_NAME} ${BOARD_NAME}\""
echo "VARIANT_ID=${BOARD_ID}"