mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 02:56:31 +00:00
Move HassIO away from resinos
This commit is contained in:
parent
45601ed2cd
commit
c9681f03c7
14
README.md
14
README.md
@ -1,13 +1,17 @@
|
|||||||
# HassIO
|
# 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
|
# History
|
||||||
|
|
||||||
- **0.1**: First techpreview with dumy supervisor
|
- **0.1**: First techpreview with dumy supervisor
|
||||||
- **0.2**: Support now OTA updates (Need reflush from 0.1)
|
- **0.2**: Support now OTA updates (Need reflush from 0.1)
|
||||||
|
|
||||||
# Download Image:
|
## Developer access to ResinOS host
|
||||||
https://drive.google.com/drive/folders/0B2o1Uz6l1wVNbFJnb2gwNXJja28?usp=sharing
|
|
||||||
|
|
||||||
## Developer access to 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
|
You can put your authorized_keys file into boot partition. After a boot it, you can acces to your device over ssh port 22222
|
||||||
|
@ -61,7 +61,8 @@ def initialize_logging():
|
|||||||
|
|
||||||
def check_environment():
|
def check_environment():
|
||||||
"""Check if all environment are exists."""
|
"""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:
|
try:
|
||||||
os.environ[key]
|
os.environ[key]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -34,14 +34,6 @@ class CoreConfig(object):
|
|||||||
CONF_HOMEASSISTANT_TAG: '',
|
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):
|
def save(self):
|
||||||
"""Store data to config file."""
|
"""Store data to config file."""
|
||||||
try:
|
try:
|
||||||
@ -66,16 +58,6 @@ class CoreConfig(object):
|
|||||||
self._data[CONF_HOMEASSISTANT_TAG] = value
|
self._data[CONF_HOMEASSISTANT_TAG] = value
|
||||||
self.save()
|
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
|
@property
|
||||||
def path_config_docker(self):
|
def path_config_docker(self):
|
||||||
"""Return config path extern for docker."""
|
"""Return config path extern for docker."""
|
||||||
|
@ -19,4 +19,5 @@ do_install_append () {
|
|||||||
install -d ${D}${sysconfdir}/resin-supervisor
|
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:@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:@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 rm --force resin_supervisor || true
|
||||||
docker run --privileged --name resin_supervisor \
|
docker run --privileged --name resin_supervisor \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
-v $CONFIG_PATH:/boot/config.json \
|
-v /var/run/hassio_hc.sock:/var/run/hassio_hc.sock \
|
||||||
-v $BOOT_MOUNTPOINT/system-connections/resin-sample:/boot/network \
|
|
||||||
-v /resin-data:/data \
|
-v /resin-data:/data \
|
||||||
-v /var/log/supervisor-log:/var/log \
|
-v /var/log/supervisor-log:/var/log \
|
||||||
-e DOCKER_SOCKET=/var/run/docker.sock \
|
-e DOCKER_SOCKET=/var/run/docker.sock \
|
||||||
|
-e HASSIO_HC_SOCKET=/var/run/hassio_hc.sock \
|
||||||
-e SUPERVISOR_SHARE=/resin-data \
|
-e SUPERVISOR_SHARE=/resin-data \
|
||||||
-e SUPERVISOR_NAME=resin_supervisor \
|
-e SUPERVISOR_NAME=resin_supervisor \
|
||||||
-e HOMEASSISTANT_REPOSITORY=${HOMEASSISTANT_REPOSITORY} \
|
-e HOMEASSISTANT_REPOSITORY=${HOMEASSISTANT_REPOSITORY} \
|
||||||
|
@ -3,3 +3,4 @@ SUPERVISOR_TAG=@SUPERVISOR_TAG@
|
|||||||
LED_FILE=@LED_FILE@
|
LED_FILE=@LED_FILE@
|
||||||
MACHINE=@MACHINE@
|
MACHINE=@MACHINE@
|
||||||
HOMEASSISTANT_REPOSITORY=@HOMEASSISTANT_REPOSITORY@
|
HOMEASSISTANT_REPOSITORY=@HOMEASSISTANT_REPOSITORY@
|
||||||
|
RESINOS_VERSION=@RESINOS_VERSION@
|
||||||
|
@ -70,7 +70,7 @@ function error_handler {
|
|||||||
|
|
||||||
trap 'error_handler $LINENO' ERR
|
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
|
image_name=$SUPERVISOR_IMAGE
|
||||||
|
|
||||||
# Check that we didn't somehow get an empty tag version.
|
# 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
|
# load config
|
||||||
source /usr/sbin/resin-vars
|
source /usr/sbin/resin-vars
|
||||||
source /etc/resin-supervisor/supervisor.conf
|
source /etc/resin-supervisor/supervisor.conf
|
||||||
source /etc/hassio.conf
|
|
||||||
|
|
||||||
# Check that HostOS version was provided
|
# Check that HostOS version was provided
|
||||||
if [ -z "$HOSTOS_VERSION" ]; then
|
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
|
HOSTOS_VERSION=$version
|
||||||
else
|
else
|
||||||
log ERROR "--hostos-version is required."
|
log ERROR "--hostos-version is required."
|
||||||
@ -221,15 +220,15 @@ if [ "$LOG" == "yes" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if update is needed
|
# Check if update is needed
|
||||||
log "Detected HassIO version: $HASSIO_VERSION ."
|
log "Detected HassIO version: $RESINOS_VERSION ."
|
||||||
log "Update HassIO to version: $HOSTOS_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."
|
log "Version $HOSTOS_VERSION is already installed."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# protect downgrade
|
# 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
|
if [ $downgrade == 1 ]; then
|
||||||
log ERROR "Downgrade are not supported"
|
log ERROR "Downgrade are not supported"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
```bash
|
```bash
|
||||||
docker run --privileged --name resin_supervisor \
|
docker run --privileged --name resin_supervisor \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
-v $CONFIG_PATH:/boot/config.json \
|
-v /var/run/hassio_hc.sock:/var/run/hassio_hc.sock \
|
||||||
-v $BOOT_MOUNTPOINT/system-connections/resin-sample:/boot/network \
|
|
||||||
-v /resin-data:/data \
|
-v /resin-data:/data \
|
||||||
-v /var/log/supervisor-log:/var/log \
|
-v /var/log/supervisor-log:/var/log \
|
||||||
-e DOCKER_SOCKET=/var/run/docker.sock \
|
-e DOCKER_SOCKET=/var/run/docker.sock \
|
||||||
|
-e HASSIO_HC_SOCKET=/var/run/hassio_hc.sock \
|
||||||
-e SUPERVISOR_SHARE=/resin-data \
|
-e SUPERVISOR_SHARE=/resin-data \
|
||||||
-e SUPERVISOR_NAME=resin_supervisor \
|
-e SUPERVISOR_NAME=resin_supervisor \
|
||||||
-e HOMEASSISTANT_REPOSITORY=${HOMEASSISTANT_REPOSITORY} \
|
-e HOMEASSISTANT_REPOSITORY=${HOMEASSISTANT_REPOSITORY} \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"supervisor_tag": "20170322",
|
"hassio_tag": "20170322",
|
||||||
"homeassistant_tag": "0.40.1",
|
"homeassistant_tag": "0.40.1",
|
||||||
"hassio_version": "0.2",
|
"resinos_version": "2.0.0-rc5",
|
||||||
"resinhup_version": "0.1"
|
"resinhup_version": "0.1"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"supervisor_tag": "20170322",
|
"hassio_tag": "20170322",
|
||||||
"homeassistant_tag": "0.40.1",
|
"homeassistant_tag": "0.40.1",
|
||||||
"hassio_version": "0.2",
|
"resinos_version": "2.0.0-rc5",
|
||||||
"resinhup_version": "0.1"
|
"resinhup_version": "0.1"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user