Skip to content

Commit

Permalink
Merge pull request #26 from home-assistant/dev
Browse files Browse the repository at this point in the history
Release 0.3
  • Loading branch information
pvizeli authored Jun 4, 2018
2 parents 9168095 + d993c48 commit 3896d4c
Show file tree
Hide file tree
Showing 2,112 changed files with 38,399 additions and 27,089 deletions.
3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions Documentation/boards/raspberrypi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Raspberry PI

## Serial console

For access to terminal over serial console, add `console=ttyAMA0,115200` to `cmdline.txt`.
29 changes: 29 additions & 0 deletions Documentation/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Configuration

## Automatic

You can format a USB stick with FAT32 and name it with `hassos-config`. The layout could be look like:
```
network/
modules/
known_hosts
hassos-xy.rauc
```

- 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-*.rauc` OTA update they should be install.

## Local

### Bootargs

You can edit or create a `cmdline.txt` into your boot partition. That will be read from our bootloader.

### Kernel-Module

The kernel module folder `/etc/modules-load.d` is persistent and you can add your config files there. See [Systemd modules load][systemd-modules].


[systemd-modules]: https://www.freedesktop.org/software/systemd/man/modules-load.d.html
29 changes: 9 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# WORK IN PROGRESS!

# Hass.io OS
# HassOS
Hass.io OS based on [buildroot](https://buildroot.org/). It's a hypervisor for Docker and supports various kind of IoT hardware. It is also available as virtual appliance. The whole system is optimized for embedded system and security. You can update the system simple with OTA updates or offline updates.

## Focus

- Linux kernel 4.15
- Linux kernel 4.14 (LT)
- Barebox as bootloader
- RAUC for OTA updates
- SquashFS LZ4 as filesystem
Expand All @@ -17,42 +15,33 @@ Hass.io OS based on [buildroot](https://buildroot.org/). It's a hypervisor for D
## Schemas
![](misc/hassio-os-partition.png?raw=true)

## Configuration

Create a USB stick with a partition named "hassio-config". This partition can include follow files:

- network-* (NetworkManager keyfiles)
- known_hosts (SSH)
- hassio-os-*.ota (Firmware updates)

# Customize

## Supervisor/Cli

Provide a file with the name `hassio.json` in your data partition and the following structure:
Provide a file with the name `hassos.json` in your data partition and the following structure:

```json
{
"supervisor": "repo/image",
"supervisor_args": "optional / custom docker arguments",
"cli": "repo/image",
"cli_args": "optional / custom docker arguments"
"cli_args": "optional / custom docker arguments",
"hostname": "default hostname"
}
```

# Building
Running `sudo ./enter.sh` will get you into the build Docker container.
`make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external xy_defconfig`

From outside the Docker container, while it is still running you can use `./getimage.sh` to get the output image.

## Helpers

- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external defconfig BR2_DEFCONFIG=/build/buildroot-external/configs/xy_defconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external xy_defconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external menuconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external linux-menuconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external barebox-menuconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external busybox-menuconfig`

- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external savedefconfig BR2_DEFCONFIG=/build/buildroot-external/configs/xy_defconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external savedefconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external linux-update-defconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external barebox-update-defconfig`
- `make -C /build/buildroot BR2_EXTERNAL=/build/buildroot-external busybox-update-config`
7 changes: 3 additions & 4 deletions buildroot-external/Config.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
source "$BR2_EXTERNAL_HASSIO_PATH/package/mingetty/Config.in"
source "$BR2_EXTERNAL_HASSIO_PATH/package/hassio/Config.in"
source "$BR2_EXTERNAL_HASSIO_PATH/package/libapparmor/Config.in"
source "$BR2_EXTERNAL_HASSIO_PATH/package/apparmor/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/hassos/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/libapparmor/Config.in"
source "$BR2_EXTERNAL_HASSOS_PATH/package/apparmor/Config.in"
9 changes: 3 additions & 6 deletions buildroot-external/barebox-env/bin/init
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

export PATH=/env/bin

global linux.bootargs.base
global linux.bootargs.dyn.root

# Init board specific stuff
[ -e /env/config-board ] && /env/config-board

# Autostart
for i in /env/init/*; do
. $i
done

# Overlays
. /env/overlay/load

echo "- Hit m for menu or wait for autoboot -"
timeout -a 1 -s -v key

Expand Down
12 changes: 12 additions & 0 deletions buildroot-external/barebox-env/boot/system0
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

global linux.bootargs.dyn.root="root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"

mkdir -p /mnt/system
mount -t squashfs /dev/disk0.hassos-system0 /mnt/system

if [ -f "/mnt/system/boot/bzImage" ]; then
global bootm.image="/mnt/system/boot/bzImage"
else
global bootm.image="/mnt/system/boot/zImage"
fi
13 changes: 13 additions & 0 deletions buildroot-external/barebox-env/boot/system1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

global linux.bootargs.dyn.root="root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro"

mkdir -p /mnt/system
mount -t squashfs /dev/disk0.hassos-system1 /mnt/system

if [ -f "/mnt/system/boot/bzImage" ]; then
global bootm.image="/mnt/system/boot/bzImage"
else
global bootm.image="/mnt/system/boot/zImage"
fi

6 changes: 6 additions & 0 deletions buildroot-external/barebox-env/init/cmdline
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

global linux.bootargs.base=""
if [ -f /boot/cmdline.txt ]; then
readf /boot/cmdline.txt global.linux.bootargs.base
fi
1 change: 1 addition & 0 deletions buildroot-external/barebox-env/init/global_bootargs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

global linux.bootargs.zram="zram.enabled=1 zram.num_devices=3"
global linux.bootargs.apparmor="apparmor=1 security=apparmor"
2 changes: 1 addition & 1 deletion buildroot-external/barebox-env/menu/title
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Hass.io OS boot Menu:
HassOS boot Menu:
5 changes: 5 additions & 0 deletions buildroot-external/barebox-env/overlay/load
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

for i in /env/overlay/*.dtbo; do
oftree -o $i
done
46 changes: 46 additions & 0 deletions buildroot-external/barebox.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# CONFIG_LOCALVERSION_AUTO is not set
# CONFIG_CMD_VERSION is not set
# CONFIG_TIMESTAMP is not set

CONFIG_PROMPT="HassOS-boot:"
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
CONFIG_BOOTM_SHOW_TYPE=y
CONFIG_BOOTM_OFTREE=y
CONFIG_FLEXIBLE_BOOTARGS=y

# CONFIG_PARTITION_DISK_DOS is not set
CONFIG_PARTITION_DISK_EFI=y
# CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE is not set
# CONFIG_PARTITION_DISK_EFI_GPT_COMPARE is not set

CONFIG_STATE=y
CONFIG_STATE_DRV=y
CONFIG_BOOTCHOOSER=y
CONFIG_CMD_BOOT=y
CONFIG_CMD_NV=y
CONFIG_CMD_EXPORT=y
CONFIG_CMD_GLOBAL=y
CONFIG_CMD_BASENAME=y
CONFIG_CMD_DIRNAME=y
CONFIG_CMD_READLINK=y
CONFIG_CMD_GETOPT=y
CONFIG_CMD_MENUTREE=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_OFTREE=y
CONFIG_CMD_STATE=y
CONFIG_CMD_BOOTCHOOSER=y
CONFIG_CMD_READF=y

CONFIG_OFTREE=y
CONFIG_OFTREE_OVERLAY=y

CONFIG_DISK=y
CONFIG_DISK_WRITE=y

CONFIG_FS_FAT=y
CONFIG_FS_FAT_WRITE=y
CONFIG_FS_FAT_LFN=y
CONFIG_FS_SQUASHFS=y
CONFIG_LZ4_DECOMPRESS=y
5 changes: 0 additions & 5 deletions buildroot-external/board/ova/barebox-env/boot/system0

This file was deleted.

4 changes: 0 additions & 4 deletions buildroot-external/board/ova/barebox-env/boot/system1

This file was deleted.

Binary file not shown.
Binary file removed buildroot-external/board/ova/barebox-state.dtb
Binary file not shown.
36 changes: 0 additions & 36 deletions buildroot-external/board/ova/barebox.config
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_MMU=y
CONFIG_MALLOC_SIZE=0x0
CONFIG_MALLOC_TLSF=y
CONFIG_PROMPT="hassio-os:"
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
# CONFIG_TIMESTAMP is not set
CONFIG_BOOTM_SHOW_TYPE=y
CONFIG_FLEXIBLE_BOOTARGS=y
# CONFIG_PARTITION_DISK_DOS is not set
CONFIG_PARTITION_DISK_EFI=y
# CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE is not set
# CONFIG_PARTITION_DISK_EFI_GPT_COMPARE is not set
CONFIG_DEFAULT_ENVIRONMENT_PATH="/build/buildroot-external/board/ova/barebox-env /build/buildroot-external/barebox-env"
CONFIG_STATE=y
CONFIG_BOOTCHOOSER=y
# CONFIG_CMD_VERSION is not set
CONFIG_CMD_BOOT=y
CONFIG_CMD_UIMAGE=y
CONFIG_CMD_AUTOMOUNT=y
CONFIG_CMD_NV=y
CONFIG_CMD_EXPORT=y
CONFIG_CMD_GLOBAL=y
CONFIG_CMD_BASENAME=y
CONFIG_CMD_DIRNAME=y
CONFIG_CMD_READLINK=y
CONFIG_CMD_GETOPT=y
CONFIG_CMD_MENUTREE=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_DETECT=y
CONFIG_CMD_STATE=y
CONFIG_CMD_BOOTCHOOSER=y
CONFIG_DRIVER_SERIAL_EFI=y
CONFIG_DRIVER_SERIAL_EFI_STDIO=y
# CONFIG_SPI is not set
Expand All @@ -40,8 +9,3 @@ CONFIG_DISK_WRITE=y
CONFIG_CLOCKSOURCE_EFI=y
CONFIG_FS_EFI=y
CONFIG_FS_EFIVARFS=y
CONFIG_FS_FAT=y
CONFIG_FS_FAT_WRITE=y
CONFIG_FS_FAT_LFN=y
CONFIG_FS_SQUASHFS=y
CONFIG_LZ4_DECOMPRESS=y
Loading

0 comments on commit 3896d4c

Please sign in to comment.