1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-05-08 17:08:36 +01:00

Move HassIO away from resinos

This commit is contained in:
pvizeli
2017-03-28 09:34:59 +02:00
parent 45601ed2cd
commit c9681f03c7
12 changed files with 26 additions and 39 deletions
+9 -5
View File
@@ -1,13 +1,17 @@
# HassIO
First private cloud OS for home automation. Based on ResinOS and Yocto Linux.
First private cloud OS for home automation.
It is a docker image (supervisor) they manage HomeAssistant docker and give a interface to controll itself over UI. It have a own eco system with addons to extend the functionality in a easy way.
# Hardware Image
Based on ResinOS and Yocto Linux. It have a preinstall HassIO supervisor and support OTA Updates. That make it maintenanceless.
https://drive.google.com/drive/folders/0B2o1Uz6l1wVNbFJnb2gwNXJja28?usp=sharing
# History
- **0.1**: First techpreview with dumy supervisor
- **0.2**: Support now OTA updates (Need reflush from 0.1)
# Download Image:
https://drive.google.com/drive/folders/0B2o1Uz6l1wVNbFJnb2gwNXJja28?usp=sharing
## Developer access to host
## Developer access to ResinOS host
You can put your authorized_keys file into boot partition. After a boot it, you can acces to your device over ssh port 22222
+2 -1
View File
@@ -61,7 +61,8 @@ def initialize_logging():
def check_environment():
"""Check if all environment are exists."""
for key in ('SUPERVISOR_SHARE', 'SUPERVISOR_NAME', 'DOCKER_SOCKET'):
for key in ('SUPERVISOR_SHARE', 'SUPERVISOR_NAME', 'DOCKER_SOCKET',
'HOMEASSISTANT_REPOSITORY'):
try:
os.environ[key]
except KeyError:
-18
View File
@@ -34,14 +34,6 @@ class CoreConfig(object):
CONF_HOMEASSISTANT_TAG: '',
})
# update version
self._data.update({
CONF_SUPERVISOR_IMAGE: os.environ['SUPERVISOR_IMAGE'],
CONF_SUPERVISOR_TAG: os.environ['SUPERVISOR_TAG'],
})
self.save()
def save(self):
"""Store data to config file."""
try:
@@ -66,16 +58,6 @@ class CoreConfig(object):
self._data[CONF_HOMEASSISTANT_TAG] = value
self.save()
@property
def supervisor_image(self):
"""Return docker supervisor repository."""
return self._data.get(CONF_SUPERVISOR_IMAGE)
@property
def supervisor_tag(self):
"""Return docker supervisor tag."""
return self._data.get(CONF_SUPERVISOR_TAG)
@property
def path_config_docker(self):
"""Return config path extern for docker."""
@@ -19,4 +19,5 @@ do_install_append () {
install -d ${D}${sysconfdir}/resin-supervisor
sed -i -e 's:@HOMEASSISTANT_REPOSITORY@:${HOMEASSISTANT_REPOSITORY}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf
sed -i -e 's:@MACHINE@:${MACHINE}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf
sed -i -e 's:@RESINOS_VERSION@:${HOSTOS_VERSION}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf
}
@@ -10,11 +10,11 @@ runSupervisor() {
docker rm --force resin_supervisor || true
docker run --privileged --name resin_supervisor \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $CONFIG_PATH:/boot/config.json \
-v $BOOT_MOUNTPOINT/system-connections/resin-sample:/boot/network \
-v /var/run/hassio_hc.sock:/var/run/hassio_hc.sock \
-v /resin-data:/data \
-v /var/log/supervisor-log:/var/log \
-e DOCKER_SOCKET=/var/run/docker.sock \
-e HASSIO_HC_SOCKET=/var/run/hassio_hc.sock \
-e SUPERVISOR_SHARE=/resin-data \
-e SUPERVISOR_NAME=resin_supervisor \
-e HOMEASSISTANT_REPOSITORY=${HOMEASSISTANT_REPOSITORY} \
@@ -3,3 +3,4 @@ SUPERVISOR_TAG=@SUPERVISOR_TAG@
LED_FILE=@LED_FILE@
MACHINE=@MACHINE@
HOMEASSISTANT_REPOSITORY=@HOMEASSISTANT_REPOSITORY@
RESINOS_VERSION=@RESINOS_VERSION@
@@ -70,7 +70,7 @@ function error_handler {
trap 'error_handler $LINENO' ERR
if tag=$(curl --silent $ENDPOINT | jq -e -r '.supervisor_tag'); then
if tag=$(curl --silent $ENDPOINT | jq -e -r '.hassio_tag'); then
image_name=$SUPERVISOR_IMAGE
# Check that we didn't somehow get an empty tag version.
@@ -1 +0,0 @@
HASSIO_VERSION=@HASSIO_VERSION@
@@ -194,11 +194,10 @@ done
# load config
source /usr/sbin/resin-vars
source /etc/resin-supervisor/supervisor.conf
source /etc/hassio.conf
# Check that HostOS version was provided
if [ -z "$HOSTOS_VERSION" ]; then
if version=$(curl --silent $ENDPOINT | jq -e -r '.hassio_version'); then
if version=$(curl --silent $ENDPOINT | jq -e -r '.resinos_version'); then
HOSTOS_VERSION=$version
else
log ERROR "--hostos-version is required."
@@ -221,15 +220,15 @@ if [ "$LOG" == "yes" ]; then
fi
# Check if update is needed
log "Detected HassIO version: $HASSIO_VERSION ."
log "Detected HassIO version: $RESINOS_VERSION ."
log "Update HassIO to version: $HOSTOS_VERSION ."
if [ $HASSIO_VERSION == $HOSTOS_VERSION ]; then
if [ $RESINOS_VERSION == $HOSTOS_VERSION ]; then
log "Version $HOSTOS_VERSION is already installed."
exit 0
fi
# protect downgrade
downgrade=$(awk -vn1=$HASSIO_VERSION -vn2=$HOSTOS_VERSION 'BEGIN{print (n1<n2) ? 0:1}')
downgrade=$(awk -vn1=$RESINOS_VERSION -vn2=$HOSTOS_VERSION 'BEGIN{print (n1<n2) ? 0:1}')
if [ $downgrade == 1 ]; then
log ERROR "Downgrade are not supported"
exit 0
+2 -2
View File
@@ -4,11 +4,11 @@
```bash
docker run --privileged --name resin_supervisor \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $CONFIG_PATH:/boot/config.json \
-v $BOOT_MOUNTPOINT/system-connections/resin-sample:/boot/network \
-v /var/run/hassio_hc.sock:/var/run/hassio_hc.sock \
-v /resin-data:/data \
-v /var/log/supervisor-log:/var/log \
-e DOCKER_SOCKET=/var/run/docker.sock \
-e HASSIO_HC_SOCKET=/var/run/hassio_hc.sock \
-e SUPERVISOR_SHARE=/resin-data \
-e SUPERVISOR_NAME=resin_supervisor \
-e HOMEASSISTANT_REPOSITORY=${HOMEASSISTANT_REPOSITORY} \
+2 -2
View File
@@ -1,6 +1,6 @@
{
"supervisor_tag": "20170322",
"hassio_tag": "20170322",
"homeassistant_tag": "0.40.1",
"hassio_version": "0.2",
"resinos_version": "2.0.0-rc5",
"resinhup_version": "0.1"
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"supervisor_tag": "20170322",
"hassio_tag": "20170322",
"homeassistant_tag": "0.40.1",
"hassio_version": "0.2",
"resinos_version": "2.0.0-rc5",
"resinhup_version": "0.1"
}