475 Commits
Author SHA1 Message Date
Leandro Dorileo 4a5e109307 v3.2.4 release
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
v3.2.4
2020-01-27 13:23:08 -08:00
Leandro Dorileo 512323d975 timeout/update: don't allocate/free manager twice
Avoid parsing flags, allocating BootManager twice when calling update
from time out command.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-22 10:55:47 -08:00
Leandro Dorileo 4c1e8f772a Update issue templates 2020-01-08 16:52:53 -08:00
Leandro Dorileo 09d65ecc1a grub2: make it optional
We would like to disable grub2 in scenarios/configurations where we
know we won't ever use/need it.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-08 15:01:22 -08:00
Leandro Dorileo d651b745cd v3.2.3 release
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
v3.2.3
2020-01-07 14:45:29 -08:00
Leandro Dorileo 4be250b819 man: add /etc/kernel/initrd.d documentation
We're missing man page documentation to the recent user initrd freestanding
file.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-07 14:21:30 -08:00
Leandro Dorileo 16871aba1c remove travis configuration
We are running CI with github actions now, lets get rid of travis
configuration.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-06 12:24:52 -08:00
Leandro Dorileo 5ee752d3b4 update local docker continuous test runner
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-06 12:24:52 -08:00
Leandro Dorileo d35d26b359 mv scripts to scripts directory
The scripts continous.sh and update_format.sh should live side-by-side
with the other scripts. Also renamed update_format.sh to update-format.sh
to keep naming consistency.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-06 12:24:52 -08:00
Leandro Dorileo 6077f66b0a remove findstatic.pl
It's a copy of findstatic.pl from libnica, in the context of c-b-m
we're not using it at all.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2020-01-06 12:24:52 -08:00
Leandro Dorileo 0581548e5f test suite: don't merge or copy cov file if empty
Some builds may not generate coverage.info, if that happens we don't
try to merge it.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-13 12:39:04 -08:00
Leandro Dorileo 696ee57b99 v3.2.2 release
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
v3.2.2
2019-12-12 16:19:37 -08:00
Leandro Dorileo a67ce45cb3 bootman: add user initrd configuration
With these changes the user may add custom initrd freestanding files
into /etc/kernel/initrd.d.

Additionally the user can mask system defined initrd freestanding
by adding symlinks pointing to /dev/null within /etc/kernel/initrd.d.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:31 -08:00
Leandro Dorileo f853bfd49b print source and target intrd on error
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:31 -08:00
Leandro Dorileo 9d40544ff0 log: add check_*_continue
These utilities are meant to be used whenever a "continue" fits.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:31 -08:00
Leandro Dorileo e6c6dfccc5 man: update man page to reflect new flags (-n,--no-efi-update)
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:08 -08:00
Leandro Dorileo b21cbe91fa cli: add update_efi_vars configuration file support
The user can set a system-wide configuration to skip efi vars update.
With that the user can insure the efi vars will not be touched when
c-b-m is called by some other tool i.e swupd post update hooks.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:08 -08:00
Leandro Dorileo 20a72f0736 skip efi vars update when requested by user
This patch introduces a new flag (-n,--no-efi-update), with that flag
c-b-m will not touch efi variables. It's useful for multi-boot systems
where the user will not want c-b-m messing with the efi configurations.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:08 -08:00
Leandro Dorileo f33bbe7f79 cli: properly align help description
Makes sure we properly align flags and descriptions when flags are
larger than current ones.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:02:08 -08:00
Leandro Dorileo 92c883720f github actions: split test executions
Split each test to its own execution, with that we can have a better
visualization of the build type failure.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:01:31 -08:00
Leandro Dorileo 838f6205d5 test: make test runner a bit more "flexible"
Added arguments to the script so we can select the test we want to
run, also make the coverage optional (enabled by default).

Started transitioning the name from travis_test.sh to a more generic
name (run-test-suite.sh).

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:01:31 -08:00
Leandro Dorileo 3a3b49cebb update valgrind suppressions
There are new issues introduced by check we might ignore for now.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-12-12 16:01:31 -08:00
Leandro Dorileo 4868945b21 v3.2.1 release
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
v3.2.1
2019-12-09 13:38:17 -08:00
Leandro Dorileo ff2c817c68 set-timeout: make sure to apply the changes
Currently when the user calls the set-timeout command that change
will only be applied after calling update command, with this patch
we internally call update command.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-11-14 13:18:20 -08:00
Leandro Dorileo 24e2ffd81c add pull_request event to actions
It seems that without pull_request event the pull request will not
get actions triggered.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-11-13 13:07:02 -08:00
Leandro Dorileo f48ea3d436 Add github actions workflow
Preparing to migrate from travis to github actions.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-11-13 12:53:32 -08:00
Leandro Dorileo dd2e383b7a cli: add flags to the usage output
Add usage info wherever the flags -p and -i are relevant.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-11-01 16:40:21 -07:00
Leandro Dorileo 1d2303ab04 cli: remove dead code
We could me things simpler and have a single condition.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-11-01 16:40:21 -07:00
Leandro Dorileo 8de7d13539 readme: add filesystem support table 2019-11-01 14:55:32 -07:00
Leandro Dorileo c4e4903b46 efi: add a entry_label argument
With that each vendor can create a more meaningful uefi menu entry if provided on
build time.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-10-04 21:21:17 -07:00
Anselmo L. S. Melo c7ef26a2ff bootman: deallocate boot device strings
Either boot_device or legacy_boot needs to be maintained, thus
the unused one should be properly deallocated.
2019-09-19 12:03:59 -07:00
William Douglas cdbf756073 v3.2.0 release v3.2 2019-09-18 09:26:50 -07:00
Leandro Dorileo 486486e19a bootman: improve filesystem detection
Improve the internal filesystem detection, with these changes we
can reuse this code elsewhere and be more efficient - other areas
needing the filesystem knowledge can use this mapping strategies
adding a more precise and centralized code to that.

