* Bump go-efilib
Signed-off-by: David Cassany <dcassany@suse.com>
* Adapt to new efilib library
Signed-off-by: David Cassany <dcassany@suse.com>
---------
Signed-off-by: David Cassany <dcassany@suse.com>
* Make EFI partition size configurable at install time
* Add a custom EFI size test
* Rename efi to bootloader partition in config.yaml
* Rename EFI variable to Boot
* Rename constants
Signed-off-by: David Cassany <dcassany@suse.com>
This commit refactors the efi mocks out of pkg/efi/types.go and adds a
ReadLoadOptions method the the efivars interface.
We also add some tests for creating a new BootManager and verify that
the ReadLoadOptions error does not bubble up from NewBootManager method.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
When encountering a boot-entry for a device-path that go-efilib is
unable to parse we should just skip that entry instead of erroring out.
This same behavior is used earlier in the same loop so this should fix
an edge-case where the boot entry is parseable but the device-path is
not.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
On some systems the efivars is mounted read-only if the firmware does
not support writing (such as RPI).
This commit turns off writing boot entries to efivars if the efivars
filesystem is mounted read-only.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* bump elemental-toolkit to v2
Signed-off-by: David Cassany <dcassany@suse.com>
* Move pkg/types/v2 to simply pkg/types
This commit leaves the code with a single set of types
and in refers to it as the types packge instead of
v1 or v2.
For the time being we do not foresee managing more
than one single major version of type within the
same code.
Signed-off-by: David Cassany <dcassany@suse.com>
* Stop referring to mocks package as v2mock in favor of simply 'mocks'
Signed-off-by: David Cassany <dcassany@suse.com>
* Fix leftovers after rebase
Signed-off-by: David Cassany <dcassany@suse.com>
---------
Signed-off-by: David Cassany <dcassany@suse.com>
If the new /etc/elemental/grub.cfg config is not found, revert to using
/etc/cos/grub.cfg for backwards compatibility.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Refactor to switch to snapshotter interface
This commit adopts snapshotter interface in install,
reset and upgrade commands. The change implies changes
to the respective specs, grub configuration and dracut
modules.
This commit also changes the behavior of recovery system
upgrades. Now recovery upgrades are an optional step
of a system upgrade. Recovery image can't be upgraded
without upgrading the active system.
Finally build-disk command is also changed to be better
aligned with upgrade and install procedures. Expandable
disks are an unprivileged build and non expandable ones
require privileges as they relay on snapshotter.
* Attempting to fix integration tests
* Adding a migration path from legacy deployments
* Omit /etc/resolv.conf for dir:// paths
* Adaptations after rebase
* Make sure we also mount EFI in upgrades if it was not already mounted
* Default maximum number of snapshots is 2
* Upgrade grub to EFI partition
* Improve recovery management
* Recovery back to ext2 by default
* Adapt upgrade after rebase
Signed-off-by: David Cassany <dcassany@suse.com>
With this commit all grub binaries (EFI images and modules)
and configurations are installed always in defined prefixes.
Defined prefixes are always appended to the EFI path, which
is usually the EFI partition mountpoint at run time.
This causes a duplication of data if multiple prefixes are
defined.
Signed-off-by: David Cassany <dcassany@suse.com>
* Install grub.cfg into EFI System Partition
Change the bootloader install logic to install the grub.cfg into the EFI
System Partition (ESP).
This needs some changes to how root is set in the grub.cfg as well as
moving grub_oem_env file to ESP when created in install/reset/upgrade
command.
Install grub-modules to both EFI/BOOT and EFI/ELEMENTAL.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Specifically bumping from v1.7.2 to v4.3.0. We were pretty outdated.
This commit could not get rid of the old version dependency completely
because yip requires a vfs v1 within the plugin API and we implement
a yip plugin for partitioning in elemental-toolkit. Because of that
both versions are coexisting.
Signed-off-by: David Cassany <dcassany@suse.com>
This commit moves grub logic into its own bootloader interface.
In addition it adds helper methods to find EFI binaries, kernel and
initrd based on patterns. No longer a distro detection is required.
It also sets an elemental criteria for those bootloader files. In fact
first place to look at is /usr/lib/elemental/bootloader, which gives a chance
within the OS Dockerfile to prepare EFI binaries if default distro
paths are not matching any of the default Elemental patterns.
Kernel and initrd symlinks as /boot/vmlinuz and /boot/initrd are also
created within the init command. This gives at build time more
confidence that the kernel and initrd are set consistently with
Elemental expectations.
As part of the refactor BIOS firmware and MSDOS partition tables support
is finally dropped.
Signed-off-by: David Cassany <dcassany@suse.com>