Compare commits

...

14 Commits
dev ... 1.1

Author SHA1 Message Date
Pascal Vizeli
5cc352bb44 Add lost persistent ssh folder (#58)
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2018-06-30 22:40:45 +00:00
Pascal Vizeli
3315f6d9c4 Use wpa_supplicant with NetworkManager (#57) 2018-06-30 22:40:32 +00:00
Pascal Vizeli
0f1c8dbf56 Use CONFIG as label for config partition (#56)
* Use CONFIG as label for config partition

* Update configuration.md

* Update hassos-config
2018-06-30 22:40:21 +00:00
Pascal Vizeli
f5df6e18a8 Bump version to REL-1 build 1 2018-06-30 10:00:49 +00:00
Pascal Vizeli
ba78c80b97 Set hassos supervisor to rauc (#55)
* Set hassos supervisor to rauc

* Update post-install

* Update hassos-config
2018-06-30 09:59:46 +00:00
Pascal Vizeli
38bc2b4f91 Fix authorized_keys keys (#53)
* Fix authorized_keys keys

* Update hassos.conf

* Update configuration.md

* Update hassos-config

* Update hassos-config
2018-06-30 09:59:36 +00:00
Pascal Vizeli
69af4b3819 Fix hassos-conf label (#48)
* Update mnt-config.mount

* Update configuration.md

* Update configuration.md

* Update mnt-config.mount

* Update configuration.md
2018-06-30 09:59:24 +00:00
Pascal Vizeli
14de047663 Update ova.md (#47) 2018-06-27 11:57:23 +00:00
Pascal Vizeli
a310232e2c We publish now the vmdk and not OVA/OVF (#46)
* Update upload-rel.sh

* Create ova.md
2018-06-27 11:36:09 +00:00
Pascal Vizeli
93ea56d0ea Improve the documentation (#44)
* Create network.md

* Update configuration.md

* Update network.md

* Update network.md
2018-06-26 20:25:56 +00:00
Pascal Vizeli
83dabb2842 Add script for github upload (#43)
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
2018-06-26 20:25:48 +00:00
Pascal Vizeli
bf05e66ae8 Include ota script into board image (#42) 2018-06-26 11:29:05 +00:00
Pascal Vizeli
e1fb61e8a8 Fix build script for new layout (#40) 2018-06-26 11:28:53 +00:00
Pascal Vizeli
480c11535d
Bump version (#39) 2018-06-26 10:34:30 +02:00
16 changed files with 201 additions and 23 deletions

View 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

View File

@ -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
View 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

View File

@ -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

View File

@ -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"

View File

@ -1,6 +1,6 @@
[Unit]
RequiresMountsFor=/etc/dropbear
ConditionFileNotEmpty=/root/.ssh/known_hosts
ConditionFileNotEmpty=/root/.ssh/authorized_keys
[Service]
ExecStartPre=

View File

@ -0,0 +1 @@
/usr/lib/systemd/system/root-.ssh.mount

View File

@ -1,4 +1,3 @@
#!/bin/sh
systemctl start mnt-boot.mount
systemctl reboot

View File

@ -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

View File

@ -2,7 +2,7 @@
Description=HassOS config partition
[Mount]
What=LABEL=hassos-config
What=LABEL=CONFIG
Where=/mnt/config
Type=auto
Options=ro

View File

@ -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

View 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

View File

@ -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

View File

@ -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

View File

@ -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
View 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