This patch also makes sure to keep tests and filesystem checks more
consistent.

When mounting we were assuming the /boot filesystem to always be
vfat, with this code now we can have /boot partitions with whatever
filesystem we support (for now: vfat, ext[2-4]).

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo ef65b290de extlinux: fix extlinux_cmd on partitionless /boot - native_mode
The patch simplifies the extlinux_cmd to work both on image_mode
and native_mode, with /boot partition or not. The -i will work in
both cases, using the --device will also ensure that.

The current form will not work across these scenarios. In a
partitionless in native_mode we'll always need --device to tell
extlinux to install the mbr in a device but install stage files
into /boot, otherwise extlinux will fail telling the device was
not found - it can't find the device "mapped" to /boot.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo 001623a697 bootman: fix boot directory for "partitionless boot" - native_mode
When running into a system with a partition table where /boot hasn't
its own partition and running in native_mode we must also check if
/boot is empty to determine if we must keep trying to mount or not.

In native mode and without /boot partition we'll always fail to
detect boot device (once we don't have one) but will always report
a fail. This patch makes sure to check if in native we have content
installed into /boot directory and assume it's a partitionless /boot.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo b5e75c3c6c bootman: fix boot directory for "partitionless boot" - image_mode
When installing into a system with a partition table where /boot hasn't
its own partition - the mount_boot() will reset the bootloader's boot_dir
to reflect to the root directory, given the set_default_kernel() flow
we'll end up having the bootloader configuration installed into /
instead of /boot.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo 340d16eca5 extlinux: rename config file
extlinux also looks up syslinux.cfg, we're wrongly assuming extlinux
will try to use extlinux.cfg instead.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo 2eb0da5523 log: add check helpers
This patch just introduces some cosmetic macros for log and condition
checking.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo fc8d452a5f sysconfig: split image and native partition detection
With these changes the code becomes more clear on how the wanted
capabilities mask is configured.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-17 15:08:18 -07:00
Leandro Dorileo f4975a7975 libnica: sync with upstream
We have a memory leak fixed upstream.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-05 16:33:56 -07:00
Leandro Dorileo dca4d8b13f sysconfig: add CBM_FORCE_LEGACY flag
With this we can "force" install syslinux into a UEFI running system,
it's useful for syslinux validation as well as CI testing.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-05 16:33:56 -07:00
Leandro Dorileo 7992d91e1b syslinux: add missing bits
This patch introduces some minor missing bits:

  + implement the "mark legacy bios bootable" attribute to partition
  + always use syslinux -U since -i will fail if using partuuid

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-05 16:33:56 -07:00
Leandro Dorileo 53fdea822b bootman: generalize the legacy/UEFI boot partition detection
Generalize the logic and boot partition mounting into its own function,
reusing into 3 different points. This function can be improved more
later on to be used elsewhere.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-05 16:33:56 -07:00
Leandro Dorileo 8e834067b0 files: add a generic partition index utility
This util function returns a partition index based on the given a prefix
and a partitions device node.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2019-09-05 16:33:56 -07:00
Auke Kok c730d3e509 Statically add mbr.bin and gptmbr.bin.
We should not rely on these being present on the filesystem and
the space we use is minimal. On top of that, we need at a later stage
dynamically choose gpt or non-gpt MBR blocks depending on the device,
so we need both available no matter what.

Punch a hole so the bootloader can easily get the wanted_boot_mask
and decide whether the GPT or non-GPT mbr.bin is needed.
2019-09-05 16:33:56 -07:00
Auke Kok d46f567386 Add syslinux support.
For now this is a literal copy of extlinux.c with just the FSTYPE
capability modified.
2019-09-05 16:33:56 -07:00
Auke Kok 366531ce8f Fix test cases.
Without a FS type set, all tests will fail because none of the
bootloaders are compatible. We change the tests to simulate the
appropriate FS type so that these tests succeed as expected.
2019-09-05 16:33:56 -07:00
Auke Kok 8c38df9900 Detect filesystem type of boot device.
This code makes the program detect the filesystem type of the boot
device. We need this because not all bootloaders will support the
same filesystem type. For instance, extlinux only supports ext2/3/4
but sd-boot supports vfat.

All existing bootloader plugins now report that they support one or
the other filesystem types. This works OK on my systemd-boot based
system. The tests need adjusting, still.
2019-09-05 16:33:56 -07:00
Auke Kok f093ece402 Check for existence of grub2 and extlinux.
If these are not present, there's no use in attempting to use them.

For convenience, we LOG_DEBUG() print the path we searched for
them.
2019-09-05 16:33:56 -07:00
Auke Kok 7b492b0cc2 Rename syslinux to extlinux.
`syslinux` is a bootloader for `FAT` filesystems. `extlinux` is a bootloader
for `ext` filesystems. The name therefore is entirely incorrect, since the
code clearly is using `extlinux` and we may want to support `syslinux` at
some point in the future.

This is a mostly mechanical rename/replace.
2019-09-05 16:33:56 -07:00