* 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>
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 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>
This commit removes all blkid calls and wraps lsblk in a more
normalized and generic way. lsblk is only called in two methods:
* GetDevicePartitions: returns a v1.PartitionList with all the
partitions or loop devices for the given device path.
* GetAllPartitions: returns a v1.PartitionList with all the partitions
and loop devices of the host.
Signed-off-by: David Cassany <dcassany@suse.com>
* Check partial yaml unmarshal errors
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
* Make sure cloud-init paths are created in the system
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
* Don't use terminal to read cmdline
Also, refactor common code
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
* Introduce FS interface
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
* Get rid of afero
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
* Add fs to rsync command
This allows the rsync library we use beneath to be fs-aware.
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
* Mitigate licence check on fs.go
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
This commit makes use of the partitioner elemental package to provide a
custom implementation of the yip's layout plugin. This has the benefit
of adding support for MSDOS partition tables.
In order to make that happen few refactors were needed:
* Separate cloud-init-runner interface and implementation in separate
packages.
* Extend v1.Runner interface
* Separate v1.RunConfig initializer to a separate package
Signed-off-by: David Cassany <dcassany@suse.com>