Add machine specific landingpage container at build time (#949)

The landingpage container is a minimal webserver with built-in zeroconf
annoucement. Preinstall the machine specific landingpage container to
make sure it will show up right after startup.
This commit is contained in:
Stefan Agner
2020-11-02 13:35:00 +01:00
committed by GitHub
parent ac942b8ed9
commit 737a6f18c3
16 changed files with 29 additions and 1 deletions

View File

@@ -13,4 +13,9 @@ config BR2_PACKAGE_HASSIO_ARCH
help
Supervisor architecture which should be pull.
config BR2_PACKAGE_HASSIO_MACHINE
string "Supervisor Machine"
help
Machine to pull containers for (used for landing page).
endif

View File

@@ -2,6 +2,7 @@
set -e
ARCH=
MACHINE=
DATA_IMG="/export/data.ext4"
VERSION_URL="https://version.home-assistant.io/stable.json"
APPARMOR_URL="https://version.home-assistant.io/apparmor.txt"
@@ -14,6 +15,10 @@ while [[ $# -gt 0 ]]; do
ARCH=$2
shift
;;
--machine)
MACHINE=$2
shift
;;
*)
exit 1
;;
@@ -27,6 +32,7 @@ AUDIO="homeassistant/${ARCH}-hassio-audio"
CLI="homeassistant/${ARCH}-hassio-cli"
MULTICAST="homeassistant/${ARCH}-hassio-multicast"
OBSERVER="homeassistant/${ARCH}-hassio-observer"
LANDINGPAGE="homeassistant/${MACHINE}-homeassistant:landingpage"
SUPERVISOR_VERSION=$(curl -s ${VERSION_URL} | jq -e -r '.supervisor')
DNS_VERSION=$(curl -s ${VERSION_URL} | jq -e -r '.dns')
@@ -76,6 +82,9 @@ docker pull "${AUDIO}:${AUDIO_VERSION}"
docker pull "${MULTICAST}:${MULTICAST_VERSION}"
docker pull "${OBSERVER}:${OBSERVER_VERSION}"
# Install landing page
docker pull "${LANDINGPAGE}"
# Setup AppArmor
mkdir -p "/mnt/data/supervisor/apparmor"
curl -sL -o "/mnt/data/supervisor/apparmor/hassio-supervisor" "${APPARMOR_URL}"

View File

@@ -19,7 +19,8 @@ define HASSIO_INSTALL_TARGET_CMDS
-e BUILDER_UID="$(shell id -u)" -e BUILDER_GID="$(shell id -g)" \
-v $(BINARIES_DIR):/export \
hassos-hostapps \
--arch $(BR2_PACKAGE_HASSIO_ARCH)
--arch $(BR2_PACKAGE_HASSIO_ARCH) \
--machine $(BR2_PACKAGE_HASSIO_MACHINE)
endef
$(eval $(generic-package))