diff --git a/homeassistant-supervised/DEBIAN/control b/homeassistant-supervised/DEBIAN/control old mode 100644 new mode 100755 diff --git a/homeassistant-supervised/DEBIAN/postinst b/homeassistant-supervised/DEBIAN/postinst index 60ce26e..24d5670 100755 --- a/homeassistant-supervised/DEBIAN/postinst +++ b/homeassistant-supervised/DEBIAN/postinst @@ -3,6 +3,7 @@ set -e function info { echo -e "\e[32m[info] $*\e[39m"; } function warn { echo -e "\e[33m[warn] $*\e[39m"; } function error { echo -e "\e[31m[error] $*\e[39m"; exit 1; } +. /usr/share/debconf/confmodule ARCH=$(uname -m) BINARY_DOCKER=/usr/bin/docker @@ -44,19 +45,32 @@ case $ARCH in ;; "arm" |"armv6l") if [ -z $MACHINE ]; then - error "Please set machine for $ARCH" + db_input critical ha/machine-type | true + db_go || true + db_get ha/machine-type || true + MACHINE="$RET" + db_stop fi HASSIO_DOCKER="$DOCKER_REPO/armhf-hassio-supervisor" ;; "armv7l") if [ -z $MACHINE ]; then - error "Please set machine for $ARCH" + db_input critical ha/machine-type | true + db_go || true + db_get ha/machine-type || true + MACHINE="$RET" + db_stop fi HASSIO_DOCKER="$DOCKER_REPO/armv7-hassio-supervisor" ;; "aarch64") if [ -z $MACHINE ]; then - error "Please set machine for $ARCH" + db_input critical ha/machine-type | true + db_go || true + db_get ha/machine-type || true + MACHINE="$RET" + db_stop + fi HASSIO_DOCKER="$DOCKER_REPO/aarch64-hassio-supervisor" ;; diff --git a/homeassistant-supervised/DEBIAN/templates b/homeassistant-supervised/DEBIAN/templates new file mode 100755 index 0000000..ff9cda4 --- /dev/null +++ b/homeassistant-supervised/DEBIAN/templates @@ -0,0 +1,4 @@ +Template: ha/machine-type +Type: Select +Choices: generic-x86-64, odroid-c2, odroid-n2, odroid-xu, qemuarm, qemuarm-64, qemux86, qemux86-64, raspberrypi, raspberrypi2, raspberrypi3, raspberrypi4, raspberrypi3-64, raspberrypi4-64, tinker, khadas-vim3 +Description: Select machine type \ No newline at end of file