425 Commits

Author SHA1 Message Date
John R. Lenton 30d8deff77 many: refactor boot/boottest and move to bootloader/mockbootloader
all boottest had was MockBootloader, so moved it there.
2019-09-02 10:48:59 +01:00
Michael Vogt a96caea34b bootloader: update lk.go for latest API update 2019-08-30 17:47:39 +02:00
Michael Vogt 32091fc25b Merge remote-tracking branch 'upstream/master' into lk 2019-08-30 17:44:26 +02:00
Ondrej Kubik d6add0e057 fix license bootloader: add tests for lk bootloader and lkenv
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-08-14 11:34:48 +03:00
Ondrej Kubik 794134b8ae fix license bootloader: add Little Kernel bootloader support
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-08-14 11:34:07 +03:00
Ondrej Kubik 40de9f4f1c bootloader: update tests for lk bootloader and lkenv with gzipped sample
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-08-11 14:38:00 +01:00
Ondrej Kubik fe0560a069 bootloader: update Little Kernel bootloader support with reboot-reason
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-08-11 14:37:50 +01:00
Ondrej Kubik 1691f975d6 bootloader: update tests for lk bootloader for unexported dir() function 2019-08-11 14:37:43 +01:00
Ondrej Kubik 15a0c0e0c1 bootloader: update Little Kernel bootloader support
- remove use of exported Dir function
 - introduce common function to determine image building/runtime
2019-08-11 14:37:37 +01:00
John R. Lenton 5061d2aa6d boot, etc.: refactor boot to have a lookup with different imps
Currently the logic of boot has a lot of per-snap-type cheks in the
exported functions. Going forwards into core20 we know these checks
are going to get more involved, so now is a good time to switch things
around so that different implementations exist for each of the
situations, and thus the checks can be done while looking up which
implementation to use, instead of in each of the functions.
2019-07-29 10:14:08 +01:00
Michael Vogt 9de7ae3f16 Merge remote-tracking branch 'upstream/master' into HEAD 2019-07-19 11:26:12 +02:00
Michael Vogt 70c13f1887 boot,bootloader: add new s.bootdir to the testsuite and use it 2019-07-19 09:28:48 +02:00
Michael Vogt a900bb39ad bootloader: remove "Dir()" from Bootloader interface
The Bootloader.Dir() method is no longer needed and can be removed.
It used to be used to extract kernel assets but that is now part
of the Bootloader interface so expect for test code nothing is
using "Dir()" anymore. The extraction of boot assets is now done
via the Bootloader interface directly.

Note that Dir() also does not make sense for bootloaders that work
inside partitions (like littleKernel).
2019-07-18 10:21:14 +02:00
Ondrej Kubik 79fd8f1a56 bootloader: enable lk bootloader
Enabling lk bootloader as supported bootloader and
updating tests for it

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-07-03 18:03:56 +01:00
Ondrej Kubik 4be48fca9d bootloader: add tests for lk bootloader and lkenv
Adding tests to test implementation of lk bootloader
and lkenv implementation

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-07-03 18:03:56 +01:00
Ondrej Kubik f1a758412f bootloader: add Little Kernel bootloader support
Little Kernel(lk) is popular bootloader used by many arm SoCs
Reference source: https://github.com/littlekernel/lk
As it is often used by Android devices, almost every Qualcomm and MTK SoCs
are supporting lk.
lk is using boot image format, which packs kernel, initrd, dtbs. This is then
flashed to dedicated boot partition.
As lk is minimalistic bootloader it does not support advanced scripting
as u-boot does.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-07-03 18:03:56 +01:00
Samuele Pedroni 1212a32b62 Merge remote-tracking branch 'upstream/master' into bootloader-test-cleanup-2
adjust to the changes from the move of ExtractKernelAsserts to the bootloaders
layer/simplify some test setup
2019-06-21 11:11:14 +02:00
Michael Vogt b4f7d28e53 bootloader: unexport RemoveKernelAssetsFromBootDir 2019-06-12 15:43:16 +01:00
Michael Vogt e00d2b59a3 boot: ensure we test {Extract,Remove}KernelAssets for idempotency 2019-06-12 15:43:16 +01:00
Ondrej Kubik 0d652f21d9 boot, bootloader: update test suite after moving ExtractKernelAssets to bootloader implementation
After moving ExtractKernelAssets and RemoveKernelAssets implementation to bootloader's
implementation, tests needs to be updated.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-06-12 15:43:16 +01:00
Ondrej Kubik d99d26fcd0 boot,bootloader: move RemoveKernelAssets and ExtractKernelAssets to bootloader's implementation
Different bootloaders might have different requirements about boot
asset extraction. Cleaner way is to move this implementation to each
bootloader implementation

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-06-12 15:42:06 +01:00
Michael Vogt 4d7c76d1a5 bootloader: switch to bootloader_test style testing
The bootloader code is old and does not use the current pattern
of "bootloader_test" and only accessing exported data. This PR
fixes this by moving bits into the "bootloader_test" style.

Sorry, its boring and a bit mechanic.
2019-06-12 11:29:57 +02:00
Michael Vogt 1ffcf1b450 bootloader: remove extra mock bootloader implementation
For historic (and organic) reasons the bootloader/bootloader_test.go
code contains an implementation of a mock bootloader. However this
is redundant now that we have boot/boottest/mockbootloader.go
that implements the same. So this PR updates the bootloader_test
code to use the common mock loader.
2019-06-12 10:29:24 +02:00
Maciej Borzecki 39ec2aa3af bootloader: tweak naming, update related packages
Tweak function names so that we don't repeat 'bootloader' all over again.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2019-03-21 08:51:31 +01:00
Maciej Borzecki e913f573e5 partition,bootloader: rename 'partition' package to 'bootloader'
The 'partition' package is actually about bootloaders, so 'bootloader' name
seems more fitting.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2019-03-19 12:04:50 +01:00