1638 Commits

Author SHA1 Message Date
Stefan Agner
525dcfedfb
Upload xz output files instead of gz 2020-11-28 19:27:11 +01:00
Stefan Agner
18cc261e35
Bump linux buildroot (#1032)
* Update buildroot to 2020.11-rc3

Signed-off-by: Stefan Agner <stefan@agner.ch>

* ODROID: Update kernel 5.9.11

* Remove patch which has been applied upstream

* Linux: Update kernel 5.4.80
2020-11-28 16:19:21 +01:00
Stefan Agner
bda9c3d715
Fix ODROID-N2(+) SoC version banner (#1031)
The version banner was showing "Amlogic Meson G12A (Unknown) Revision
28:0 (0:0)" in all cases instead of the correct SoC name and revision.
Make sure the SoC revision is properly read also for the banner.
2020-11-27 16:37:04 +01:00
Stefan Agner
4cbbeeb7dc
Improve OVF descriptor (#1030)
* Add sound card by default using the hdaudio driver (#925)

* Use virtio-net for VirtualBox

The virtio-net driver is a paravirtualization driver which means less
overhead than virtualizing a full network card. The driver is supported
by VirtualBox since several releases by now.

* Use full OS name in product name.
2020-11-27 16:36:44 +01:00
Stefan Agner
beaad9ac9b
Fix boot script issues (#1024) (#1026)
The change "Avoid trying to boot non-existing kernel image in failover
case" introduced a broken boot script on Raspberry Pi (when booting from
partition B) and ODROID-XU4.
2020-11-27 13:47:46 +01:00
Stefan Agner
bf1eaf44d5
Raspberry Pi: Add RPi400 and CM4 support (#1025)
Backport patches for RPi400 and CM4 support. Tested on a RPi400 which
seems to successfully boot and run Home Assistant OS with this.
2020-11-26 23:13:57 +01:00
Stefan Agner
c94f7933ef
RaspberryPi: Update kernel 5.4.79 - 9797f1a4938c20139b00a25de93cc99efb5c291b (#1023) 2020-11-26 23:04:39 +01:00
Stefan Agner
01475a8c45
Fix boot from USB for Raspberry Pi 32-bit installations (#987) (#1022) 2020-11-26 23:04:24 +01:00
Stefan Agner
9436661958
Bump dev channel after build (#1021)
* Bump dev channel after build

Bump version on dev channel automatically when building a dev branch
pre-release.

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2020-11-26 23:04:05 +01:00
Stefan Agner
e88ae15272
Add sub-directory per development build (#1020)
HAOS builds add a lot of files and things get quickly messy. Use a
directory per build.

Also don't abort the complete build if a single board failed, we still
might be interested in the rest.
2020-11-26 00:34:46 +01:00
Aman Gupta Karmani
1fa53bc3dc
Add rpi-eeprom firmware (#939)
* Add 2020-10-28 beta EEPROM

This improves boot from USB and speeds up boot times.
also includes sd card v1 boot reliability.
see https://github.com/raspberrypi/rpi-eeprom/pull/246

Also add HDMI_DELAY=0 so HDMI display is always visible
for easier debugging.
2020-11-26 00:33:48 +01:00
Stefan Agner
1a6dcbbf5b
Compress images using xz instead of gzip (#1018)
The xz compression allows higher compression rates and higher speeds,
a quick measurement lead to this numbers:
gzip --best: compression 131.11s, decompression 9.797s (299M)
xz -3 (single thread): compression 95.13s, decompression 14.902s (228M)
xz -3 (multi thread): compression 12.146s, decompression 14.902s (228M)
2020-11-26 00:29:11 +01:00
Stefan Agner
4be3dee0b4
Add dev build workflow (#1017)
* Add development build version part to version number

Add third part in the version number to indicate development builds.
Generate a default version number based on the date, e.g.
"5.6.dev20201124".

* Add GitHub Action workflow for development builds

Add another GitHub workflow for development builds. Make it triggered
only for now. The version number is generated by the workflow and
passed to all builds to make sure all builds have the same development
build version.

* Add documentation
2020-11-25 10:52:28 +01:00
Stefan Agner
5756969be9
Avoid trying to boot non-existing kernel image in failover case (#1016)
* Avoid trying to boot non-existing kernel image in fail-over case

The A/B update system automatically switches to the other boot slot when
booting fails. However, in a fresh installation, only boot slot A
exists. If booting fails three times (e.g. if somebody plugs out power
before the slot can be marked as good), then the system switches to boot
slot B which does not contain a kernel image yet. Avoid trying to boot
the non-existing kernel image.

With this change, if slot B is empty U-Boot will restore both slots to 3
attempts and retry booting from slot A on next reboot:

```
Trying to boot slot B, 2 attempts remaining. Loading kernel ...
** Unrecognized filesystem type **
No valid slot found, resetting tries to 3
storing env...
```

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-11-24 17:33:44 +01:00
Stefan Agner
8442d2ccfa
ODROID: disable USB enumeration (#1015)
* Fix N2+ boot by disabling USB enumeration

On some devices USB enumeration in U-Boot seems to freeze:
starting USB...
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... <freeze>

We don't use USB currenty in the U-Boot script, disable it for now.

* Disable USB enumeration on all ODROID devices
2020-11-23 11:10:55 +01:00
Stefan Agner
300986f129
Increase OVA disk image default size to 32GB (#1009)
The current default size of 6GB can fill up pretty quickly. Since most
disk images we offer resize dynamically its not really problem to ship
with a bigger default size. It avoids support cases when people forget
to increase the disk image size.
2020-11-21 10:21:38 +01:00
Stefan Agner
08cbbe8988
Improve issue reporting template (#1008) 2020-11-20 21:57:24 +01:00
Stefan Agner
827c97f0ca
Make sure ALSA modprobe parameters get applied (#1007)
* Remove busybox Linux module support

Since systemd relies on the upstream Linux kernel module handling
utility "kmod" the busybox implementations are not required. Already
today the official "kmod" utility takes precedence:
haos # ls -la /usr/sbin/*mod*
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/depmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/insmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/lsmod -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/modinfo -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/modprobe -> ../bin/kmod
lrwxrwxrwx    1 root     root            11 Nov 11 11:32 /usr/sbin/rmmod -> ../bin/kmod

* Move modprobe configuration alsa-base.conf to correct location

The official modprobe package from kmod checks three locations:
/etc/modprobe.d/, /lib/modprobe.d/ and /run/modprobe.d/. Since usr-move
/lib is a symlink to /usr/lib, the correct location for distribution
provided modprobe files is /usr/lib/modprobe.d.
2020-11-20 19:35:20 +01:00
Stefan Agner
3f5b28a0b4
Use GitHub Actions (#1005)
* Initial version of release workflow using GitHub Actions

Add release workflow using GitHub Actions to replace the current Azure
DevOps pipeline. Currently the same functionality is implemented. This
uses multiple builds in parallel to make better use of CPU resources.

Remove Azure DevOps pipeline.

* Add GitHub Actions workflow for pull-request checks

Lint Dockerfile and shell scripts when PRs are opened.

* Use multiple runners in parallel

Buildroot has stretches where CPU resources are not fully utilized.
Spawn multiple builds accross builders to increase load. Also sort them
by architecture to maximize ccache hit rate.

* Checkout before validate version
2020-11-19 12:29:21 +01:00
Stefan Agner
7c25f7c187
Fix DNS resolving (#1004)
* Add resolved.conf to disable stub resolver and DNSSEC

There are Add-Ons which try to bind port 53 on all interfaces including
127.0.0.53. Disable the stub resolver to make them continue working. We
don't need the resolver currently anyway.

Also disable DNSSEC to make sure the baords can access a NTP time server
even when their time is incorrect (since DNSSEC validation may fail).
This is a known chicken-egg problem with systemd-resolved/systemd-timesyncd
and might be addressed in a future version, with what we can reenable
DNSSEC:
https://github.com/systemd/systemd/issues/5873

* Make sure resolve gets added only once to nsswitch.conf

Only add resolve to nsswitch.conf if not already present.
2020-11-18 09:56:38 +01:00
Stefan Agner
52e21c9ccf
Fix shellcheck warnings (#1003)
* Use double quote to prevent globbing and exit with error in case
  directory doesn't exit in hassos-hook.sh

* echo flags are undefined in POSIX, use bash instead in
  bluetooth-rtl8723
2020-11-17 20:06:03 +01:00
Stefan Agner
8d448a130c
Set permissions for builder on entry (#1002)
Make sure the builder can write the ccache directory. This is useful
e.g. when using a Docker volume or a newly created directory.
2020-11-17 16:27:30 +01:00
Stefan Agner
39debca9fc
Fix U-Boot environment handling (#1001)
* Use /run as default location for lock files for U-Boot tools

While there is a command line parameter to set the lock file explicitly,
there are other tools invoking fw_setenv (in particular rauc) which do
not set the lock file. Using /run by default makes fw_setenv use the
correct lock file in all situations.

* Don't explicitly set lock file location

Since we patch U-Boot tools to use /run by default setting it explicitly
is unnecessary.
2020-11-17 15:15:50 +01:00
Stefan Agner
29e92f4231
Add on-board RTC support for ODROID-N2+ (#999)
Make the NXP PCF8563TS on-board RTC the primary RTC of the system.
2020-11-17 10:49:01 +01:00
Stefan Agner
0797bccc36
Improve release drafter (#998)
* Change titels to reflect official/new naming

* Use GitHub Actions to trigger Release Drafter

The Add-On is no longer developed and GitHub Actions is the recommended
way to use the Release Drafter
2020-11-16 22:13:01 +01:00
Stefan Agner
e8c2bacae6
Use upstream fix for zram on 32-bit ARM with LPAE (RPi4) (#996) 2020-11-16 15:09:12 +01:00
Stefan Agner
80f02b8ab6
Update buildroot to 2020.11-rc2 (#995)
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-11-16 11:06:25 +01:00
Stefan Agner
a0871be6c0
Bump buildroot to 2020.11-rc1 (#985)
* Update buildroot-patches for 2020.11-rc1 buildroot

* Update buildroot to 2020.11-rc1

Signed-off-by: Stefan Agner <stefan@agner.ch>

* Don't rely on sfdisk --list-free output

The --list-free (-F) argument does not allow machine readable mode. And
it seems that the output format changes over time (different spacing,
using size postfixes instead of raw blocks).

Use sfdisk json output and calculate free partition space ourselfs. This
works for 2.35 and 2.36 and is more robust since we rely on output which
is meant for scripts to parse.

* Migrate defconfigs for Buildroot 2020.11-rc1

In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE).

* Rebase/remove systemd patches for systemd 246

* Drop apparmor/libapparmor from buildroot-external

* hassos-persists: use /run as directory for lockfiles

The U-Boot tools use /var/lock by default which is not created any more
by systemd by default (it is under tmpfiles legacy.conf, which we no
longer install).

* Disable systemd-update-done.service

The service is not suited for pure read-only systems. In particular the
service needs to be able to write a file in /etc and /var. Remove the
service. Note: This is a static service and cannot be removed using
systemd-preset.

* Disable apparmor.service for now

The service loads all default profiles. Some might actually cause
problems. E.g. the profile for ping seems not to match our setup for
/etc/resolv.conf:
[85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
2020-11-13 18:25:44 +01:00
Stefan Agner
25a0dd3082
Use systemd-resolved to announce hostname via mDNS and LLMNR (#986)
Drop AVAHI and use systemd-resolved to announce hostname via mDNS
and LLMNR. Also continue to offer the _workstation._tcp.local service
since it is used by the CoreDNS mDNS plug-in.
2020-11-13 17:43:46 +01:00
Stefan Agner
50d304d7f3
Drop services we don't offer (#988)
Stop announcing services using DNS-SD we don't offer.
2020-11-13 15:26:30 +01:00
Stefan Agner
021b2c0357 Bump version 5.6 2020-11-10 22:55:18 +01:00
Stefan Agner
f922c14f15
Enable dropbear client to make scp work (#951) (#979)
When trying to use scp it fails due to missing /usr/bin/dbclient. For
debugging/testing scp can be helpful and is rather slim. Add it to all
configs.
2020-11-10 22:21:32 +01:00
Stefan Agner
92541b7280
Move patch for the RPi Linux kernel to the correct location (#978) 2020-11-10 21:30:32 +01:00
Stefan Agner
f5ff224358
Bump Raspberry Pis to 5.4 kernel (#956)
* Bump Raspberry Pi kernel to 5.4

Bump kernel to the downstream Raspberry Pi 5.4 kernel. Drop patches
already merged upstream and use rebased patches for USB reset
controller (required for U-Boot 2020.10 for USB SSD boot).

* Add compatible node for upstream U-Boot

Add brcm,bcm2835-pl011 to make upstream U-Boot bind with the
bcm283x_pl011 driver. This allows to boot with the device tree provided
by the Raspberry Pi Linux kernel 5.4 even without enable_uart=1.
2020-11-10 18:25:51 +01:00
Stefan Agner
6bc6300149
ODROID: Update kernel 5.9.6 (#976)
The CDC ACM cooldown fix is now part of upstream Linux, so we can drop
our patch.
2020-11-10 14:25:39 +01:00
Stefan Agner
fe9fc1cbd2
Use performance governor to avoid frequency scaling (#973)
After running HAOS on my ODROID N2+ several hours I see freezes and
sometimes stack traces which point to a problem in CPU frequency
scaling. This crash seems not to appear on Hardkernel's 18.04 Ubuntu
stable release. However, Hardkernel's Ubuntu uses the performance
governor. Use the performance governor as well to avoid crashes on N2+.
2020-11-10 13:40:39 +01:00
Stefan Agner
4f28a284be
Make self healing capabilities more robust (#960)
In case a container image is corrupted `docker inspect` might fail:
  # docker inspect --format='{{.Id}}' "${SUPERVISOR_IMAGE}"

  Error response from daemon: readlink /mnt/data/docker/overlay2: invalid argument

In that same state the `docker images` command still shows the images.
Since `docker inspect` returns an error SUPERVISOR_IMAGE_ID will be empty
and a simple `docker pull` will be attempted. That does not suffice to
recover from a corrupted container image.

Use `docker images` to get the image ids and make sure to delete all
image ids found by that command.

Also don't use RuntimeDirectory since it deletes the runtime directory
between the service start attempts which defeats the purpose.
2020-11-09 13:05:54 +01:00
Stefan Agner
094208492e
ODROID-C4 fixes (#963)
* Add machine specific landingpage container to ODROID-C4 as well (#949)

* Fetch script from new repo location and layout as well
2020-11-07 19:46:42 +01:00
Stefan Agner
ce95fdccd3
Revert "use GPT partition table for RPi4 (#936)" (#969)
This reverts commit c92b4b54be0d291abd61c4646efe0217243d3c10.

Pure GPT would be nice, but older EEPROM/firmware version seem not to
handle it properly (before EEPROM 2020-09-03/firmware 2020-10-22). Since
devices still get shipped with older EEPROM we currently moving to pure
GPT would make those devices not booting.

Stick with hybrid mode for now to make sure HAOS boots on all devices no
matter if a new or old EEPROM is in use.
2020-11-07 19:46:17 +01:00
Jakub Bartkowiak
2c335a4dd9
Fix configuration.md link in raspberrypi README.md (#967) 2020-11-07 13:39:29 +01:00
Stefan Agner
1a99d07cae
Update ODROID-N2 binary blobs to those built with latest U-Boot (#961) 2020-11-06 10:10:26 +01:00
Stefan Agner
58d4b79376
Update ODROID N2 U-Boot reference to get latest DDR timings (#958)
The DDR timings are taken direclty from the checked out hardkernel
U-Boot tree. Make sure to use the lastest hash to get the latest timing
changes.
2020-11-05 15:51:16 +01:00
ubergeek801
0b52271b3a
Support ODROID C4 SBC (#926)
* initial ODROID-C4 support
* setting clk_ignore_unused
2020-11-05 10:40:25 +01:00
Stefan Agner
503117d8bf
Move RuntimeDirectory to the Service section (#957)
RuntimeDirectory needs to be in the [Service] section to take effect.
2020-11-04 16:55:19 +01:00
Aman Gupta Karmani
c92b4b54be
use GPT partition table for RPi4 (#936)
* use GPT partition table for RPi4
2020-11-04 11:10:57 +01:00
Stefan Agner
5e44dcc681
RaspberryPi: Update firmware 2ba11f2a07760588546821aed578010252c9ecb3 (#954) 2020-11-04 11:09:06 +01:00
Stefan Agner
2d257bd671
Simplify self healing capabilities of Supervisor service (#952)
* Simplify self healing capabilities of Supervisor service

Instead of relying on time based information on how long the container
has been running use a startup marker file to infer if the last startup
has been successful.

* Update buildroot-external/rootfs-overlay/usr/sbin/hassos-supervisor

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-11-04 10:05:38 +01:00
Aman Gupta Karmani
8ed04ed73c
reboot kernels on panic so u-boot can fallback to previous update (#937) 2020-11-03 18:31:59 +01:00
Stefan Agner
737a6f18c3
Add machine specific landingpage container at build time (#949)
The landingpage container is a minimal webserver with built-in zeroconf
annoucement. Preinstall the machine specific landingpage container to
make sure it will show up right after startup.
2020-11-02 13:35:00 +01:00
Aman Gupta Karmani
ac942b8ed9
add fsck.repair=yes to all uboot kernel cmdline args (#943) 2020-10-30 21:54:20 +01:00