16 Commits

Author SHA1 Message Date
Stefan Agner
616c406e8e
Use tempio to generate RAUC configuration files (#1797)
* Add tempio host package

tempio is a template helper using Go's template engine and sprig
functions.

* Use tempio to generate rauc manifest

* Use tempio to generate rauc system.conf
2022-03-17 20:28:40 +01:00
Stefan Agner
62de5f53a8
Improve OS 8 GRUB upgrade (#1793)
* Drop unnecessary device tree utilities

They have been used for Barebox which uses device tree to configure the
state storage and its location. With the change to GRUB the tools are no
longer required.

* Determine manual GRUB update depending on installed tools

Manually update the GRUB environment if no grub environment tools are
installed. This makes a upgrade work even after a previous downgrade (in
that case a grubenv file might still be present in the UEFI ESP).
2022-03-16 15:38:18 +01:00
Stefan Agner
cd87324452
Don't fail update even if files are missing (#1776)
Don't fail the boot slot update even if files are missing in the current
boot directory.
2022-03-02 11:44:56 +01:00
Stefan Agner
fc0f1e20d5
Fix GRUB2 update using post-install hook (#1770)
* Use shell functions for install hooks

* Use post-install hook to initialize GRUB2 bootloader env

Unfortunately the boot name to be updated (RAUC_SLOT_BOOTNAME) is not
available when updating the "boot" slot. Instead, initialize the boot
slot in a kernel post-install slot.
2022-02-28 16:49:34 +01:00
Stefan Agner
381026758a
Fix migration from Barebox GRUB (#1767)
* Fix migration from Barebox GRUB

Create GRUB env which defaults to the boot slot we are updating to. This
makes sure that the newly installed OS version will be booted on next
reboot even if installed on boot slot B.
2022-02-25 19:17:49 +01:00
Stefan Agner
abfee18363
ODROID XU4: Update U-Boot on eMMC boot partition (#1699)
* ODROID XU4: Update U-Boot on eMMC boot partition

Update the U-Boot on the eMMC boot partition if present. Only write the
first megabyte as the eMMC boot partition might be smaller than the SPL
image and only the first megabyte is occupied by FW/BL1/BL2/TZSW (see
https://wiki.odroid.com/odroid-xu4/software/partition_table#tab__odroid-xu341).
2021-12-29 15:19:31 +01:00
Stefan Agner
55c9b54b13
Check if Busybox supports oflag (#1692) (#1694)
* Check if Busybox supports oflag

It seems that Busybox' dd shipped with OS release 5 and earlier does not
support oflag. Check if the flag is supported before making use of it.

* Exit if a command in the update scripts returns an error

This makes sure that the update isn't marked as successful in case there
is an error in the update script.
2021-12-27 14:58:19 +01:00
Stefan Agner
9bf12a8648
Use direct I/O for SPL update (#1408)
The rauc hook for the spl slotclass writes to the disk directly. Make
sure the changes do not end up in cache in case the device looses power
or is otherwise not properly rebooted.

Also use the same partition label detection we are using in
hassos-expand.
2021-06-14 11:27:03 +02:00
Stefan Agner
f86fcbd609
Fix shellcheck issues (#1341)
* Fix issue with latest shellcheck version

The latest shellcheck versions use a new error number for non-POSIX
string replacement. Change to ignore this new error number.

* Ignore shellcheck issue about not following sourced files

Newer shellcheck versions also warn when shellcheck does not follow
sourcing of files with known path:
  Not following: ./meta was not specified as input (see shellcheck -x).

We check those files separately so ignore this error for the two scripts
affected.
2021-04-29 01:15:47 +02:00
Stefan Agner
19c03729f3
Accept installation with intel-nuc in compatible string (#1265)
* Accept installation with intel-nuc in compatible string

For the OS release 6 intel-nuc gets renamed to generic-x86-64. Since
the machine name is in the OS compatible string we need to make sure
OS release 5 installation can update to release 6 despite the new
machine name.
2021-03-09 23:53:15 +01:00
Stefan Agner
66e5ea3b4b
Rename hassos to haos (#1213)
* Change HASSOS_ID from hassos to haos

Use a rauc install-check hook to make this update compatible with OS
releases using hassos in the compatible string.

* Use home-assistant as organization in CPE_NAME

Align with Home Assistant core which uses home-assistant with a dash as
organization in CPE_NAME.
2021-03-09 15:27:12 +01:00
Pascal Vizeli
1f4bd67f7e
Improve the compatibility (#810)
* Improve the compatibility

* small style fix
2020-08-06 20:49:42 +02:00
Pascal Vizeli
0c427d0dee
Update rauc 1.4 to fix mounted boot partition issue (#809)
* Update rauc 1.4 to fix mounted boot partition issue

* applay update

* fix characters

* fix CI

* Support old format

* fix mcopy prefix

* fix lint

* fix lint

* clean style

* Fix script

* fix syntax

* Support all system

* fix shell

* Fix script
2020-08-06 19:37:52 +02:00
Pascal Vizeli
db184bf5d3
Make machine-id persist (#649)
* Make machine-id persist

* update

* Adjustments

* cleanup

* fix cleanups

* small cleanup
2020-05-04 15:11:43 +02:00
Pascal Vizeli
7d7a52732d
Fix supervisor name on cli config (#588) 2020-02-17 13:25:44 +01:00
Pascal Vizeli
a592fc9866
Change handling for SPL based images (#578)
* Change handling for SPL based images

* Fix script

* Fix path for rauc-hook
2020-02-10 14:52:03 +01:00