Compare commits
67 commits
Author | SHA1 | Date | |
---|---|---|---|
53f02b054b | |||
05589ace02 | |||
334571dfda | |||
82112b21af | |||
04b37541f6 | |||
77371e0157 | |||
ebf3df4952 | |||
c3b850ec4a | |||
cc2e332953 | |||
![]() |
4ce4bad3fa | ||
![]() |
c714207423 | ||
![]() |
f52ff8259e | ||
![]() |
1292ab7372 | ||
![]() |
f9375b5593 | ||
![]() |
05592309e6 | ||
![]() |
a140122c6c | ||
![]() |
6669bf6aca | ||
![]() |
c7848eec49 | ||
![]() |
ec41ff48be | ||
![]() |
8b1d7a3656 | ||
![]() |
9afc7a625e | ||
![]() |
f1ee897da5 | ||
![]() |
c787aa7bc0 | ||
![]() |
d531539877 | ||
![]() |
b345d3ee65 | ||
![]() |
c255defe1e | ||
![]() |
c99ffd00fc | ||
![]() |
77d549776c | ||
![]() |
13ffd23c36 | ||
![]() |
5b8fd2b0f4 | ||
![]() |
8f0a7f3808 | ||
![]() |
3dde6e9e90 | ||
![]() |
d7290e4a19 | ||
![]() |
8dbfda2221 | ||
![]() |
21a9d0b3f3 | ||
![]() |
4bc6a478a5 | ||
![]() |
724cbf2dfb | ||
![]() |
ba6a9d341c | ||
![]() |
5256c521f0 | ||
![]() |
2e5c669723 | ||
![]() |
aaed7d4370 | ||
![]() |
8b004cc97a | ||
![]() |
0b5838b847 | ||
![]() |
06671c39bd | ||
![]() |
15f4ab16c2 | ||
![]() |
9c6a021760 | ||
![]() |
923437fa7f | ||
![]() |
be8508f7ef | ||
![]() |
048a4dd86b | ||
![]() |
9eb7b0348b | ||
![]() |
d8af25272d | ||
![]() |
d135a92f6d | ||
![]() |
77ba930b84 | ||
![]() |
d5e5550703 | ||
![]() |
730bf01008 | ||
![]() |
becd4e691a | ||
![]() |
586b0a8554 | ||
![]() |
928b3abc34 | ||
![]() |
10b1819f05 | ||
![]() |
51a506a494 | ||
![]() |
3f64b3ff34 | ||
![]() |
2de4f4b6d0 | ||
![]() |
a3d1502f51 | ||
![]() |
3e8f78ff38 | ||
![]() |
76187a3e60 | ||
![]() |
c0cfcb3806 | ||
![]() |
0779e8d745 |
18 changed files with 334 additions and 73 deletions
6
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
6
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
|
@ -13,7 +13,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: OS Version
|
label: OS Version
|
||||||
description: Please Insert the output of `lsb_release -d`
|
description: Please Insert the output of `lsb_release -d`
|
||||||
placeholder: Debian GNU/Linux 11 (bullseye)
|
placeholder: Debian GNU/Linux 12 (bookworm)
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
|
@ -21,7 +21,7 @@ body:
|
||||||
attributes:
|
attributes:
|
||||||
label: System Information
|
label: System Information
|
||||||
description: Please Insert the output of `uname -a`
|
description: Please Insert the output of `uname -a`
|
||||||
placeholder: 'Linux ha-su-deb 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux'
|
placeholder: 'Linux ha 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux'
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
@ -46,6 +46,7 @@ body:
|
||||||
- generic-x86-64
|
- generic-x86-64
|
||||||
- khadas-vim3
|
- khadas-vim3
|
||||||
- odroid-c2
|
- odroid-c2
|
||||||
|
- odroid-c4
|
||||||
- odroid-n2
|
- odroid-n2
|
||||||
- odroid-xu
|
- odroid-xu
|
||||||
- qemuarm
|
- qemuarm
|
||||||
|
@ -58,6 +59,7 @@ body:
|
||||||
- raspberrypi3-64
|
- raspberrypi3-64
|
||||||
- raspberrypi4
|
- raspberrypi4
|
||||||
- raspberrypi4-64
|
- raspberrypi4-64
|
||||||
|
- raspberrypi5-64
|
||||||
- tinker
|
- tinker
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
12
.github/workflows/build-deb-pr.yml
vendored
12
.github/workflows/build-deb-pr.yml
vendored
|
@ -9,11 +9,15 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4.2.2
|
||||||
- run: chmod 555 homeassistant-supervised/DEBIAN/p*
|
- name: Build Debian Package in Docker
|
||||||
- run: dpkg-deb --build --root-owner-group homeassistant-supervised
|
run: |
|
||||||
|
docker run --rm -v $(pwd):/tmp debian:bookworm-slim bash -c \
|
||||||
|
"cd /tmp \
|
||||||
|
&& chmod 555 homeassistant-supervised/DEBIAN/p* \
|
||||||
|
&& dpkg-deb --build --root-owner-group homeassistant-supervised"
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: homeassistant-supervised.deb
|
name: homeassistant-supervised.deb
|
||||||
path: homeassistant-supervised.deb
|
path: homeassistant-supervised.deb
|
12
.github/workflows/build-deb.yml
vendored
12
.github/workflows/build-deb.yml
vendored
|
@ -11,11 +11,15 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4.2.2
|
||||||
- run: chmod 555 homeassistant-supervised/DEBIAN/p*
|
- name: Build Debian Package in Docker
|
||||||
- run: dpkg-deb --build --root-owner-group homeassistant-supervised
|
run: |
|
||||||
|
docker run --rm -v $(pwd):/tmp debian:bookworm-slim bash -c \
|
||||||
|
"cd /tmp \
|
||||||
|
&& chmod 555 homeassistant-supervised/DEBIAN/p* \
|
||||||
|
&& dpkg-deb --build --root-owner-group homeassistant-supervised"
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
files: homeassistant-supervised.deb
|
files: homeassistant-supervised.deb
|
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v5.2.0
|
- uses: actions/stale@v9.0.0
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: 60
|
days-before-stale: 60
|
||||||
|
|
17
.vscode/tasks.json
vendored
Normal file
17
.vscode/tasks.json
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build Debian Package",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "chmod 555 homeassistant-supervised/DEBIAN/p* && dpkg-deb --build --root-owner-group homeassistant-supervised",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "test",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
62
Hassio installer.txt
Normal file
62
Hassio installer.txt
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
INSTALLAZIONE HOME ASSISTEANT SUPERVISED
|
||||||
|
|
||||||
|
seguire il github https://github.com/home-assistant/supervised-installer
|
||||||
|
andare come utente root
|
||||||
|
su -
|
||||||
|
poi
|
||||||
|
|
||||||
|
apt install \
|
||||||
|
apparmor \
|
||||||
|
bluez \
|
||||||
|
cifs-utils \
|
||||||
|
curl \
|
||||||
|
dbus \
|
||||||
|
jq \
|
||||||
|
libglib2.0-bin \
|
||||||
|
lsb-release \
|
||||||
|
network-manager \
|
||||||
|
nfs-common \
|
||||||
|
systemd-journal-remote \
|
||||||
|
systemd-resolved \
|
||||||
|
udisks2 \
|
||||||
|
wget -y
|
||||||
|
|
||||||
|
e probabilmente vi verrà chiesto di riavviare per far funzionare NetworkManager al posto del normale programma di manager di debian
|
||||||
|
|
||||||
|
controllare che funzioni come scritto in https://wiki.debian.org/NetworkManager
|
||||||
|
|
||||||
|
nel file /etc/NetworkManager/NetworkManager.conf ci dovrà essere
|
||||||
|
|
||||||
|
[ifupdown]
|
||||||
|
managed=false
|
||||||
|
|
||||||
|
altrimenti settare come definito nel sito
|
||||||
|
|
||||||
|
il precedente file di configurazione si trova
|
||||||
|
/etc/network/interfaces
|
||||||
|
|
||||||
|
verificare se Docker-ce è installato con
|
||||||
|
|
||||||
|
docker -v
|
||||||
|
|
||||||
|
altrimenti installarlo con
|
||||||
|
|
||||||
|
curl -fsSL get.docker.com | sh
|
||||||
|
|
||||||
|
installare OS-Agent usando l'ultima versione da https://github.com/home-assistant/os-agent/releases/latest
|
||||||
|
|
||||||
|
wget https://github.com/home-assistant/os-agent/releases/download/1.6.0/os-agent_1.6.0_linux_aarch64.deb
|
||||||
|
sudo dpkg -i os-agent_1.6.0_linux_aarch64.deb
|
||||||
|
|
||||||
|
wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
|
||||||
|
BYPASS_OS_CHECK=true apt install ./homeassistant-supervised.deb
|
||||||
|
|
||||||
|
NOTE
|
||||||
|
verificare i servizi in systemd di Home assistant
|
||||||
|
|
||||||
|
haos-agent.service Home Assistant OS Agent
|
||||||
|
hassio-apparmor.service Hass.io AppArmor
|
||||||
|
hassio-supervisor.service Hass.io supervisor
|
||||||
|
|
||||||
|
es
|
||||||
|
systemctl status hassio-supervisor.service
|
98
README.md
98
README.md
|
@ -1,6 +1,8 @@
|
||||||
# This installation method is for advanced users only
|
# This installation method is for advanced users only
|
||||||
|
|
||||||
## Make sure you understand [the requirements](https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md)
|
### Make sure you understand [the requirements](https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md)
|
||||||
|
|
||||||
|
qui il file semplificato [Hassio installer.txt](Hassio%20installer.txt)
|
||||||
|
|
||||||
# Install Home Assistant Supervised
|
# Install Home Assistant Supervised
|
||||||
|
|
||||||
|
@ -17,39 +19,82 @@ Run the following commands as root (`su -` or `sudo su -` on machines with sudo
|
||||||
Step 1: Install the following dependencies with this command:
|
Step 1: Install the following dependencies with this command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
apt-get install \
|
apt install \
|
||||||
apparmor \
|
apparmor \
|
||||||
jq \
|
bluez \
|
||||||
wget \
|
cifs-utils \
|
||||||
curl \
|
curl \
|
||||||
udisks2 \
|
|
||||||
libglib2.0-bin \
|
|
||||||
network-manager \
|
|
||||||
dbus \
|
dbus \
|
||||||
systemd-journal-remote -y
|
jq \
|
||||||
|
libglib2.0-bin \
|
||||||
|
lsb-release \
|
||||||
|
network-manager \
|
||||||
|
nfs-common \
|
||||||
|
systemd-journal-remote \
|
||||||
|
systemd-resolved \
|
||||||
|
udisks2 \
|
||||||
|
wget -y
|
||||||
```
|
```
|
||||||
|
|
||||||
Step 2: Install Docker-CE with the following command:
|
If you haven't been using NetworkManager before, you might see instructions on how to let NetworkManager manage the current network interface.
|
||||||
|
|
||||||
|
### NetworkManager
|
||||||
|
|
||||||
|
probabilmente vi verrà chiesto di riavviare per far funzionare NetworkManager al posto del normale programma di manager di debian
|
||||||
|
|
||||||
|
controllare che funzioni come scritto in https://wiki.debian.org/NetworkManager
|
||||||
|
|
||||||
|
nel file ```/etc/NetworkManager/NetworkManager.conf``` ci dovrà essere
|
||||||
|
|
||||||
|
```
|
||||||
|
[ifupdown]
|
||||||
|
managed=false
|
||||||
|
```
|
||||||
|
|
||||||
|
altrimenti settare come definito nel sito
|
||||||
|
|
||||||
|
il precedente file di configurazione si trova
|
||||||
|
|
||||||
|
```
|
||||||
|
/etc/network/interfaces
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Step 2: Docker-CE:
|
||||||
|
|
||||||
|
verificare se è installato Docker-CE
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker -v
|
||||||
|
```
|
||||||
|
altrimenti va installato
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL get.docker.com | sh
|
curl -fsSL get.docker.com | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Step 3: Install the OS-Agent:
|
### Step 3: Install the OS-Agent:
|
||||||
|
|
||||||
Instructions for installing the OS-Agent can be found [here](https://github.com/home-assistant/os-agent/tree/main#using-home-assistant-supervised-on-debian)
|
Instructions for installing the OS-Agent can be found [here](https://github.com/home-assistant/os-agent/tree/main#using-home-assistant-supervised-on-debian)
|
||||||
|
|
||||||
Step 4: Install the Home Assistant Supervised Debian Package:
|
Step 4: Install the Home Assistant Supervised Debian Package:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
|
wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
|
||||||
dpkg -i homeassistant-supervised.deb
|
apt install ./homeassistant-supervised.deb
|
||||||
```
|
```
|
||||||
|
Orange Pi5 Plus is not supported so you must use
|
||||||
|
|
||||||
|
```bash
|
||||||
|
BYPASS_OS_CHECK=true apt install ./homeassistant-supervised.deb
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Supported Machine types
|
## Supported Machine types
|
||||||
|
|
||||||
- generic-x86-64
|
- generic-x86-64
|
||||||
- odroid-c2
|
- odroid-c2
|
||||||
|
- odroid-c4
|
||||||
- odroid-n2
|
- odroid-n2
|
||||||
- odroid-xu
|
- odroid-xu
|
||||||
- qemuarm
|
- qemuarm
|
||||||
|
@ -62,9 +107,38 @@ dpkg -i homeassistant-supervised.deb
|
||||||
- raspberrypi4
|
- raspberrypi4
|
||||||
- raspberrypi3-64
|
- raspberrypi3-64
|
||||||
- raspberrypi4-64
|
- raspberrypi4-64
|
||||||
|
- raspberrypi5-64
|
||||||
- tinker
|
- tinker
|
||||||
- khadas-vim3
|
- khadas-vim3
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The default path for our `$DATA_SHARE` is `/usr/share/hassio`.
|
||||||
|
This path is used to store all home assistant related things.
|
||||||
|
|
||||||
|
You can reconfigure this path during installation with
|
||||||
|
|
||||||
|
```bash
|
||||||
|
DATA_SHARE=/my/own/homeassistant dpkg --force-confdef --force-confold -i homeassistant-supervised.deb
|
||||||
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
If something's going wrong, use `journalctl -f` to get your system logs. If you are not familiar with Linux and how you can fix issues, we recommend to use our Home Assistant OS.
|
If something's going wrong, use `journalctl -f` to get your system logs. If you are not familiar with Linux and how you can fix issues, we recommend to use our Home Assistant OS.
|
||||||
|
|
||||||
|
[](https://www.openhomefoundation.org/)
|
||||||
|
|
||||||
|
## NOTE
|
||||||
|
|
||||||
|
verificare i servizi in systemd di Home assistant
|
||||||
|
|
||||||
|
```haos-agent.service``` Home Assistant OS Agent
|
||||||
|
|
||||||
|
```hassio-apparmor.service``` Hass.io AppArmor
|
||||||
|
|
||||||
|
```hassio-supervisor.service``` Hass.io supervisor
|
||||||
|
|
||||||
|
es
|
||||||
|
```
|
||||||
|
systemctl status hassio-supervisor.service
|
||||||
|
```
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
Package: homeassistant-supervised
|
Package: homeassistant-supervised
|
||||||
Section: base
|
Section: base
|
||||||
Version: 1.3.0
|
Version: 2.0.0
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: curl, bash, docker-ce, dbus, network-manager, apparmor, jq, systemd, os-agent, systemd-journal-remote
|
Pre-Depends: curl, bash, docker-ce, dbus, network-manager, apparmor, jq, systemd, os-agent, systemd-journal-remote, systemd-resolved
|
||||||
|
Depends: bluez, cifs-utils, nfs-common
|
||||||
Maintainer: Matheson Steplock <https://mathesonsteplock.ca/>
|
Maintainer: Matheson Steplock <https://mathesonsteplock.ca/>
|
||||||
Homepage: https://www.home-assistant.io/
|
Homepage: https://www.home-assistant.io/
|
||||||
Description: Home Assistant Supervised
|
Description: Home Assistant Supervised
|
||||||
|
|
|
@ -14,28 +14,50 @@ SERVICE_DOCKER="docker.service"
|
||||||
SERVICE_NM="NetworkManager.service"
|
SERVICE_NM="NetworkManager.service"
|
||||||
|
|
||||||
# Read infos from web
|
# Read infos from web
|
||||||
URL_CHECK_ONLINE="checkonline.home-assistant.io"
|
URL_CHECK_ONLINE="https://checkonline.home-assistant.io/online.txt"
|
||||||
URL_VERSION="https://version.home-assistant.io/stable.json"
|
URL_VERSION="https://version.home-assistant.io/stable.json"
|
||||||
HASSIO_VERSION=$(curl -s ${URL_VERSION} | jq -e -r '.supervisor')
|
HASSIO_VERSION=$(curl -s ${URL_VERSION} | jq -e -r '.supervisor')
|
||||||
URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt"
|
URL_APPARMOR_PROFILE="https://version.home-assistant.io/apparmor.txt"
|
||||||
|
|
||||||
|
# reload systemd
|
||||||
|
info "Reload systemd"
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
# Restart NetworkManager
|
# Restart NetworkManager
|
||||||
info "Restarting NetworkManager"
|
info "Restarting NetworkManager"
|
||||||
systemctl restart "${SERVICE_NM}"
|
systemctl restart "${SERVICE_NM}"
|
||||||
|
|
||||||
# Enable and start systemd-resolved
|
# Set permissions of /etc/systemd/resolved.conf
|
||||||
if [ "$(systemctl is-active systemd-resolved)" = 'inactive' ]; then
|
# check if file has correct permissions
|
||||||
info "Enable systemd-resolved"
|
if [ "$(stat -c %a /etc/systemd/resolved.conf)" != "644" ]; then
|
||||||
systemctl enable systemd-resolved.service> /dev/null 2>&1;
|
info "Setting permissions of /etc/systemd/resolved.conf"
|
||||||
systemctl start systemd-resolved.service> /dev/null 2>&1;
|
chmod 644 /etc/systemd/resolved.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable and restart systemd-resolved
|
||||||
|
info "Enable systemd-resolved"
|
||||||
|
systemctl enable systemd-resolved.service> /dev/null 2>&1;
|
||||||
|
info "Restarting systemd-resolved"
|
||||||
|
systemctl restart systemd-resolved.service
|
||||||
|
|
||||||
|
# Check and fix systemd-journal-gatewayd socket location
|
||||||
|
if [ ! -S "/run/systemd-journal-gatewayd.sock" ]; then
|
||||||
|
info "Set up systemd-journal-gatewayd socket file"
|
||||||
|
if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'active' ]; then
|
||||||
|
systemctl stop systemd-journal-gatewayd.socket
|
||||||
|
fi
|
||||||
|
rm -rf "/run/systemd-journal-gatewayd.sock";
|
||||||
|
fi
|
||||||
# Enable and start systemd-journal-gatewayd
|
# Enable and start systemd-journal-gatewayd
|
||||||
if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'inactive' ]; then
|
if [ "$(systemctl is-active systemd-journal-gatewayd.socket)" = 'inactive' ]; then
|
||||||
info "Enable systemd-journal-gatewayd"
|
info "Enable systemd-journal-gatewayd"
|
||||||
systemctl enable systemd-journal-gatewayd.socket> /dev/null 2>&1;
|
systemctl enable systemd-journal-gatewayd.socket> /dev/null 2>&1;
|
||||||
systemctl start systemd-journal-gatewayd.socket> /dev/null 2>&1;
|
systemctl start systemd-journal-gatewayd.socket
|
||||||
|
fi
|
||||||
|
# Start nfs-utils.service for nfs mounts
|
||||||
|
if [ "$(systemctl is-active nfs-utils.service)" = 'inactive' ]; then
|
||||||
|
info "Start nfs-utils.service"
|
||||||
|
systemctl start nfs-utils.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart Docker service
|
# Restart Docker service
|
||||||
|
@ -43,7 +65,7 @@ info "Restarting docker service"
|
||||||
systemctl restart "${SERVICE_DOCKER}"
|
systemctl restart "${SERVICE_DOCKER}"
|
||||||
|
|
||||||
# Check network connection
|
# Check network connection
|
||||||
while ! ping -c 1 -W 1 ${URL_CHECK_ONLINE}; do
|
while ! curl -q ${URL_CHECK_ONLINE} >/dev/null 2>&1 ; do
|
||||||
info "Waiting for ${URL_CHECK_ONLINE} - network interface might be down..."
|
info "Waiting for ${URL_CHECK_ONLINE} - network interface might be down..."
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
@ -122,6 +144,7 @@ systemctl enable hassio-supervisor.service > /dev/null 2>&1;
|
||||||
|
|
||||||
# Install AppArmor
|
# Install AppArmor
|
||||||
info "Install AppArmor scripts"
|
info "Install AppArmor scripts"
|
||||||
|
mkdir -p "${DATA_SHARE}/apparmor"
|
||||||
curl -sL ${URL_APPARMOR_PROFILE} > "${DATA_SHARE}/apparmor/hassio-supervisor"
|
curl -sL ${URL_APPARMOR_PROFILE} > "${DATA_SHARE}/apparmor/hassio-supervisor"
|
||||||
sed -i "s,%%HASSIO_CONFIG%%,${CONFIG},g" "${PREFIX}/sbin/hassio-apparmor"
|
sed -i "s,%%HASSIO_CONFIG%%,${CONFIG},g" "${PREFIX}/sbin/hassio-apparmor"
|
||||||
sed -i -e "s,%%SERVICE_DOCKER%%,${SERVICE_DOCKER},g" \
|
sed -i -e "s,%%SERVICE_DOCKER%%,${SERVICE_DOCKER},g" \
|
||||||
|
@ -150,16 +173,15 @@ then
|
||||||
update-grub
|
update-grub
|
||||||
touch /var/run/reboot-required
|
touch /var/run/reboot-required
|
||||||
fi
|
fi
|
||||||
elif [ -f /boot/cmdline.txt ]
|
elif [ -f /boot/firmware/cmdline.txt ]
|
||||||
then
|
then
|
||||||
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /boot/cmdline.txt; then
|
if ! grep -q "systemd.unified_cgroup_hierarchy=false" /boot/firmware/cmdline.txt; then
|
||||||
info "Switching to cgroup v1"
|
info "Switching to cgroup v1"
|
||||||
cp /boot/cmdline.txt /boot/cmdline.txt.bak
|
sed -i.bak 's/$/ systemd.unified_cgroup_hierarchy=false/' /boot/firmware/cmdline.txt
|
||||||
sed -i 's/$/ systemd.unified_cgroup_hierarchy=false/' /boot/cmdline.txt
|
|
||||||
touch /var/run/reboot-required
|
touch /var/run/reboot-required
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
warn "Could not find /etc/default/grub or /boot/cmdline.txt failed to switch to cgroup v1"
|
warn "Could not find /etc/default/grub or /boot/firmware/cmdline.txt failed to switch to cgroup v1"
|
||||||
fi
|
fi
|
||||||
info "Within a few minutes you will be able to reach Home Assistant at:"
|
info "Within a few minutes you will be able to reach Home Assistant at:"
|
||||||
info "http://homeassistant.local:8123 or using the IP address of your"
|
info "http://homeassistant.local:8123 or using the IP address of your"
|
||||||
|
|
|
@ -10,6 +10,35 @@ warn "Home Assistant as a VM or run Home Assistant Core"
|
||||||
warn "via a Docker container."
|
warn "via a Docker container."
|
||||||
warn ""
|
warn ""
|
||||||
|
|
||||||
|
# Check if we are running on a supported OS
|
||||||
|
BYPASS_OS_CHECK=${BYPASS_OS_CHECK:-false}
|
||||||
|
supported_os=("Debian GNU/Linux 12 (bookworm)")
|
||||||
|
|
||||||
|
CURRENT_OS=$(lsb_release -d | awk -F"\t" '{print $2}')
|
||||||
|
os_supported=false
|
||||||
|
|
||||||
|
for os in "${supported_os[@]}"; do
|
||||||
|
if [[ $os == "$CURRENT_OS" ]]; then
|
||||||
|
os_supported=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $os_supported == false ]]; then
|
||||||
|
if [[ $BYPASS_OS_CHECK != "true" ]]; then
|
||||||
|
error "${CURRENT_OS} is not supported!"
|
||||||
|
fi
|
||||||
|
warn "Bypassing OS check..."
|
||||||
|
warn "${CURRENT_OS} is not supported!"
|
||||||
|
warn "Please DO NOT report issues regarding this OS!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if we are running on a supported architecture
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
if [[ ! "i386|i686|x86_64|arm|armv6l|armv7l|aarch64" == *"$ARCH"* ]]; then
|
||||||
|
error "${ARCH} is not supported!"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if Modem Manager is enabled
|
# Check if Modem Manager is enabled
|
||||||
if systemctl is-enabled ModemManager.service &> /dev/null; then
|
if systemctl is-enabled ModemManager.service &> /dev/null; then
|
||||||
warn "ModemManager service is enabled. This might cause issue when using serial devices."
|
warn "ModemManager service is enabled. This might cause issue when using serial devices."
|
||||||
|
@ -22,6 +51,24 @@ if [[ "$(sysctl --values kernel.dmesg_restrict)" != "0" ]]; then
|
||||||
echo "kernel.dmesg_restrict=0" >> /etc/sysctl.conf
|
echo "kernel.dmesg_restrict=0" >> /etc/sysctl.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If the hassio_supervisor service is running or exists, stop it
|
||||||
|
if [[ "$(systemctl is-active hassio-supervisor.service)" == "active" ]]; then
|
||||||
|
info "Stopping hassio_supervisor service"
|
||||||
|
systemctl stop hassio-supervisor.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the hassio_apparmor service is running or exists, stop it
|
||||||
|
if [[ "$(systemctl is-active hassio-apparmor.service)" == "active" ]]; then
|
||||||
|
info "Stopping hassio_apparmor service"
|
||||||
|
systemctl stop hassio-apparmor.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for existing hassio_supervisor container and destroy it
|
||||||
|
if [[ "$(docker ps -aq -f name=hassio_supervisor)" ]]; then
|
||||||
|
# ensure the hassio_supervisor service is stopped
|
||||||
|
info "Removing existing hassio_supervisor container"
|
||||||
|
docker container rm --force hassio_supervisor > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
dpkg-divert --package homeassistant-supervised --add --rename \
|
dpkg-divert --package homeassistant-supervised --add --rename \
|
||||||
--divert /etc/NetworkManager/NetworkManager.conf.real /etc/NetworkManager/NetworkManager.conf
|
--divert /etc/NetworkManager/NetworkManager.conf.real /etc/NetworkManager/NetworkManager.conf
|
||||||
|
@ -34,3 +81,6 @@ dpkg-divert --package homeassistant-supervised --add --rename \
|
||||||
|
|
||||||
dpkg-divert --package homeassistant-supervised --add --rename \
|
dpkg-divert --package homeassistant-supervised --add --rename \
|
||||||
--divert /etc/network/interfaces.real /etc/network/interfaces
|
--divert /etc/network/interfaces.real /etc/network/interfaces
|
||||||
|
|
||||||
|
dpkg-divert --package homeassistant-supervised --add --rename \
|
||||||
|
--divert /etc/systemd/resolved.conf.real /etc/systemd/resolved.conf
|
|
@ -1,4 +1,4 @@
|
||||||
Template: ha/machine-type
|
Template: ha/machine-type
|
||||||
Type: Select
|
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
|
Choices: generic-x86-64, odroid-c2, odroid-c4, odroid-n2, odroid-xu, qemuarm, qemuarm-64, qemux86, qemux86-64, raspberrypi, raspberrypi2, raspberrypi3, raspberrypi4, raspberrypi3-64, raspberrypi4-64, raspberrypi5-64, tinker, khadas-vim3
|
||||||
Description: Select machine type
|
Description: Select machine type
|
|
@ -16,6 +16,7 @@ connection.llmnr=2
|
||||||
|
|
||||||
[connectivity]
|
[connectivity]
|
||||||
uri=http://checkonline.home-assistant.io/online.txt
|
uri=http://checkonline.home-assistant.io/online.txt
|
||||||
|
interval=600
|
||||||
|
|
||||||
[device]
|
[device]
|
||||||
wifi.scan-rand-mac-address=no
|
wifi.scan-rand-mac-address=no
|
25
homeassistant-supervised/etc/systemd/resolved.conf
Normal file
25
homeassistant-supervised/etc/systemd/resolved.conf
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# systemd is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU Lesser General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2.1 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Entries in this file show the compile time defaults.
|
||||||
|
# You can change settings by editing this file.
|
||||||
|
# Defaults can be restored by simply deleting this file.
|
||||||
|
#
|
||||||
|
# See resolved.conf(5) for details
|
||||||
|
|
||||||
|
[Resolve]
|
||||||
|
#DNS=
|
||||||
|
#FallbackDNS=1.1.1.1 8.8.8.8 1.0.0.1 8.8.4.4 2606:4700:4700::1111 2001:4860:4860::8888 2606:4700:4700::1001 2001:4860:4860::8844
|
||||||
|
#Domains=
|
||||||
|
DNSSEC=no
|
||||||
|
DNSOverTLS=no
|
||||||
|
#MulticastDNS=yes
|
||||||
|
#LLMNR=yes
|
||||||
|
#Cache=yes
|
||||||
|
DNSStubListener=no
|
||||||
|
#ReadEtcHosts=yes
|
||||||
|
#ResolveUnicastSingleLabel=no
|
|
@ -1,8 +1,8 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Hass.io supervisor
|
Description=Hass.io supervisor
|
||||||
Requires=docker.service dbus.service
|
Requires=docker.service dbus.service
|
||||||
Wants=network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket
|
Wants=network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket systemd-resolved.service
|
||||||
After=docker.service dbus.service network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket
|
After=docker.service dbus.service network-online.target hassio-apparmor.service time-sync.target systemd-journal-gatewayd.socket systemd-resolved.service
|
||||||
StartLimitIntervalSec=60
|
StartLimitIntervalSec=60
|
||||||
StartLimitBurst=5
|
StartLimitBurst=5
|
||||||
ConditionPathExists=/run/dbus/system_bus_socket
|
ConditionPathExists=/run/dbus/system_bus_socket
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
[Socket]
|
||||||
|
ListenStream=
|
||||||
|
ListenStream=/run/systemd-journal-gatewayd.sock
|
|
@ -1,4 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck disable=SC2048,SC2086
|
# shellcheck disable=SC2048,SC2086
|
||||||
|
|
||||||
docker exec hassio_cli ha $*
|
if [ "$1" != "__complete" ]; then
|
||||||
|
use_tty="-t"
|
||||||
|
else
|
||||||
|
use_tty=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker exec ${use_tty} hassio_cli ha $*
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
||||||
#
|
|
||||||
# This file is part of systemd.
|
|
||||||
#
|
|
||||||
# systemd is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Lesser General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2.1 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=Journal Gateway Service Socket
|
|
||||||
Documentation=man:systemd-journal-gatewayd(8)
|
|
||||||
|
|
||||||
[Socket]
|
|
||||||
ListenStream=/run/systemd-journal-gatewayd.sock
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=sockets.target
|
|
|
@ -37,21 +37,28 @@ touch ${SUPERVISOR_STARTUP_MARKER}
|
||||||
if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then
|
if [ -z "${SUPERVISOR_IMAGE_ID}" ]; then
|
||||||
# Get the latest from update information
|
# Get the latest from update information
|
||||||
# Using updater information instead of config. If the config version is
|
# Using updater information instead of config. If the config version is
|
||||||
# broken, this creates a way (e.g., bad release).
|
# broken, this creates a way back (e.g., bad release).
|
||||||
SUPERVISOR_VERSION=$(jq -r '.supervisor // "latest"' "${SUPERVISOR_DATA}/updater.json" || echo "latest")
|
SUPERVISOR_VERSION=$(jq -r '.supervisor // "stable"' "${SUPERVISOR_DATA}/updater.json" || echo "stable")
|
||||||
|
|
||||||
|
# Get version from stable channel in case we have no local version
|
||||||
|
# information.
|
||||||
|
if [ "${SUPERVISOR_VERSION}" = "stable" ]; then
|
||||||
|
SUPERVISOR_VERSION="$(curl -s --location https://version.home-assistant.io/stable.json | jq -e -r '.supervisor')"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[WARNING] Supervisor image missing, downloading a fresh one: ${SUPERVISOR_VERSION}"
|
echo "[WARNING] Supervisor image missing, downloading a fresh one: ${SUPERVISOR_VERSION}"
|
||||||
|
|
||||||
# Pull in the Supervisor
|
# Pull in the Supervisor
|
||||||
if docker pull "${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}"; then
|
if docker pull "${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}"; then
|
||||||
# Tag as latest if versioned
|
# Tag as latest
|
||||||
if [ "${SUPERVISOR_VERSION}" != "latest" ]; then
|
|
||||||
docker tag "${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}" "${SUPERVISOR_IMAGE}:latest"
|
docker tag "${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}" "${SUPERVISOR_IMAGE}:latest"
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# Pull failed, updater info might be corrupted, re-trying with latest
|
# Pull failed, updater info might be corrupted or the release might have
|
||||||
echo "[WARNING] Supervisor downloading failed trying: latest"
|
# been removed from the container registry, delete the updater info
|
||||||
docker pull "${SUPERVISOR_IMAGE}:latest"
|
# to start from scratch on next try.
|
||||||
|
echo "[ERROR] Supervisor downloading failed."
|
||||||
|
rm -f "${SUPERVISOR_DATA}/updater.json"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SUPERVISOR_IMAGE_ID=$(docker inspect --format='{{.Id}}' "${SUPERVISOR_IMAGE}" || echo "")
|
SUPERVISOR_IMAGE_ID=$(docker inspect --format='{{.Id}}' "${SUPERVISOR_IMAGE}" || echo "")
|
||||||
|
@ -82,12 +89,13 @@ if [ -z "${SUPERVISOR_CONTAINER_ID}" ]; then
|
||||||
--name hassio_supervisor \
|
--name hassio_supervisor \
|
||||||
--privileged --security-opt apparmor="hassio-supervisor" \
|
--privileged --security-opt apparmor="hassio-supervisor" \
|
||||||
-v /run/docker.sock:/run/docker.sock:rw \
|
-v /run/docker.sock:/run/docker.sock:rw \
|
||||||
|
-v /run/containerd/containerd.sock:/run/containerd/containerd.sock:rw \
|
||||||
-v /run/systemd-journal-gatewayd.sock:/run/systemd-journal-gatewayd.sock:rw \
|
-v /run/systemd-journal-gatewayd.sock:/run/systemd-journal-gatewayd.sock:rw \
|
||||||
-v /run/dbus:/run/dbus:ro \
|
-v /run/dbus:/run/dbus:ro \
|
||||||
-v /run/supervisor:/run/os:rw \
|
-v /run/supervisor:/run/os:rw \
|
||||||
-v /run/udev:/run/udev:ro \
|
-v /run/udev:/run/udev:ro \
|
||||||
-v /etc/machine-id:/etc/machine-id:ro \
|
-v /etc/machine-id:/etc/machine-id:ro \
|
||||||
-v ${SUPERVISOR_DATA}:/data:rw \
|
-v ${SUPERVISOR_DATA}:/data:rw,slave \
|
||||||
-e SUPERVISOR_SHARE=${SUPERVISOR_DATA} \
|
-e SUPERVISOR_SHARE=${SUPERVISOR_DATA} \
|
||||||
-e SUPERVISOR_NAME=hassio_supervisor \
|
-e SUPERVISOR_NAME=hassio_supervisor \
|
||||||
-e SUPERVISOR_MACHINE=${SUPERVISOR_MACHINE} \
|
-e SUPERVISOR_MACHINE=${SUPERVISOR_MACHINE} \
|
||||||
|
|
Loading…
Reference in a new issue