Commit Graph

3806 Commits

Author SHA1 Message Date
Timothée Ravier
95de194f59 *: rename master branch to main 2021-05-07 16:12:45 +02:00
Timothée Ravier
c7bf08789d countme: Drop SELinux workaround/unpriv copy of rpm-ostree
The SELinux policy change has been merged and released upstream.

This reverts:
5d5ccf01 Install a temporary copy of rpm-ostree for unprivileged use
2021-05-07 08:41:22 -04:00
Jonathan Lebon
c05460380a treefile: Fix rpmdb backend casing
We're using `kebab-case` so serde translates capitalized letters like
`BDB` as `b-d-b`, which is not what we want here.
2021-05-06 15:49:21 -04:00
Luca Bruno
c29421c429
Merge pull request #2811 from coreos/dependabot/cargo/tracing-0.1.26
build(deps): bump tracing from 0.1.25 to 0.1.26
2021-05-06 14:00:15 +00:00
Jonathan Lebon
f33c2c8c6c
Merge pull request #2776 from Razaloc/exit-77
kargs: Add CLI switch --unchanged-exit-77
2021-05-06 09:41:42 -04:00
dependabot[bot]
5243f95ee2
build(deps): bump tracing from 0.1.25 to 0.1.26
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.25 to 0.1.26.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.25...tracing-0.1.26)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 12:55:18 +00:00
Luca Bruno
5b068dadfe
Merge pull request #2803 from coreos/dependabot/cargo/tracing-subscriber-0.2.18
build(deps): bump tracing-subscriber from 0.2.17 to 0.2.18
2021-05-06 12:54:23 +00:00
dependabot[bot]
29a5d3b2ad
build(deps): bump tracing-subscriber from 0.2.17 to 0.2.18
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.17...tracing-subscriber-0.2.18)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 10:54:53 +00:00
Luca Bruno
0d9a5dc1a3
Merge pull request #2804 from coreos/dependabot/cargo/cxx-build-1.0.49
build(deps): bump cxx-build from 1.0.47 to 1.0.49
2021-05-06 10:53:49 +00:00
Luca Bruno
5ce024676f
Merge pull request #2802 from coreos/dependabot/cargo/cxx-1.0.49
build(deps): bump cxx from 1.0.48 to 1.0.49
2021-05-06 10:53:24 +00:00
dependabot[bot]
221796a4ec
build(deps): bump cxx-build from 1.0.47 to 1.0.49
Bumps [cxx-build](https://github.com/dtolnay/cxx) from 1.0.47 to 1.0.49.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.47...1.0.49)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 09:03:49 +00:00
dependabot[bot]
a6a73d9e38
build(deps): bump cxx from 1.0.48 to 1.0.49
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.48 to 1.0.49.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.48...1.0.49)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 09:03:40 +00:00
Rafael G. Ruiz
6246b990a9 kargs: Add CLI switch --unchanged-exit-77
The new switch will rise an exit code 77 if kernel args are unchanged

Closes: #1802

Signed-off-by: Rafael G. Ruiz <llerrak@hotmail.com>
2021-05-05 23:19:52 +02:00
Jonathan Lebon
13dcc5950b
Merge pull request #2799 from cgwalters/minor-treefile-cleanup
treefile: Minor cleanup of handle_repo_packages_overrides()
2021-05-05 16:50:54 -04:00
Colin Walters
73b9d2ff3b treefile: Minor cleanup of handle_repo_packages_overrides()
This isn't important at all, but I am just trying to up my
"Rust iterator and mapping" skills.  Here:

- In this case we always want to go from `Option<T>` to `Option<T>`,
  so instead of destructuring `Some()` back to another `Some()`
  we can use `as_mut()` to manipulate the inner vector directly.
- Now instead of destroying the inner `Vec<>` we need to use `drain()`
  instead
- And then we can just `extend()` with a reversed iterator from
  our explicit temporary
2021-05-05 15:52:52 -04:00
Jonathan Lebon
7fe133b6d8
Merge pull request #2807 from lucab/ups/tests-override-kernel-f34
tests/override-kernel: add f34 kernel
2021-05-05 09:58:22 -04:00
Jonathan Lebon
7f19930916 tests/vmcheck/misc-2: Update error message to grep for
For some reason, in f34 the error that libostree gets now when trying to
checkout a file on top of an existing one with different content is no
longer EEXIST but EPERM.

Likely due to a change in the kernel or glibc though some quick googling
doesn't reveal anything.
2021-05-04 15:58:14 -04:00
Luca BRUNO
7ece1846c0
tests/override-kernel: add f34 kernel
This adds support for Fedora 34.
2021-05-04 14:58:12 +00:00
Colin Walters
12cc4e5f5b composepost: Fix race condition in timestamp checking
`syncfs()` isn't going to do anything on e.g. `tmpfs` and even
if it did wouldn't fix any race conditions because that's about
synchronizing in memory changes to disk, but won't change
what system calls return.

