* Use skopeo to download container images Separate container download from image build. This will allow to share the downloaded images between multiple builds. We won't store the Supervisor container with the version tag, just with the latest tag. This allows to simplify the procedure a bit. It seems there is no downside to this approach. * Use official Docker in Docker images to build data partition Instead of building our own Debian based image let's use the official Docker in Docker image. This avoids building an image for the hassio data partition and speeds up build as well. This calls mount commands using sudo to mount the data partition as part of the buildroot build now. This is not much different from before as mount has been called as root inside the container, essentially equates to the same "isolation" level. * Use image digest as part of the file name The landing page has no version information in the tag. To avoid potentially source caching issues, use the digest as part of the file name.
36 lines
1.2 KiB
Makefile
36 lines
1.2 KiB
Makefile
################################################################################
|
|
#
|
|
# HAOS
|
|
#
|
|
################################################################################
|
|
|
|
HASSIO_VERSION = 1.0.0
|
|
HASSIO_LICENSE = Apache License 2.0
|
|
HASSIO_LICENSE_FILES = $(BR2_EXTERNAL_HASSOS_PATH)/../LICENSE
|
|
HASSIO_SITE = $(BR2_EXTERNAL_HASSOS_PATH)/package/hassio
|
|
HASSIO_SITE_METHOD = local
|
|
HASSIO_VERSION_URL = "https://version.home-assistant.io/stable.json"
|
|
|
|
HASSIO_CONTAINER_IMAGES_ARCH = supervisor dns audio cli multicast observer core
|
|
|
|
define HASSIO_CONFIGURE_CMDS
|
|
# Deploy only landing page for "core" by setting version to "landingpage"
|
|
curl -s $(HASSIO_VERSION_URL) | jq '.core = "landingpage"' > $(@D)/stable.json
|
|
|
|
$(Q)mkdir -p $(@D)/images
|
|
$(Q)mkdir -p $(HASSIO_DL_DIR)
|
|
$(foreach image,$(HASSIO_CONTAINER_IMAGES_ARCH),\
|
|
$(BR2_EXTERNAL_HASSOS_PATH)/package/hassio/fetch-container-image.sh \
|
|
$(BR2_PACKAGE_HASSIO_ARCH) $(BR2_PACKAGE_HASSIO_MACHINE) $(@D)/stable.json $(image) "$(HASSIO_DL_DIR)" "$(@D)/images"
|
|
)
|
|
|
|
endef
|
|
|
|
HASSIO_INSTALL_IMAGES = YES
|
|
|
|
define HASSIO_INSTALL_IMAGES_CMDS
|
|
$(BR2_EXTERNAL_HASSOS_PATH)/package/hassio/create-data-partition.sh "$(@D)" "$(BINARIES_DIR)"
|
|
endef
|
|
|
|
$(eval $(generic-package))
|