Commit Graph

27 Commits

Author SHA1 Message Date
Fredrik Lönnegren f132230beb Update copyright year (2025)
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2025-01-07 16:43:28 +01:00
David Cassany Viladomat 4d469e7f3a
Enable SELinux for tumbleweed and green (#2052)
* Enable SELinux for tumbleweed and rename it to green

Signed-off-by: David Cassany <dcassany@suse.com>

* Disable SELinux on recovery and refine relabelling

Signed-off-by: David Cassany <dcassany@suse.com>

* Remove k3s-selinux, not needed for examples

Signed-off-by: David Cassany <dcassany@suse.com>

* Improve SELinux labelling

Signed-off-by: David Cassany <dcassany@suse.com>

* Fix unit tests

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-04-29 15:20:36 +02:00
David Cassany Viladomat c05f5d4913
bump elemental-toolkit to v2 (#1969)
* 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>
2024-03-08 09:14:56 +01:00
David Cassany 2e18efa696 Bump twpayne/vfs module to latest version
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>
2024-01-19 16:56:49 +01:00
Fredrik Lönnegren cd4e009b88 Update copyright year (2024)
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-01-09 09:44:34 +01:00
David Cassany Viladomat 3ea9d757e4
build-disk command (#1794)
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>
2023-10-17 14:26:19 +02:00
Fredrik Lönnegren 1262bcd099 Move elemental-cli into elemental-toolkit module
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-16 09:43:57 +02:00
David Cassany be54c0707f Use year range in copyright headers instead of just bumping the year
Signed-off-by: David Cassany <dcassany@suse.com>
2023-01-12 11:13:33 +01:00
David Cassany 408d2ab56f Bump year in copyright headers
Signed-off-by: David Cassany <dcassany@suse.com>
2023-01-12 11:13:33 +01:00
David Cassany Viladomat 26cc964d65
Keep working dir after a chroot call (#324)
* Keep working dir after a chroot call

Signed-off-by: David Cassany <dcassany@suse.com>
2022-09-22 09:27:09 +02:00
David Cassany Viladomat 04bb568dae
Relabel SELinux in a chroot env (#230)
* Relabel SELinux in a chroot env

Signed-off-by: David Cassany <dcassany@suse.com>
2022-06-07 15:47:11 +02:00
Francesco Giudici 6458932b86
Rename package to rancher/elemental-cli (#236)
Update package name and internal references.

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
2022-06-06 15:27:57 +02:00
David Cassany Viladomat 92858434df
Refactor runconfig (#189)
Refactor of RunConfig struct to include more structured data to facilitate reuse of core elemental API and significantly improve configuration options and opportunities by using yaml configuration files.

Signed-off-by: David Cassany <dcassany@suse.com>
2022-05-18 09:39:58 +02:00
David Cassany Viladomat de9b709d8c
Use default dir permissions constant (#137)
Signed-off-by: David Cassany <dcassany@suse.com>
2022-03-11 11:41:36 +00:00
Ettore Di Giacinto 785ef65cec
Check partial yaml unmarshal errors and unify FS (#125)
* 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>
2022-03-09 18:31:17 +01:00
Itxaka 491b27d09a
Use golangci for lint+license check (#123) 2022-03-03 09:49:22 +00:00
Itxaka 4ae243b2cc
upgrade from channel (#81) 2022-02-09 10:52:46 +00:00
David Cassany Viladomat 464f589caa
Add a Chroot.RunCallback method (#84)
This commit add the RunCallback method on Chroot object.

This also fixes the action.ActionChrootHook.

Signed-off-by: David Cassany <dcassany@suse.com>
2022-02-07 11:29:05 +01:00
Itxaka b6e6413381
Add upgrade command (#59) 2022-02-03 18:53:18 +01:00
Itxaka 30ddad2f81
Rename the package to elemental (#43) 2022-01-23 18:32:17 +01:00
David Cassany Viladomat 52289dd1ab
Fix and add missing installer features (#32)
* Fix gpt and efi basic installations

This commit is two fold:

* Moves partitioner tests to ginkgo
* Fixes and polishes the installation for GPT and EFI use cases

Signed-off-by: David Cassany <dcassany@suse.com>

* Add installation hooks

Signed-off-by: David Cassany <dcassany@suse.com>

* Add --no-format flag support

Signed-off-by: David Cassany <dcassany@suse.com>
2021-12-31 10:56:45 +01:00
Itxaka b00ed0951a Add godoc
Signed-off-by: Itxaka <igarcia@suse.com>
2021-12-15 09:37:47 +01:00
Itxaka 57c5e2f774 Rework config to store all the needed interfaces
Instead of having to initialize runners, logger and all that stuff all
around, just do it once, when you obtain the runConnfig, so then all we
need to do is access that value and pass the config around, which we are
gonna do anyway

Signed-off-by: Itxaka <igarcia@suse.com>
2021-12-13 21:44:57 +01:00
Itxaka 267b376a70 Use logger all around
Signed-off-by: Itxaka <igarcia@suse.com>
2021-12-13 14:43:33 +01:00
Itxaka ad9e90f898 sync FakeHttpclient with other fakes
Signed-off-by: Itxaka <igarcia@suse.com>
2021-12-10 14:13:47 +01:00
Itxaka 1ff314715d Add better chroot testing
Signed-off-by: Itxaka <igarcia@suse.com>
2021-12-10 10:07:00 +01:00
Itxaka 332d0289f2 Add chroot util to run commands under chroot
Signed-off-by: Itxaka <igarcia@suse.com>
2021-12-10 10:07:00 +01:00