Some investigation turned up
https://stackoverflow.com/questions/14392975/timestamp-accuracy-on-ext4-sub-millsecond
and `current_fs_time` is now:
https://www.kernel.org/doc/html/v5.12/core-api/timekeeping.html

Basically there's a "coarse" time that might only update once every 10ms
for example.

Let's just sleep 100ms for now.

I think we should be using the inode versions, but we can investigate
that separately.
2021-04-30 15:15:10 -04:00
Jonathan Lebon
a42fcd06c7
Merge pull request #2800 from cgwalters/camino
Add and use the `camino` library for UTF-8 paths
2021-04-30 11:15:40 -04:00
Colin Walters
7b57f2b9d0 Add and use the camino library for UTF-8 paths
ostree hard requires UTF-8 paths (and really we should
never have any non-UTF-8 paths in the OS in general).  The
camino library has types that are both `Path` and `&str` and
has a convenient `try_into()` too to avoid us duplicating
the error handling.
2021-04-30 09:56:05 -04:00
Jonathan Lebon
ba7a72995b treefile: Add new repo-packages field for pinning packages to repos
This addresses the server compose side of
https://github.com/coreos/rpm-ostree/issues/2584.

One tricky bit is handling overrides across included treefiles (or
really, even within a single treefile): as usual, higher-level treefiles
should override lowel-level ones. Rust makes it pretty nice to handle.

For now this just supports a `repo` field, but one could imagine e.g.
`repos` (which takes an array of repoids instead), or e.g.
`exclude-repos`.

The actual core implementation otherwise is pretty straightforward.

This should help a lot in RHCOS where we currently use many `exclude=`
directives in repo files to get it to do what we want.

This is also kind of a requirement for modularity support because as
soon as rpm-ostree becomes modules-aware, modular filtering logic will
break composes which assume rpm-ostree treats modular and non-modular
packages the same.
2021-04-30 09:13:18 -04:00
Luca BRUNO
3b76a7eeef composepost: move rpmdb linking logic to Rust
This ports the rpmdb hardlinking logic which serves to maintain
a coherent single source of truth across tools.
2021-04-29 16:05:27 -04:00
Luca Bruno
30d5c79272
Merge pull request #2795 from coreos/dependabot/cargo/cxx-1.0.48
build(deps): bump cxx from 1.0.47 to 1.0.48
2021-04-29 15:17:47 +00:00
Luca BRUNO
f1138dd134 composepost: move SELinux workaround logic to Rust
This ports the timestamp updating logic which serves as a workaround
for SELinux leaking host details.
2021-04-29 10:47:13 -04:00
Timothée Ravier
9ee8bbb6f7 daemon: Only update idle status every 10 seconds
This slightly reduces DBus traffic on nodes as we don't really need to
update systemd status more often than that.
2021-04-29 09:56:27 -04:00
Jonathan Lebon
2ed6e40cd2 core: Add comment about SERVER_BASE commits
This made me hesitate for a bit so add a comment about it to make it
clear. The RPMOSTREE_ASSEMBLE_TYPE_SERVER_BASE path was used by the `ex
container`, which was subsequently ripped out.
2021-04-29 09:52:02 -04:00
Jonathan Lebon
fdd6ff83cb rust/treefile: Fix minor comment typo 2021-04-29 09:52:02 -04:00
Jonathan Lebon
c095b97bf3 libpriv: Bridge print_treepkg_diff_from_sysroot_path()
This will be necessary for Rust-based client commands to be able to do
the regular "post-deployment package diff".
2021-04-29 09:52:02 -04:00
Jonathan Lebon
0474d40138 rust: Drop includes.rs
This dates from the cbindgen era and isn't needed anymore.
2021-04-29 09:52:02 -04:00
Jonathan Lebon
d465eeac68 rust/main: Pass CLI args to command entrypoints
The only entrypoint so far doesn't use it (`countme`), but a future new
entrypoint will.

