luv-live-image: Create second partition for test results

Create a second partition to export the results of the LuvOS test
manager.

The idea behind using a different partition for the results is to avoid
any corruption on the boot partition.

The size of the partition is determined according to the following
assupmtions:

 - 500 test cases
 - 100 lines of raw results per test case
 -  20 lines of persed results per test case
 -  80 characters per line

Under such assumptions, 4.5MB of data space are required. As most USB
sticks have much greater capacity, the partition size is doubled to 8MB
to err on the safe side.

TODO: An arbitrary UUID is used for the results partitions. This UUID
must match with the UUID used by the test manager init script to mount
the partition. Thus, it is necessary to obtain the UUID by either
parsing such init script or modifying the UUID in the script

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
luv-test-manager: Save results to non-volatile media

Add functionality to save the test results to non-volatile media.  The
non-volatile media is expected to be a disk identified by its UUID. The
disk is mounted using the UUID to avoid writing inadvertently writing to
any other disk present in the system.

Clearly, this implementation requires the presence of a disk with the
UUID specified by the script. Thus, it is required to utilize such UUID
when creating the filesystem.

Also, disks in some systems take a while to be ready for mount and may
not be ready when the LUV test manager runs. Thus, a delay of 5 seconds
is introduced in order to increase the likelihood of finding the
intended disk.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
recipes-bsp: add gnu-efi recipe

gnu-efi is required by gummiboot.
Imported from meta-intel, PR dropped, no new version available.

(From OE-Core rev: fdb65c569db2b55023f9d1d72959e4e7d187a1d8)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
recipes-bsp: Add gummiboot recipe

gummiboot is a simple UEFI boot manager.

Recipe imported from meta-intel with these changes:
 - drop PR and update configure options
 - upgraded to latest version

A couple of notes:
 - If you wish you can install the gummiboot package on the target and
use 'gummiboot install' to add the payload to the ESP (see gummiboot --help,
just make sure the ESP partition has the boot flag on as gummiboot won't accept it
otherwise). However the point of this recipe is to be used by bootimg.bbclass and
generate images with gummiboot instead of grub-efi.
 - You need a kernel which has CONFIG_EFI_STUB=y at least
 - The default linux-yocto kernel config does not enable that, easiest way
to enable is to build with KERNEL_FEATURES_append = " cfg/efi-ext" in local.conf

(From OE-Core rev: 8f95d0598c31fff76e2a58fecb6c96197121a044)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
bootimg/grub-efi.bbclass: allow using a different class for EFI images

Abstract away some names so one can select using EFI_PROVIDER a different
class than grub-efi for populating live images, basically allowing the use
of a different bootloader than grub-efi.

(From OE-Core rev: 14e5de3b8f4d5902d0ac683ff45fb878e88b40ef)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
classes: Add gummiboot class

Adds a gummiboot class similar to grub-efi class and makes the necessary
changes so it can be used for live/hddimg images as well.

One can set EFI_PROVIDER = "gummiboot" in local.conf to use gummiboot instead of grub-efi.
Gummiboot requires some kernel options that are not enabled by default, so one has to build
with KERNEL_FEATURES_append = " cfg/efi-ext".

The install scripts have been updated too, keeping the old behaviour around,
but accounting for the new boot loader config files (if they exist).
It can be argued that the installer and bootimg are a bit wierd and not necessarily correct,
but I wanted to have the exact same behviour with gummiboot.
With the default EFI_PROVIDER = "grub-efi" nothing changes, everthing should be just as before.

I've tested live boot, install and normal boot on:
    - FRI2
    - genericx86-64 on NUC
with:
  EFI_PROVIDER = "gummiboot"
  KERNEL_FEATURES_append = " cfg/efi-ext"
in local.conf.

(From OE-Core rev: b457e40fc69cc6503dc566f16495f03606e5333b)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
recipes-bsp: Add efilinux recipe

efilinux is a minimal reference UEFI bootloader. It doesn't include
graphics or a complex configuration syntax, just the bear minimum
necessary to boot a Linux kernel.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
generate-manifest-2.7.py: Add importlib

importlib isn't currently included in any of the python packages, so
create a new one for recipes that require it.

Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
chipsec: Add recipe for CHIPSEC v1.1.0

CHIPSEC is a platform security assessment framework for analyzing the
security of PC platforms. It includes a number of tests and also
provides forensic capabilities for firmware.

Of particular use are the UEFI secure boot variable tests and BIOS flash
write-protect tests.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
chipsec: Enable luv test automatic execution

Integrate chipsec into the test manager infrastructure and add a parser
to capture test results and write them to stdout in the luv-test-manager
compatible format.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
luv-test: Add auto-generated test files to FILES_${PN}

Instead of managing our own luv package just add the auto-generated
files to FILES_${PN} to avoid QA warnings.

In the future we could do our own luv package, but let's keep thing
simple for now.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
core-image-efi-initramfs: Add chipsec test

Include the chipsec test suite in this image.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>