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.
Added completions for sub-commands, including
- Path completion if a sub-command accept `--path=` option
- Shows a list of kernels for `set-kernel` sub-command, where it searches for
kernels under `/usr/lib/kernel` by default, while prepends the option arg of
`--path` if it's given. If the user specified a path manually, instead of
using file path completion, and that path doesn't exist, warns user.
- Reminds the user to input a integer value for `set-timeout`
sub-command
- Adds all sub-commands to completion menu as argument to `help` sub-command
Previously the only removal that would be processed was extra
configuration and not the default kernel commandline that is shipped
with the kernel. This change moves processing the removal until after
the extra configuration and the default commandline have been merged.
Previous code would try and find informatin about the given root even
when the kernel dir under the root did not exist causing unhelpful
errors. Update to check if the kernel dir exists before probing the
given root and exit if it does not.
In some cases the bootloader update will not impact the kernel update,
usually when another tool like syslinux is used which may fail
independently of the file copies the kernel update will need. Since
the kernel update may still succeed always attempt it to avoid cases
where the kernel becomes stale as it is more likely to need updates
than the bootloader.