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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
`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.
On the cbm_parse_system_kernel() we're not leaving room for \0 by
checking only "len" and not considering the end line terminator.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
This function may be reused by other areas, it would be nice to have
it generalized. The build system is building cmdline.c with
-Wfree-nonheap-object but the same flag is not being applied to
files.c, moving it there makes the tests output saner.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
The commit bd30daa changed the function cbm_parse_cmdline_removal_files_directory
but left the clean label behind. This patch removes the leftover.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
- `bash` completion now has completions for sub-commands. Notably,
for `set-kernel` sub-command, it list all kernels installed in
kernel directory. If `--path` is present, it will prepend its
argument before the kernel directory.
- Both `bash` and `zsh` completions are turned into templates, which have
two special variables, `@KERNEL_DIRECTORY@` and `@KERNEL_NAMESPACE@`.
On current Clear Linux, their default values are `/usr/lib/kernel` and
`org.clearlinux`
- `meson.build` file is modified and will replace kernel namespace and
kernel directory in completions.