diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..06a2ae0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "meta-hassio"] + path = meta-hassio + url = https://github.com/pvizeli/meta-resin + branch = hassio diff --git a/build-scripts/resinos-build/create_resinos.sh b/build-scripts/resinos-build/create_resinos.sh index 0fa567d..1976480 100755 --- a/build-scripts/resinos-build/create_resinos.sh +++ b/build-scripts/resinos-build/create_resinos.sh @@ -20,8 +20,8 @@ cleanup() { trap 'cleanup fail' SIGINT SIGTERM # Sanity checks -if [ "$#" -ne 3 ]; then - echo "Usage: create_resinos.sh " +if [ "$#" -ne 2 ]; then + echo "Usage: create_resinos.sh " echo "Optional environment: BUILD_DIR, PERSISTENT_WORKDIR, HASSIO_META" exit 1 fi @@ -36,12 +36,12 @@ NAME="$1" case "$NAME" in "raspberrypi" | "raspberrypi2" | "raspberrypi3") RESIN_REPO="https://github.com/resin-os/resin-raspberrypi" - RESIN_BRANCH="v2.0.5+rev1" + RESIN_BRANCH="v2.0.8+rev1" MACHINE="$NAME" ;; "intel-nuc") RESIN_REPO="https://github.com/resin-os/resin-intel" - RESIN_BRANCH="v2.0.4+rev1" + RESIN_BRANCH="v2.0.9+rev1" MACHINE="intel-corei7-64" ;; *) @@ -51,15 +51,13 @@ case "$NAME" in esac HOMEASSISTANT_IMAGE="$DOCKER_REPO/$NAME-homeassistant" -HASSIO_VERSION=$2 -RESINOS_HASSIO_VERSION=$3 +RESINOS_HASSIO_VERSION=$2 PERSISTENT_WORKDIR=${PERSISTENT_WORKDIR:=~/yocto} BUILD_DIR=${BUILD_DIR:=$SCRIPTPATH} WORKSPACE=${BUILD_DIR:=$SCRIPTPATH}/resin-$MACHINE HASSIO_META=${HASSIO_ROOT:=$SCRIPTPATH/../..} DOWNLOAD_DIR=$PERSISTENT_WORKDIR/shared-downloads SSTATE_DIR=$PERSISTENT_WORKDIR/$MACHINE/sstate -RESIN_BRANCH=master echo "[INFO] Checkout repository" if [ ! -d "$WORKSPACE" ]; then @@ -68,13 +66,11 @@ if [ ! -d "$WORKSPACE" ]; then fi echo "[INFO] Inject HassIO yocto layer" -cp -fr $HASSIO_META/meta-hassio $WORKSPACE/layers/ -if [ ! -d $WORKSPACE/build/conf ]; then - sed -i 's%${TOPDIR}/../layers/meta-resin/meta-resin-common \\%${TOPDIR}/../layers/meta-resin/meta-resin-common \\\n${TOPDIR}/../layers/meta-hassio \\%g' $WORKSPACE/layers/*/conf/samples/bblayers.conf.sample -fi +rm -rf "$WORKSPACE/layers/meta-resin" +cp -rf "$HASSIO_META/meta-hassio" "$WORKSPACE/layers/meta-resin" # Additional variables -BARYS_ARGUMENTS_VAR="-a HASSIO_SUPERVISOR_TAG=$HASSIO_VERSION -a HASSIO_MACHINE=$NAME -a HOMEASSISTANT_IMAGE=$HOMEASSISTANT_IMAGE -a RESINOS_HASSIO_VERSION=$RESINOS_HASSIO_VERSION" +BARYS_ARGUMENTS_VAR="-a HASSIO_MACHINE=$NAME -a HOMEASSISTANT_IMAGE=$HOMEASSISTANT_IMAGE -a RESINOS_HASSIO_VERSION=$RESINOS_HASSIO_VERSION" # Make sure shared directories are in place mkdir -p $DOWNLOAD_DIR diff --git a/meta-hassio b/meta-hassio new file mode 160000 index 0000000..01917e7 --- /dev/null +++ b/meta-hassio @@ -0,0 +1 @@ +Subproject commit 01917e7589d297768db9b7e5128714657707ec11 diff --git a/meta-hassio/README.md b/meta-hassio/README.md deleted file mode 100644 index 7253a32..0000000 --- a/meta-hassio/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# ResinOS - HassIO Image -The image is based on ResinOS and Yocto Linux. It comes with the HassIO supervisor pre-installed. This includes support to update the supervisor over the air. After flashing your host OS will not require any more maintenance! The image does not include Home Assistant, instead it will downloaded when the image boots up for the first time. - -After extracting the archive, flash it to a drive using [Etcher](https://etcher.io/). - -## Configuring the image -You can configure the WiFi network that the image should connect to after flashing using [`resin-device-toolbox`](https://resinos.io/docs/raspberrypi3/gettingstarted/#install-resin-device-toolbox). - -## Developer access to ResinOS host -Create an `authorized_keys` file in the boot partition of your SD card with your public key. After a boot it, you can acces your device as root over ssh on port 22222. - -## Troubleshooting - -Read logoutput from supervisor: -```bash -journalctl -f -u resin-supervisor.service -docker logs homeassistant -``` diff --git a/meta-hassio/conf/layer.conf b/meta-hassio/conf/layer.conf deleted file mode 100644 index 21cf465..0000000 --- a/meta-hassio/conf/layer.conf +++ /dev/null @@ -1,10 +0,0 @@ -BBPATH .= ":${LAYERDIR}" - -BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ - ${LAYERDIR}/recipes-*/*/*.bbappend" - -BBFILE_COLLECTIONS += "hassio" -BBFILE_PATTERN_hassio = "^${LAYERDIR}/" - -LAYERVERSION_hassio = "1" -LAYERDEPENDS_hassio = "resin-common" diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend deleted file mode 100644 index a75aa50..0000000 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk.bbappend +++ /dev/null @@ -1,28 +0,0 @@ - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SUPERVISOR_REPOSITORY_armv5 = "homeassistant/armhf-hassio-supervisor" -SUPERVISOR_REPOSITORY_armv6 = "homeassistant/armhf-hassio-supervisor" -SUPERVISOR_REPOSITORY_armv7a = "homeassistant/armhf-hassio-supervisor" -SUPERVISOR_REPOSITORY_armv7ve = "homeassistant/armhf-hassio-supervisor" -SUPERVISOR_REPOSITORY_aarch64 = "homeassistant/aarch64-hassio-supervisor" -SUPERVISOR_REPOSITORY_x86 = "homeassistant/i386-hassio-supervisor" -SUPERVISOR_REPOSITORY_x86-64 = "homeassistant/amd64-hassio-supervisor" - -SUPERVISOR_TAG = "${HASSIO_SUPERVISOR_TAG}" -TARGET_REPOSITORY = "${SUPERVISOR_REPOSITORY}" -TARGET_TAG = "${SUPERVISOR_TAG}" - -SYSTEMD_AUTO_ENABLE = "enable" - -SYSTEMD_SERVICE_${PN}_remove = "update-resin-supervisor.timer" -SYSTEMD_SERVICE_${PN}_remove = "update-resin-supervisor.service" - -do_install_append () { - sed -i -e 's:@HOMEASSISTANT_IMAGE@:${HOMEASSISTANT_IMAGE}:g' ${D}${bindir}/start-resin-supervisor - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - rm -f ${D}${systemd_unitdir}/system/update-resin-supervisor.timer - rm -f ${D}${systemd_unitdir}/system/update-resin-supervisor.service - fi -} diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor deleted file mode 100644 index fc5fa29..0000000 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/start-resin-supervisor +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -e - -source /usr/sbin/resin-vars -source /etc/resin-supervisor/supervisor.conf - -SUPERVISOR_IMAGE_ID=$(docker inspect --format='{{.Id}}' $SUPERVISOR_IMAGE) -SUPERVISOR_CONTAINER_IMAGE_ID=$(docker inspect --format='{{.Image}}' resin_supervisor || echo "") - -runSupervisor() { - docker rm --force resin_supervisor || true - docker run --name resin_supervisor \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v /var/run/hassio-hc.sock:/var/run/hassio-hc.sock \ - -v /resin-data:/data \ - -v /var/log/supervisor-log:/var/log \ - -e SUPERVISOR_SHARE=/resin-data \ - -e SUPERVISOR_NAME=resin_supervisor \ - -e HOMEASSISTANT_REPOSITORY=@HOMEASSISTANT_IMAGE@ \ - ${SUPERVISOR_IMAGE} -} - -([ "$SUPERVISOR_IMAGE_ID" == "$SUPERVISOR_CONTAINER_IMAGE_ID" ] && docker start --attach resin_supervisor) || runSupervisor diff --git a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor b/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor deleted file mode 100644 index 31b0d9c..0000000 --- a/meta-hassio/recipes-containers/docker-disk/docker-resin-supervisor-disk/update-resin-supervisor +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -set -o pipefail - -USE_LOCAL=no - -# Help function -function update-resin-supervisor-help { - cat << EOF -Wrapper to run supervisor agent updates on resin distributions. -$0