441 Commits

Author SHA1 Message Date
Alex Lewontin
9cf75d31bf bootloader: format recovery boot.sel to mirror gadget boot.sel
Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
2023-02-22 17:24:56 +01:00
Alex Lewontin
041b90b183 bootloader: handle uboot envs both with and without header flag byte
Allows snapd to handle uboot envs for uboots with
CONFIG_SYS_REDUNDAND_ENV=n

Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
2023-02-22 17:24:56 +01:00
Miguel Pires
d097436c1c many: fix formatting w/ gofmt 1.19
Go 1.19 includes some changes to gofmt which intend to make lists and
heading clearer when rendered (https://go.dev/doc/go1.19). This commit
is the result of running the new gofmt and manually fixing some of it.
This was necessary because the new gofmt assumed lines beginning w/ tabs
to start lists or examples. While this is often true in our codebase,
we occasionally also use tabs to indent the lines after a TODO or FIXME
prefix or in yaml (e.g., excerpts of a snap.yaml). This meant that a lot of the
reformatted comments were broken and had to be fixed manually.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-01-16 14:23:11 +01:00
Miguel Pires
c0c0c19157 bootloader: fix test w/ auto-generated copyright year
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-01-06 14:31:40 +01:00
Michael Vogt
d4b4efccef bootloader: hardcode copyright year
The copyright of the auto-generated grub_{recovery,}_cfg_assets.go
file is generated from the current date. This leads to a dirty build
when the year changes. This commit hardcodes the copyright year
to 2022.

Once there is a better go build system (or we use something like
meson) we can re-introduce this because then the generated files
will be no longer in git.
2023-01-06 10:22:05 +01:00
Michael Vogt
8aa058e9df bootloader: error if grub does not have assets for the given architecture 2022-12-01 13:36:56 +01:00
Michael Vogt
946fb0db42 Merge pull request #12285 from alfonsosanchezbeato/fix-grub-no-system
bootloader/assets: fix grub.cfg when there are no labels
2022-11-01 14:24:24 +01:00
Valentin David
2670743b56 bootloader: do not specify Core version in grub entry
Ubuntu Core 22 now shows "Run Ubuntu Core 20" as boot entry.
2022-10-24 17:15:15 +02:00
Alfonso Sánchez-Beato
d4036a5b7a bootloader/assets: fix grub.cfg when there are no labels
grub's regexp does not change the store variable if there is no match,
so checking for empty variable after the regexp call was not really
working. Instead, check for successful regexp call.
2022-10-20 16:23:56 +01:00
Michael Vogt
d0059ad859 Merge pull request #11128 from kubiko/lk-boot-device-state-lock
include/lk: update LK recovery environment definition to include devi…
2022-09-14 15:30:41 +02:00
Ondrej Kubik
2f2b1ff2c2 bootloader/lk,include/lk: more typo fixing in the descriptions
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2022-08-24 16:33:21 +03:00
Michael Vogt
bae7d30786 bootloader,systemd: fix don't use Yoda conditions (ST1017)
Fix all the `don't use Yoda conditions (ST1017)` warnings found
by staticcheck.io.
2022-08-19 10:05:25 +02:00
Ondrej Kubik
4863490140 bootloader/lk,include/lk: fix typo DEVICE_STATE_UNKNOW->DEVICE_STATE_UNKNOWN
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2022-08-08 16:27:42 +03:00
Ondrej Kubik
73ffeb72a3 Merge remote-tracking branch 'snapcore/master' into lk-boot-device-state-lock 2022-08-08 16:10:54 +03:00
Ondrej Kubik
1db1cedacc bootloader/lk,include/lk: correct description of the device_lock_state variable
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2022-08-08 16:10:12 +03:00
Michael Vogt
5595253031 bootloader/assets: add ttyS0,115200n8 to grub.cfg
This commit will help the boot speed on most PC devices and
requested by the Taipei team.

The changes to the auto-generated parts are done via:
```
$ cd boot/assets
$ go build  -o ./genasset/genasset  ./genasset/
$ ./genasset/genasset -in ./data/grub.cfg -out grub_cfg_asset.go -name grub.cfg
```
and the `Snapd-Boot-Config-Edition` for `grub.cfg` was bumped.

Note that no changes for the recovery grub configuration are done
in this commit. I'm happy to do a follwup for this.
2022-07-20 11:54:17 +02:00
Alfonso Sánchez-Beato
9844963c4a Merge branch 'master' into add-grub-fallback 2022-07-06 10:37:34 +01:00
Samuele Pedroni
b8e364fa47 many: switch to UC20+ in user messages (instead of UC20) 2022-04-29 14:30:24 +02:00
Alfonso Sánchez-Beato
87dcd7b7f7 b/a/grub_cfg_asset.go: update as we have changed grub.cfg 2022-04-21 13:26:14 +02:00
Alfonso Sánchez-Beato
8cf83e1524 b/a/d/grub.cfg: remove kernel_fallback varible
Not needed anymore as we reboot instead of chainloading after a
failure.
2022-04-21 12:53:35 +02:00
Alfonso Sánchez-Beato
b7eca4e8d0 Merge branch 'master' into add-grub-fallback 2022-04-21 12:44:19 +02:00
Michael Vogt
f045e881eb Merge pull request #11606 from bboozzoo/bboozzoo/factory-reset-spread-no-encrypt
bootloader/assets, tests: add factory-reset mode, test non-encrypted factory-reset
2022-04-19 15:20:48 +02:00
Paweł Stołowski
bb52a67991 Renaming related to inclusive language. 2022-04-14 14:30:47 +02:00
Michael Vogt
d9cf7c9647 Merge remote-tracking branch 'upstream/master' into bboozzoo/factory-reset-spread-no-encrypt 2022-04-11 15:30:58 +02:00
alfonsosanchezbeato
4cc40898a9 b/piboot.go: check EEPROM version for RPi4
* b/piboot.go: check EEPROM version for RPi4

Check EEPROM version for RPi4 to make sure that tryboot is
supported. If the EEPROM need updating, return an error when
installing the kernel.

* bootloader: add unit tests for detection of RPi4 EEPROM

* bootloader/piboot: use osutil instead of using directly os.Stat

* bootloader: address review comments
2022-04-07 19:22:08 +02:00