Commit Graph

3792 Commits

Author SHA1 Message Date
Jonathan Lebon
bb079a8f3c
Merge pull request #2713 from Razaloc/kargs1
kargs: add CLI switches --append-if-missing and --delete-if-present
2021-04-23 10:44:35 -04:00
Luca BRUNO
575ffb0ab6 composepost: optimize disk roundtrips
This reduces the amount of mkdir/rmdir performed, directly computing
the parent path instead.
2021-04-22 13:11:52 -04:00
Luca BRUNO
ad365df4b0 composepost: move rootfs symlinks creation to Rust
This ports the post-processing logic which creates symlinks for
several known state directories under /usr.
2021-04-22 13:11:52 -04:00
Rafael G. Ruiz
edd13e35cd kargs: add CLI switches --append-if-missing and --delete-if-present
These new switches will allow users/drivers to more easily make idempotent changes to kernel arguments.

Closes: https://github.com/coreos/rpm-ostree/issues/2709

Signed-off-by: Rafael G. Ruiz <llerrak@hotmail.com>
2021-04-22 17:17:49 +02:00
Jonathan Lebon
02b81d7845
Merge pull request #2773 from lucab/ups/tests-rootfs-symlinks
tests/compose: check symlinks injected into the rootfs
2021-04-21 09:58:52 -04:00
Luca BRUNO
a1573ed8c7
tests/compose: check symlinks injected into the rootfs
This adds some integration tests, covering symlinks injection logic.
2021-04-21 07:18:23 +00:00
Jonathan Lebon
666f7d9df6
Merge pull request #2754 from cgwalters/origin-treefile-prep-2 2021-04-20 10:46:27 -04:00
Luca Bruno
06700f5e29
Merge pull request #2772 from cgwalters/bwrap-fix
Two bwrap /etc fixes
2021-04-20 13:08:49 +00:00
Colin Walters
a798175a85 core: Fix tempetc guard to be no-op if /etc exists
This is further hardening to prevent a situation like
https://github.com/coreos/rpm-ostree/issues/2771
where we would crash on an ostree-based host that has both
`/etc` and `/usr/etc` as physical directories.

That shouldn't happen after the bwrap fix, but we might
as well be more correct here.
2021-04-20 08:12:45 -04:00
Colin Walters
8758b0faa2 bwrap: Fix selftest to be truly immutable
We should never have any effect on the host system, so let's
use the more direct APIs which allow us to use the immutable
flag, don't mount `/var` etc.

Crucially this also avoids us running through the tempetc
guard which would try to rename `usr/etc` which can trigger
on an ostree based host.

Closes: https://github.com/coreos/rpm-ostree/issues/2771
2021-04-20 08:09:57 -04:00
Colin Walters
a015fb345f Expose more from treefile via cxx-rs; adapt _install_langs to use it
We only honor `_install_langs` in the compose path, so move the
code to look at the treefile and move the string concatention to
Rust.
2021-04-19 19:59:06 -04:00
Colin Walters
f2bc1d86ef core: Split off a method to set the treespec
Since in the future we'll operate on a treefile, move the callers
still using treespecs to an explicit API.  This is also clearer
because about half the callers were passing `NULL` for this anyways.
2021-04-19 19:59:06 -04:00
Jonathan Lebon
78b7f934e4 rust/passwd: Fix handling of previous mode
We need to handle the case where no previous commit exists. This is
expressed from the C side by passing the empty string.

We're currently not testing this, though... AFAIK no distro uses this
right now anyway and hopefully we simplify a lot of this when we move to
systemd-sysusers!

