diff --git a/install/README.md b/install/README.md new file mode 100644 index 0000000..cd7d37e --- /dev/null +++ b/install/README.md @@ -0,0 +1,18 @@ +# Install HassIO + +That is only if you want run HassIO on a generic system without our yocto images. + +## Run + +Run as root: +```bash +curl -sL | bash - +``` + +On a special platform they need set a machine type use: +```bash +curl -sL | bash - -m MY_MACHINE +``` + +## HomeAssistant docker images +On a i386 or amd64 it will use automatic the generic image for that platform. You can also use a specific docker image for that platform. diff --git a/install/hassio_install b/install/hassio_install new file mode 100644 index 0000000..607a5b1 --- /dev/null +++ b/install/hassio_install @@ -0,0 +1,57 @@ +#!/bin/bash + +ARCH=$(uname -m) +DOCKER_REPO=pvizeli + +# Parse command line parameters +while [[ $# > 0 ]]; do + arg="$1" + + case $arg in + -m|--machine) + if [ -z "$2" ]; then + echo "[ERROR] \"$1\" argument needs a value" + fi + MACHINE=$2 + shift + ;; + *) + echo "[ERROR] Unrecognized option $1" + ;; + esac + shift +done + +# Generate hardware options +case $ARCH in + "i386" | "i686") + MACHINE=${MACHINE:=qemux86} + HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant" + HASSIO_DOCKER="$DOCKER_REPO/i386-hassio-supervisor" + ;; + "x86_64") + MACHINE=${MACHINE:=qemux86-64} + HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant" + HASSIO_DOCKER="$DOCKER_REPO/amd64-hassio-supervisor" + ;; + "arm" | "armv7l") + if [ -z $MACHINE ]; then + echo "[ERROR] Please set machine for $ARCH" + exit 1 + fi + HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant" + HASSIO_DOCKER="$DOCKER_REPO/armhf-hassio-supervisor" + ;; + "aarch64") + if [ -z $MACHINE ]; then + echo "[ERROR] Please set machine for $ARCH" + exit 1 + fi + HOMEASSISTANT_DOCKER="$DOCKER_REPO/$MACHINE-homeassistant" + HASSIO_DOCKER="$DOCKER_REPO/aarch64-hassio-supervisor" + ;; + *) + echo "[ERROR] $ARCH unknown!" + exit 1 + ;; +esac