mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-08-05 19:27:40 +00:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5cc352bb44 | ||
![]() |
3315f6d9c4 | ||
![]() |
0f1c8dbf56 | ||
![]() |
f5df6e18a8 | ||
![]() |
ba78c80b97 | ||
![]() |
38bc2b4f91 | ||
![]() |
69af4b3819 | ||
![]() |
14de047663 | ||
![]() |
a310232e2c | ||
![]() |
93ea56d0ea | ||
![]() |
83dabb2842 | ||
![]() |
bf05e66ae8 | ||
![]() |
e1fb61e8a8 | ||
![]() |
480c11535d |
16
Documentation/boards/ova.md
Normal file
16
Documentation/boards/ova.md
Normal file
@ -0,0 +1,16 @@
|
||||
# OVA
|
||||
|
||||
The OVA stay for open virtual appliance. Currently we had remove the ova files and publish a vmdk virtual disk,
|
||||
until we have better OVF template to generate our OVA. This vmdk work with (maybe you need convert the disk):
|
||||
- HyperV
|
||||
- VirtualBox
|
||||
- VMware
|
||||
|
||||
## Virtual Machine
|
||||
|
||||
You can use this vmdk in a virtual machine with follow requirements:
|
||||
- OS: Linux 64bit
|
||||
- UEFI boot
|
||||
- min. 1GB RAM
|
||||
- 2x vcpu
|
||||
- 1x Network
|
@ -2,18 +2,21 @@
|
||||
|
||||
## Automatic
|
||||
|
||||
You can format a USB stick with FAT32 and name it with `hassos-config`. The layout could be look like:
|
||||
You can format a USB stick with FAT32/EXT4 and name it with `CONFIG`. The layout could be look like:
|
||||
```
|
||||
network/
|
||||
modules/
|
||||
known_hosts
|
||||
authorized_keys
|
||||
hassos-xy.raucb
|
||||
```
|
||||
|
||||
- On `network` folder can hold any kind of NetworkManager connections files.
|
||||
- The folder `modules` is for modules-load configuration files.
|
||||
- `known_hosts` file activate debug SSH access of port `22222`.
|
||||
- For firmware updates you can but the `hassos-*.raucb` OTA update they should be install.
|
||||
- `authorized_keys` file activate debug SSH access of port `22222`.
|
||||
- For firmware updates you can but the `hassos-*.raucb` OTA update they should be install.
|
||||
|
||||
You can put this USB stick into device and they will be read on startup. You can also trigger this process later over the
|
||||
API/UI or call `systemctl restart hassos-config` on host.
|
||||
|
||||
## Local
|
||||
|
||||
@ -25,5 +28,8 @@ You can edit or create a `cmdline.txt` into your boot partition. That will be re
|
||||
|
||||
The kernel module folder `/etc/modules-load.d` is persistent and you can add your config files there. See [Systemd modules load][systemd-modules].
|
||||
|
||||
### Network
|
||||
|
||||
You can manual add, edit or remove connections configs from `/etc/NetworkManager/system-connections`.
|
||||
|
||||
[systemd-modules]: https://www.freedesktop.org/software/systemd/man/modules-load.d.html
|
||||
|
58
Documentation/network.md
Normal file
58
Documentation/network.md
Normal file
@ -0,0 +1,58 @@
|
||||
# Network
|
||||
|
||||
HassOS use NetworkManager to control the host network. You can setup the network configuartion in future over the API/UI.
|
||||
Actual we support only manual configuration with NetworkManager connection files. Without a configuration, we run default as
|
||||
DHCP device.
|
||||
|
||||
## Configuration Examples
|
||||
|
||||
You can look also into [Official Manual][keyfile] or there are a lot of examples accross internet.
|
||||
|
||||
### LAN
|
||||
```ini
|
||||
[connection]
|
||||
id=hassos-network
|
||||
type=ethernet
|
||||
|
||||
[ipv4]
|
||||
method=auto
|
||||
|
||||
[ipv6]
|
||||
addr-gen-mode=stable-privacy
|
||||
method=auto
|
||||
```
|
||||
|
||||
### Wireless WPA/PSK
|
||||
```ini
|
||||
[connection]
|
||||
id=hassos-network
|
||||
type=wifi
|
||||
|
||||
[wifi]
|
||||
mode=infrastructure
|
||||
ssid=MY_SSID
|
||||
|
||||
[wifi-security]
|
||||
auth-alg=open
|
||||
key-mgmt=wpa-psk
|
||||
psk=MY_WLAN_SECRED_KEY
|
||||
|
||||
[ipv4]
|
||||
method=auto
|
||||
|
||||
[ipv6]
|
||||
addr-gen-mode=stable-privacy
|
||||
method=auto
|
||||
```
|
||||
|
||||
### Static IP
|
||||
|
||||
Replace follow configs:
|
||||
```ini
|
||||
[ipv4]
|
||||
method=manual
|
||||
address1=192.168.1.111/24,192.168.1.1
|
||||
dns=8.8.8.8;8.8.4.4;
|
||||
```
|
||||
|
||||
[keyfile]: https://developer.gnome.org/NetworkManager/stable/nm-settings.html
|
@ -7,6 +7,7 @@ BOOT_DATA=${BINARIES_DIR}/boot
|
||||
|
||||
. ${SCRIPT_DIR}/hdd-image.sh
|
||||
. ${SCRIPT_DIR}/name.sh
|
||||
. ${SCRIPT_DIR}/ota.sh
|
||||
. ${BR2_EXTERNAL_HASSOS_PATH}/info
|
||||
. ${BOARD_DIR}/info
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
VERSION_MAJOR=0
|
||||
VERSION_BUILD=7
|
||||
VERSION_MAJOR=1
|
||||
VERSION_BUILD=1
|
||||
|
||||
HASSOS_NAME="HassOS"
|
||||
HASSOS_ID="hassos"
|
||||
|
||||
DEPLOYMENT="development"
|
||||
DEPLOYMENT="staging"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
RequiresMountsFor=/etc/dropbear
|
||||
ConditionFileNotEmpty=/root/.ssh/known_hosts
|
||||
ConditionFileNotEmpty=/root/.ssh/authorized_keys
|
||||
|
||||
[Service]
|
||||
ExecStartPre=
|
||||
|
@ -0,0 +1 @@
|
||||
/usr/lib/systemd/system/root-.ssh.mount
|
@ -1,4 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
systemctl start mnt-boot.mount
|
||||
systemctl reboot
|
||||
|
@ -1,7 +1,7 @@
|
||||
[Unit]
|
||||
Description=HassOS supervisor
|
||||
Requires=docker.service
|
||||
After=docker.service dbus.socket
|
||||
After=docker.service rauc.service dbus.socket
|
||||
RequiresMountsFor=/mnt/data
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=5
|
||||
|
@ -2,7 +2,7 @@
|
||||
Description=HassOS config partition
|
||||
|
||||
[Mount]
|
||||
What=LABEL=hassos-config
|
||||
What=LABEL=CONFIG
|
||||
Where=/mnt/config
|
||||
Type=auto
|
||||
Options=ro
|
||||
|
@ -1,10 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! findfs LABEL="config" > /dev/null; then
|
||||
echo "[Warning] No config partition found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Mount config folder
|
||||
systemctl start mnt-config.mount
|
||||
if ! systemctl -q is-active mnt-config.mount; then
|
||||
echo "[Warning] No config partition found"
|
||||
exit 0
|
||||
echo "[Error] Can't mount config partition"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
##
|
||||
@ -29,15 +34,15 @@ fi
|
||||
|
||||
##
|
||||
# SSH know hosts
|
||||
if [ -f /mnt/config/known_hosts ]; then
|
||||
echo "[Info] Update SSH known_hosts!"
|
||||
if [ -f /mnt/config/authorized_keys ]; then
|
||||
echo "[Info] Update SSH authorized_keys!"
|
||||
|
||||
cp -f /mnt/config/known_hosts /root/.ssh/known_hosts
|
||||
chmod 600 /root/.ssh/known_hosts
|
||||
cp -f /mnt/config/authorized_keys /root/.ssh/authorized_keys
|
||||
chmod 600 /root/.ssh/authorized_keys
|
||||
|
||||
systemctl start dropbear
|
||||
else
|
||||
rm -f /root/.ssh/known_hosts
|
||||
rm -f /root/.ssh/authorized_keys
|
||||
systemctl stop dropbear
|
||||
fi
|
||||
|
||||
@ -47,7 +52,12 @@ if ls /mnt/config/*.raucb > /dev/null; then
|
||||
echo "[Info] Performe a firmware update"
|
||||
|
||||
rauc_filename=$(ls /mnt/config/*.raucb | head -n 1)
|
||||
rauc install /mnt/config/$rauc_filename
|
||||
if rauc install ${rauc_filename}; then
|
||||
echo "[Info] Firmware update success"
|
||||
systemctl reboot
|
||||
else
|
||||
echo "[Error] Firmware update fails"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cleanup config partition
|
||||
|
43
buildroot-patches/0007-NetworkManager_wpa-supplicant.patch
Normal file
43
buildroot-patches/0007-NetworkManager_wpa-supplicant.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 22a39b0058643c9aebdaf3ebc42a1ea30a33522f Mon Sep 17 00:00:00 2001
|
||||
From: Pascal Vizeli <pvizeli@syshack.ch>
|
||||
Date: Sat, 30 Jun 2018 21:10:14 +0000
|
||||
Subject: [PATCH 1/1] NetworkManager_wpa-supplicant
|
||||
|
||||
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
|
||||
---
|
||||
package/network-manager/Config.in | 5 +++--
|
||||
package/network-manager/network-manager.mk | 2 +-
|
||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/package/network-manager/Config.in b/package/network-manager/Config.in
|
||||
index 72658c1278..759e4a98f9 100644
|
||||
--- a/package/network-manager/Config.in
|
||||
+++ b/package/network-manager/Config.in
|
||||
@@ -16,8 +16,9 @@ config BR2_PACKAGE_NETWORK_MANAGER
|
||||
select BR2_PACKAGE_LIBGUDEV
|
||||
select BR2_PACKAGE_UTIL_LINUX
|
||||
select BR2_PACKAGE_UTIL_LINUX_LIBUUID
|
||||
- select BR2_PACKAGE_WIRELESS_TOOLS
|
||||
- select BR2_PACKAGE_WIRELESS_TOOLS_LIB
|
||||
+ select BR2_PACKAGE_WPA_SUPPLICANT
|
||||
+ select BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW
|
||||
+ select BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION
|
||||
select BR2_PACKAGE_READLINE
|
||||
select BR2_PACKAGE_LIBNDP
|
||||
help
|
||||
diff --git a/package/network-manager/network-manager.mk b/package/network-manager/network-manager.mk
|
||||
index a520aad9c0..846605eb8e 100644
|
||||
--- a/package/network-manager/network-manager.mk
|
||||
+++ b/package/network-manager/network-manager.mk
|
||||
@@ -10,7 +10,7 @@ NETWORK_MANAGER_SOURCE = NetworkManager-$(NETWORK_MANAGER_VERSION).tar.xz
|
||||
NETWORK_MANAGER_SITE = http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/$(NETWORK_MANAGER_VERSION_MAJOR)
|
||||
NETWORK_MANAGER_INSTALL_STAGING = YES
|
||||
NETWORK_MANAGER_DEPENDENCIES = host-pkgconf udev dbus-glib libnl gnutls \
|
||||
- libgcrypt wireless_tools util-linux host-intltool readline libndp libgudev
|
||||
+ libgcrypt wpa_supplicant util-linux host-intltool readline libndp libgudev
|
||||
NETWORK_MANAGER_LICENSE = GPL-2.0+ (app), LGPL-2.0+ (libnm-util)
|
||||
NETWORK_MANAGER_LICENSE_FILES = COPYING libnm-util/COPYING
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -16,8 +16,9 @@ config BR2_PACKAGE_NETWORK_MANAGER
|
||||
select BR2_PACKAGE_LIBGUDEV
|
||||
select BR2_PACKAGE_UTIL_LINUX
|
||||
select BR2_PACKAGE_UTIL_LINUX_LIBUUID
|
||||
select BR2_PACKAGE_WIRELESS_TOOLS
|
||||
select BR2_PACKAGE_WIRELESS_TOOLS_LIB
|
||||
select BR2_PACKAGE_WPA_SUPPLICANT
|
||||
select BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW
|
||||
select BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION
|
||||
select BR2_PACKAGE_READLINE
|
||||
select BR2_PACKAGE_LIBNDP
|
||||
help
|
||||
|
@ -10,7 +10,7 @@ NETWORK_MANAGER_SOURCE = NetworkManager-$(NETWORK_MANAGER_VERSION).tar.xz
|
||||
NETWORK_MANAGER_SITE = http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/$(NETWORK_MANAGER_VERSION_MAJOR)
|
||||
NETWORK_MANAGER_INSTALL_STAGING = YES
|
||||
NETWORK_MANAGER_DEPENDENCIES = host-pkgconf udev dbus-glib libnl gnutls \
|
||||
libgcrypt wireless_tools util-linux host-intltool readline libndp libgudev
|
||||
libgcrypt wpa_supplicant util-linux host-intltool readline libndp libgudev
|
||||
NETWORK_MANAGER_LICENSE = GPL-2.0+ (app), LGPL-2.0+ (libnm-util)
|
||||
NETWORK_MANAGER_LICENSE_FILES = COPYING libnm-util/COPYING
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
mkdir -p /build/RL
|
||||
mkdir -p /build/release
|
||||
|
||||
all_platforms=(ova rpi rpi0_w rpi2 rpi3 rpi3_64)
|
||||
for platform in "${all_platforms[@]}"; do
|
||||
|
43
scripts/upload-rel.sh
Executable file
43
scripts/upload-rel.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -z "${1}" ] || [ -z "${2}" ]; then
|
||||
echo "[Error] Parameter error"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Define variables.
|
||||
GH_API="https://api.github.com"
|
||||
GH_REPO="$GH_API/repos/home-assistant/hassos"
|
||||
GH_TAGS="$GH_REPO/releases/tags/${2}"
|
||||
AUTH="Authorization: token ${1}"
|
||||
|
||||
# Validate token.
|
||||
if ! curl -o /dev/null -sH "$AUTH" $GH_REPO; then
|
||||
echo "[Error] Invalid repo, token or network issue!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read asset tags.
|
||||
id=$(curl -sH "$AUTH" $GH_TAGS | jq -e ".id // empty")
|
||||
|
||||
# Get ID of the asset based on given filename.
|
||||
if [ -z "$id" ]; then
|
||||
echo "[Error] Failed to get release id for tag: ${2}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Upload asset
|
||||
echo "[Info] Start Uploading asset... "
|
||||
|
||||
for filename in release/*; do
|
||||
echo "[Info] Start upload ${filename}"
|
||||
|
||||
# Construct url
|
||||
GH_ASSET="https://uploads.github.com/repos/home-assistant/hassos/releases/$id/assets?name=$(basename $filename)"
|
||||
|
||||
curl "$GITHUB_OAUTH_BASIC" --data-binary @"$filename" -H "${AUTH}" -H "Content-Type: application/octet-stream" $GH_ASSET
|
||||
|
||||
echo "[Info] Upload ${filename} done"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user