Fixes: #2580
Fixes: #2769
2021-04-19 19:56:08 -04:00
Jonathan Lebon
2ad8543b3e
Merge pull request #2758 from cgwalters/treefile-validate-repos
compose: Move repos/lockfile-repos validation to Rust
2021-04-19 11:43:21 -04:00
Jonathan Lebon
4f2c12cf0e
Merge pull request #2762 from coreos/dependabot/submodules/libdnf-be66d09
build(deps): bump libdnf from `930f258` to `be66d09`
2021-04-19 10:01:45 -04:00
Luca Bruno
03fa62558f
Merge pull request #2767 from coreos/dependabot/cargo/curl-0.4.36
build(deps): bump curl from 0.4.35 to 0.4.36
2021-04-19 13:27:38 +00:00
Luca Bruno
610815eb83
Merge pull request #2765 from coreos/dependabot/cargo/ostree-sys-0.7.3
build(deps): bump ostree-sys from 0.7.2 to 0.7.3
2021-04-19 12:35:19 +00:00
dependabot[bot]
83658dda35
build(deps): bump curl from 0.4.35 to 0.4.36
Bumps [curl](https://github.com/alexcrichton/curl-rust) from 0.4.35 to 0.4.36.
- [Release notes](https://github.com/alexcrichton/curl-rust/releases)
- [Commits](https://github.com/alexcrichton/curl-rust/compare/curl-sys-0.4.35...curl-sys-0.4.36)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 12:29:29 +00:00
Luca Bruno
4bf9d17079
Merge pull request #2768 from coreos/dependabot/cargo/openat-0.1.21
build(deps): bump openat from 0.1.20 to 0.1.21
2021-04-19 12:28:10 +00:00
Luca BRUNO
0d79b25a52 postprocess: move /var tmpfiles.d translation logic to Rust
This ports to Rust the auto-tmfiles.d translation logic which is
meant to consume a populated `/var` and to produce a matching
`rpm-ostree-1-autovar.conf` instead.
It also adds a unit-test covering most codepaths.
2021-04-19 07:39:58 -04:00
Luca BRUNO
1ec3b7fd55 tests/compose: add more autovar testcases
This adds some testcases in order to cover more codepaths in the
translation logic.
2021-04-19 07:39:58 -04:00
dependabot[bot]
84e8cec344
build(deps): bump ostree-sys from 0.7.2 to 0.7.3
Bumps [ostree-sys](https://gitlab.com/fkrull/ostree-rs) from 0.7.2 to 0.7.3.
- [Release notes](https://gitlab.com/fkrull/ostree-rs/tags)
- [Commits](https://gitlab.com/fkrull/ostree-rs/commits/master)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 10:15:38 +00:00
dependabot[bot]
95cdc4e678
build(deps): bump openat from 0.1.20 to 0.1.21
Bumps [openat](https://github.com/tailhook/openat) from 0.1.20 to 0.1.21.
- [Release notes](https://github.com/tailhook/openat/releases)
- [Commits](https://github.com/tailhook/openat/compare/v0.1.20...v0.1.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 10:14:18 +00:00
Luca Bruno
acda0753e6
Merge pull request #2764 from coreos/dependabot/cargo/cxx-1.0.45
build(deps): bump cxx from 1.0.43 to 1.0.45
2021-04-19 08:38:23 +00:00
Luca Bruno
44dbfd1fcd
Merge pull request #2763 from coreos/dependabot/cargo/cxx-build-1.0.45
build(deps): bump cxx-build from 1.0.42 to 1.0.45
2021-04-19 08:37:54 +00:00
Luca Bruno
c44ba69c19
Merge pull request #2757 from cgwalters/always-staged
daemon: Always write `staged` JSON field
2021-04-19 07:24:12 +00:00
Luca Bruno
30c45da631
Merge pull request #2759 from cgwalters/origin-treefile-prep-3
core: Remove cancellable/error from context creation APIs
2021-04-19 07:23:04 +00:00
dependabot[bot]
c4b66a0e66
build(deps): bump cxx from 1.0.43 to 1.0.45
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.43 to 1.0.45.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.43...1.0.45)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 06:29:58 +00:00
dependabot[bot]
36ef9b8ca2
build(deps): bump cxx-build from 1.0.42 to 1.0.45
Bumps [cxx-build](https://github.com/dtolnay/cxx) from 1.0.42 to 1.0.45.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.42...1.0.45)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 06:29:45 +00:00
dependabot[bot]
1120838890
build(deps): bump libdnf from 930f258 to be66d09
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `930f258` to `be66d09`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](930f2582f9...be66d0908d)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 05:52:52 +00:00
Colin Walters
324724da2c core: Remove cancellable/error from context creation APIs
A further cleanup, I noticed these functions never throw an
error, and we weren't consistently checking for one anyways.
2021-04-16 17:21:48 -04:00
Colin Walters
db227840f1 daemon: Always write staged JSON field
It's an important property, and it's more self-documenting if we
always emit the value rather than only when it's `true`.
2021-04-16 17:05:48 -04:00
Colin Walters
5845e3ab6a compose: Move repos/lockfile-repos validation to Rust
More prep for removing treespec.
2021-04-16 17:05:11 -04:00
Timothée Ravier
19e40a8708 countme: Force disable Count Me logic in DNF
Make sure that we do not use the internal Count Me logic in DNF in
rpm-ostree as we have our own external implementation that is aware of
the different behavior regarding repo handling.

See also the discussions in:
  - https://github.com/rpm-software-management/libdnf/issues/1174
  - https://github.com/rpm-software-management/libdnf/issues/1068
  - https://github.com/coreos/rpm-ostree/pull/2671

Also remove the corresponding note in the docs which not needed anymore.
2021-04-16 16:01:43 -04:00
Jonathan Lebon
5d199a60f7 .gitignore: add compose-{cache,logs} dirs
And roughly split the file into build system things and "owned" test
things.
2021-04-16 16:00:58 -04:00
Jonathan Lebon
464c368c88
Merge pull request #2753 from cgwalters/fix-cxx-rebuilds
build-sys: Avoid re-building + re-linking cxx-rs C++ bits each build
2021-04-16 14:08:09 -04:00
Luca Bruno
23d15a4a78
Merge pull request #2752 from cgwalters/origin-treefile-prep-1
core: Two minor API cleanups
2021-04-16 16:04:35 +00:00
Colin Walters
2ed1e73c06 build-sys: Avoid re-building + re-linking cxx-rs C++ bits each build
We need to do the same `cmp` dance for the generated `.cxx` file
as for the source, because `make` only works on timestamps.

Currently every time one edits the rust code and types `make`
we end up re-building that object, which also forces a re-link
of the `librpmostreeinternals.la` library.
2021-04-16 10:54:04 -04:00
Colin Walters
22a32a5757 core: Rename context_new_tree() to context_new_compose()
Makes the intention clearer.
2021-04-16 10:46:58 -04:00
Colin Walters
2b554dde64 core: Rename context_new_system() to context_new_client()
Makes the intention clearer.
2021-04-16 10:42:36 -04:00
Jonathan Lebon
b2b3795df1
Merge pull request #2750 from cgwalters/drop-git-mk
build-sys: Drop git.mk, hardcode .gitignore
2021-04-15 17:05:10 -04:00
Colin Walters
cd82724913 build-sys: Drop git.mk, hardcode .gitignore
As rpm-ostree is transitioning to a primarily-Rust project,
our dependency on running `make` to generate `.gitignore` is a
problem.

For example, just opening the project in an IDE that runs rust-analyzer,
the latter will start a build and generate files in the `target/` directory,
but because r-a doesn't know to run `make` we won't have `.gitignore` yet.

I think further what we should do is try changing the C/Automake side
to write generated files into `target/` too.
2021-04-15 11:29:25 -04:00
Jonathan Lebon
d2143986c7
Merge pull request #2742 from cgwalters/treefile-client 2021-04-15 10:45:02 -04:00
Colin Walters
834328f963 Move ref parsing into core
We went through a lot of gyrations on this one.  It's only
relevant to server side composes, so having the core parse
the treefile for it directly just makes sense.
2021-04-14 18:24:42 -04:00
Colin Walters
53b4fc8c26 Read treefile directly for releasever
More draining of treespec to treefile.
2021-04-14 18:24:42 -04:00
Colin Walters
29b63cf270 compose: Remove unused helper functions
No longer needed.
2021-04-14 18:24:42 -04:00
Colin Walters
c792587645 Read treefile directly for selinux and recommends flags
Part of removing treespec in favor of treefile.
2021-04-14 18:24:42 -04:00
Colin Walters
69a79bc8e6 Read treefile directly for documentation flag
Part of removing treespec in favor of treefile.
2021-04-14 18:24:42 -04:00
Colin Walters
6321916436 compose: Pass treefile directly in rpmostree_context_new_tree()
Since the treefile is a requirement for server side composes,
pass the treefile directly there in the setup function.

Prep for dropping "treespec".
2021-04-14 18:24:42 -04:00
Luca BRUNO
8e231b5aad composepost: uniform results and visibility for cxxbridge
This aligns the result types and visibility for all post-processing
functions that are bridged to C++.
2021-04-13 11:15:52 -04:00