Commit Graph

3731 Commits

Author SHA1 Message Date
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
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
Luca BRUNO
c708b47fc9
composepost: expand unit test surface 2021-04-28 13:37:51 +00:00
Jonathan Lebon
e326f9be47
Merge pull request #2726 from cgwalters/use-ostree-ext 2021-04-27 23:07:13 -04:00
Jonathan Lebon
7b568ebef9 tests/compose: Adapt chrony autovar for newer FCOS 2021-04-27 22:10:36 -04:00
Jonathan Lebon
502088e7d3 tests/compose: Change rpmdb test to check for sqlite
That's what FCOS uses now in the latest bump.
2021-04-27 21:06:50 -04:00
Colin Walters
68392638ea tests/compose: Bump pinned fcos commit
Failing to find a locked package, probably pool GC.
2021-04-27 16:34:12 -04:00
Colin Walters
387db0c820 Require ostree v2021.2, use ostree-ext crate
This uses the ostree and ostree-ext crates from git as a demo/WIP
for https://mail.gnome.org/archives/ostree-list/2021-April/msg00000.html
2021-04-27 09:50:02 -04:00
Jonathan Lebon
47c9eb05e6
Merge pull request #2777 from coreos/dependabot/submodules/libdnf-fefe0b6
build(deps): bump libdnf from `be66d09` to `fefe0b6`
2021-04-26 12:13:35 -04:00
Luca Bruno
bd6fe21575
Merge pull request #2779 from coreos/dependabot/cargo/cxx-build-1.0.46
build(deps): bump cxx-build from 1.0.45 to 1.0.46
2021-04-26 14:00:08 +00:00
Luca Bruno
139639e7e3
Merge pull request #2781 from coreos/dependabot/cargo/cxx-1.0.46
build(deps): bump cxx from 1.0.45 to 1.0.46
2021-04-26 13:59:41 +00:00
dependabot[bot]
1a53403483
build(deps): bump cxx from 1.0.45 to 1.0.46
Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.45 to 1.0.46.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.45...1.0.46)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 10:23:55 +00:00
Luca Bruno
9ac0394ebe
Merge pull request #2780 from coreos/dependabot/cargo/fn-error-context-0.1.2
build(deps): bump fn-error-context from 0.1.1 to 0.1.2
2021-04-26 08:01:54 +00:00
dependabot[bot]
cc84519413
build(deps): bump fn-error-context from 0.1.1 to 0.1.2
Bumps [fn-error-context](https://github.com/andrewhickman/fn-error-context) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/andrewhickman/fn-error-context/releases)
- [Changelog](https://github.com/andrewhickman/fn-error-context/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andrewhickman/fn-error-context/compare/v0.1.1...v0.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 06:59:43 +00:00
dependabot[bot]
5909d17081
build(deps): bump cxx-build from 1.0.45 to 1.0.46
Bumps [cxx-build](https://github.com/dtolnay/cxx) from 1.0.45 to 1.0.46.
- [Release notes](https://github.com/dtolnay/cxx/releases)
- [Commits](https://github.com/dtolnay/cxx/compare/1.0.45...1.0.46)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 06:59:37 +00:00
dependabot[bot]
d6222866c1
build(deps): bump libdnf from be66d09 to fefe0b6
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `be66d09` to `fefe0b6`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](be66d0908d...fefe0b69e8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 06:04:06 +00:00
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