* 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>
* Implement to upgrade-recovery sub command
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
* Update Upgrade documentation
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
---------
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
* Implementation of Btrfs snapshotter
* Btrfs based examples
* Refined and adapt features
* Update build-disk to new snapshotter and prevent including State partition on expandable images
* Remove /oem bind mount in initramfs, already mounted by mount command
* Adapt unit tests
* Add mount command unit tests
* Make grubfallback test more generic
* Adding btrfs snapshotter unit tests and fixing default snapshotter config constructor
* Add utils test
* Fix upgrade ENV variables mapping
* Include transactional-update package in example
* Fix persistent bind mounts
* Make sure state is RW mounted upgrading from legacy
* Remove unused passive symlinks for loopdevice
* Fix upgrade from older version
Signed-off-by: David Cassany <dcassany@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>
This commit adds in elemental client the build-disk command. With this command we can eventually build an image that includes partitions:
* EFI
* OEM
* Recovery
* State
Having State partition to match the minimum size (to reduce resulting image size), only includes config files no image.
Then the State partition could be expanded on first boot to desired size (build-disk command already pre-appends the required cloud-config files for that to happen) and then the Persistent partition created at the end with all the available space (or some desired specific size too).
This setup can be executed without running a single mount (thanks to squashfs usage), meaning this disk could be built in a container or Dockerfile (like we do with ISOs).
Building full disks including all partitions with an specified size is still possible, however this approach requires mount privileges and because of that it can't be executed inside non privileged containers.
Signed-off-by: David Cassany <dcassany@suse.com>
* Update documentation
Remove old usages of luet/luet-makeiso and channel.
Goes through the Examples and updates the usage to reflect the latest
changes of the toolkit.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Changes to golangci-config
Disable all linters by default and add back the current default ones.
This is done in order to prevent new default linters in the
golangci-lint to take effect without noticing.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Also push elemental-cli on release to ghcr.io
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
---------
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Set labels used by grub to find system disks
This commit sets GRUB persistent variables for filesystem labels after
install/upgrade/reset. These labels are used in the new GRUB
configuration when booting the system.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Changes to recovery/system grub-labels
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Add grub persisten_label
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Try fixing test panic
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Refactor GRUB labels
Add spec->map conversion and tests.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Use same constants package in install action
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Add upgrade tests for grub labels
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Add reset test for grub labels
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
---------
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Elemental image deploy refactor
This commit refactors elemental image deploy procedure to always create
and prepare the root tree in a temporary folder before synching it to
a filesystem image most likely as a mounted loop device.
This change has a couple of immediate benefits:
1. We can precompute the root tree size before creating the filesystem
image. Hence image sizes can be adjusted to root-tree size.
2. There is no path differentiation between filesystems. The root tree
is prepared following the same logic independently of the target
filesystem. Squashfs is no longer an exception, building the image
follows the same logic as it was any other writable filesystem.
We also can argue this is a simple, robust and flexible logic compared
with the previous code.
The counter part is having to prepare the root-tree to later on copy it
to the final image, this causes the root-tree to be written twice, one
to prepare it and another one to sync it to the target location.
* Preserve file mode in CopyFile
* Adapt unit tests
* Fix typo
Signed-off-by: David Cassany <dcassany@suse.com>
This commit adds post-* hooks where the after hooks were originally
defined. After hooks are moved to happen straight in sequence after the
after-*-chroot hooks.
The main motivation for such a change is having a hook that includes the
partition, the running system and the deployed image all mounted and
easily accessible.
Signed-off-by: David Cassany <dcassany@suse.com>
Use elemental-error in new, run-stage, pull-image, cloud-init, convert-disk and build-iso commands.
Fixes#366, #369, #367, #363, #364, #361
If duplicate exit-codes are used in pkg/errors/exit-codes.go the `make
build_docs` will now exit with an error.
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
cli: Add exit-codes to install command
Fixes#365
* Refactor power-action for upgrade and install because of gocyclo lint
* Refactor build-disk to use regular error
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
cli: Add exit-codes to upgrade cmd
Uses the new elemental error to add exit-codes for error paths in the
upgrade command and upgrade action.
Fixes#370
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
* Introduce ElementalError and exit codes
- ElementalError is an enhaced error interface that rbings along the
exit code so we can exit properly from the main cmd command
- Exit codes are stored along the error package
- Build-disk command and related, but confined functions are all using
the new ElementalError to propagate the exit code
Signed-off-by: Itxaka <igarcia@suse.com>
* Add comments to exit error constants
This should result in godoc automatically adding them to the
documentation visible on https://pkg.go.dev/
Signed-off-by: Itxaka <igarcia@suse.com>
* Rename files to sync with the rest of the repo
Signed-off-by: Itxaka <igarcia@suse.com>
* Add more info to exit codes for the docs
Signed-off-by: Itxaka <igarcia@suse.com>
* Maintain numerical order for ease of look
Signed-off-by: Itxaka <igarcia@suse.com>
* Generate the exit-codes md file automatically
This uses the go AST parser to parse the exit-codes.go file and extract
the exit value and the comment, and generate an md file with a nice
table with all the exit codes and its comment, where the comment is mean
to eexplain at a glance what the error came from (file open failed,
download failed, etc...) NOT a big explanation, that is what the logs
are for.
Also the list is ORDERED by error code, so no problems adding extra
codes in the future, the list will keep the order
Signed-off-by: Itxaka <igarcia@suse.com>
Signed-off-by: Itxaka <igarcia@suse.com>