Also mention that the commands should add themselves to the array in
libmain.cxx if applicable so it shows up in `--help`.
2021-04-29 09:52:02 -04:00
dependabot[bot]
06aad3adf1
build(deps): bump cxx from 1.0.47 to 1.0.48
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.47 to 1.0.48.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.47...1.0.48)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-29 08:55:14 +00:00
Luca Bruno
4ad6ebe84b
Merge pull request #2784 from cgwalters/add-tracing
Add Rust tracing crate usage
2021-04-29 08:41:47 +00:00
Luca Bruno
f8af33c227
Merge pull request #2794 from coreos/dependabot/cargo/openat-ext-0.2.1
build(deps): bump openat-ext from 0.2.0 to 0.2.1
2021-04-29 08:18:23 +00:00
dependabot[bot]
e5df2be8c0
build(deps): bump openat-ext from 0.2.0 to 0.2.1
Bumps [openat-ext](https://github.com/coreos/openat-ext) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/coreos/openat-ext/releases)
- [Commits](https://github.com/coreos/openat-ext/compare/v0.2.0...v0.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-29 07:12:31 +00:00
Luca Bruno
bb971372ec
Merge pull request #2793 from coreos/dependabot/cargo/cxx-build-1.0.47
build(deps): bump cxx-build from 1.0.46 to 1.0.47
2021-04-28 23:22:32 +00:00
Jonathan Lebon
9348e44a55
Merge pull request #2782 from dustymabe/dusty-rpm-vercmp
lib/package: Fix rpm version comparison
2021-04-28 17:59:24 -04:00
Luca Bruno
0fd78e4078
Merge pull request #2792 from coreos/dependabot/cargo/libc-0.2.94
build(deps): bump libc from 0.2.93 to 0.2.94
2021-04-28 21:15:33 +00:00
Luca Bruno
9832b108fe
Merge pull request #2791 from coreos/dependabot/cargo/cxx-1.0.47
build(deps): bump cxx from 1.0.46 to 1.0.47
2021-04-28 21:13:47 +00:00
Dusty Mabe
9e45eed598 lib/package: Fix rpm version comparison
`rpmvercmp()` doesn't properly compare full EVR. It needs to
be given the Version and Release separately in order to do
a comparison. For example `rpmVersionCompare()` first calls
`rpmvercmp()` to compare the Version and then checks the Release
in a second call to `rpmvercmp()`.

35739c2a22/lib/headerutil.c (L434-L440)

Let's just use `rpmverCmp()` instead, which can do the full
EVR comparison.

Fixes: https://github.com/coreos/rpm-ostree/issues/2668
2021-04-28 16:45:50 -04:00
Jonathan Lebon
ed6f485cd6
Merge pull request #2783 from cgwalters/bump-non-unified-core-pain
compose: Bump timeout for non-unified-core to 10s
2021-04-28 16:39:17 -04:00
dependabot[bot]
bdd1a656db
build(deps): bump cxx-build from 1.0.46 to 1.0.47
Bumps [cxx-build](https://github.com/dtolnay/cxx) from 1.0.46 to 1.0.47.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.46...1.0.47)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-28 19:34:31 +00:00
dependabot[bot]
cdc8536571
build(deps): bump libc from 0.2.93 to 0.2.94
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.93 to 0.2.94.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.93...0.2.94)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-28 19:34:27 +00:00
dependabot[bot]
2509003b69
build(deps): bump cxx from 1.0.46 to 1.0.47
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.46 to 1.0.47.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.46...1.0.47)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-28 19:34:23 +00:00
Colin Walters
793d91d71b compose: Bump timeout for non-unified-core to 10s
The goal is to make this increasingly annoying until consumers port.
2021-04-28 15:32:57 -04:00
Colin Walters
b2c8c0fba6 Add Rust tracing crate usage
Related to https://github.com/ostreedev/ostree-rs-ext/pull/21
And inspired by seeing some discussion around the
https://crates.io/crates/tracing
crate.
2021-04-28 15:32:42 -04:00
Luca Bruno
178e2200e9
Merge pull request #2789 from lucab/ups/composepost-tmp-chmod
composepost: fix fchmod flags for tmpdir (glibc compat)
2021-04-28 19:30:46 +00:00
Jonathan Lebon
07af1016ee
Merge pull request #2790 from cgwalters/fix-non-unified-core
Fix bwrap usage for mutate-os-release
2021-04-28 14:32:33 -04:00
Colin Walters
e2bcf01ac1 Fix bwrap usage for mutate-os-release
Followup to https://pagure.io/fedora-infrastructure/issue/9909

In the refactor we were passing `unified_core: true` unconditionally which was wrong,
as that implies using fuse.  Anyways what we really want here is an immutable bwrap
and not `rofiles-fuse` annyways.  So refactor things to use that.

From https://kojipkgs.fedoraproject.org//work/tasks/7579/66867579/runroot.log
```
fuse: device not found, try 'modprobe fuse' first
fuse: device not found, try 'modprobe fuse' first
bwrap: execvp realpath: No such file or directory
fusermount: failed to unmount /tmp/rpmostree-rofiles-fuseAAphRY: Invalid argument
fusermount: failed to unmount /tmp/rpmostree-rofiles-fuseSCLs24: Invalid argument
error: Updating os-release with commit version: Running realpath: bwrap(realpath): Child process killed by signal 1
```
2021-04-28 13:27:40 -04:00
Luca BRUNO
6c75f57766
composepost: fix fchmod flags for tmpdir (glibc compat)
The `AT_SYMLINK_NOFOLLOW` flag for chmod was not implemented in glibc
until very recent releases (v2.32 in 2020-08).
Before that version, passing this flag will always result in `ENOTSUP`.

Refs:
 * https://github.com/bminor/glibc/blob/glibc-2.31/sysdeps/unix/sysv/linux/fchmodat.c#L36
 * https://github.com/bminor/glibc/blob/glibc-2.32/sysdeps/unix/sysv/linux/fchmodat.c
2021-04-28 13:38:40 +00:00