Commit Graph

3081 Commits

Author SHA1 Message Date
Colin Walters
d79e0e5c77 Port rpmostree-postprocess to C++
Prep for using https://cxx.rs/
2020-12-08 09:57:08 -05:00
Colin Walters
6722496bb1 app: Port dbus-helpers to C++
Prep for using https://cxx.rs/
2020-12-08 09:57:08 -05:00
dependabot[bot]
b275c30bcd build(deps): bump libdnf from 35f2062 to 028bc35
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `35f2062` to `028bc35`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](35f2062c85...028bc355b9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 04:48:21 -05:00
dependabot[bot]
215ed95e47 build(deps): bump serde_json from 1.0.59 to 1.0.60 in /rust
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.59 to 1.0.60.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.59...v1.0.60)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-08 03:53:49 -05:00
dependabot[bot]
03fcca6f38 build(deps): bump libc from 0.2.80 to 0.2.81 in /rust
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.80 to 0.2.81.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.80...0.2.81)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 18:03:12 -05:00
Colin Walters
eeb97e724e Add a helper move_nullify
This avoids the casts required for `g_steal_pointer()`.
2020-12-07 17:38:13 -05:00
Colin Walters
cd2307ccc2 tests: Add case for running rpm -q in a %post
On traditional rpm systems this can hang because the outer
process may have an rpmdb lock, and the inner one wants
to acquire a lock.  Here we're sandboxing the `%post` script
and it's targeting a separate temporary filesystem compared to
the booted one (so there's no double locking).  Plus we don't
create the rpmdb in the target until all scripts have run.

Inspired by https://twitter.com/_msw_/status/1335981558717587473
2020-12-07 15:09:44 -05:00
Jonathan Lebon
73fe78140d history: Use shorthand struct initialization
This lit up in my editor.
2020-12-07 12:58:33 -05:00
Jonathan Lebon
063fa9c7eb app/history: Limit entries to print to 3
I've been meaning to hook up `ex history` to a pager a-la-journalctl,
though it's not high-priority, and it'd be nice to do it in Rust instead
(I think this command would be a good candidate for more oxidation if we
move the CLI entrypoint to Rust.)

For now at least, let's not spam the full history by default. Instead,
limit it to 3, and add `--limit` and `--all` options to tweak that if
wanted (I thought about making `--limit -1` just mean all entries,
though I think I'd still want an explicit `--all` anyway.)
2020-12-07 12:58:33 -05:00
dependabot[bot]
e6bcb855d6 build(deps): bump anyhow from 1.0.34 to 1.0.35 in /rust
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.34 to 1.0.35.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.34...1.0.35)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 11:40:00 -05:00
dependabot[bot]
3bc356cc16 build(deps): bump libglnx from a8b4418 to 900caea
Bumps libglnx from `a8b4418` to `900caea`.

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 10:06:37 -05:00
Luca BRUNO
57f7e1fa8e core: add a guard for temporary-etc context and move to Rust
This adds a guard around the postprocessing logic dealing with
creating/destroying a temporary-etc context, and moves it to Rust.
2020-12-07 08:23:49 -05:00
Luca BRUNO
1b00f13d34 tests/override-kernel: support f33 2020-12-07 07:58:18 -05:00
Luca BRUNO
1c954a01cb Revert "ci: Freeze FCOS commit to f32"
This reverts commit eaf8ab8cf3.
2020-12-07 07:58:18 -05:00
Luca BRUNO
c3b37a0c3b tests/jsonutil: update invalid specifier
This fixes the invalid datetime testcase, picking a new specifier
as `%f` recently became a valid one in glib.

Ref: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1605
2020-12-07 07:58:18 -05:00
Colin Walters
da78b51e94 bindgen: Bump to 0.15
We've been neglecting this for a long time and it's been omitted
from dependabot.  Everything still seems to work.

Prep for converting to a workspace so we only have a single
`Cargo.lock`.
2020-12-04 04:03:54 -05:00
Colin Walters
a0a5db7b73 compose: Use static enablement for ostree systemd services
I was looking at the output of `ostree admin config-diff`
on a base FCOS boot.  It'd be really nice to trim that down
as much as possible, so we can cleanly capture the difference
between user config and system config.

Let's use static enablement rather than presets.
2020-12-02 22:40:31 +01:00
Colin Walters
bee9c0f605 Remove ex-container
I still think we should do this at some point, but
the experiment with using `GKeyfile` for configuration
is IMO a failure and the variety of data formats
(treefile JSON vs YAML vs origin keyfiles vs container keyfiles)
causes a lot of confusion.

Prep for https://github.com/coreos/rpm-ostree/issues/2326
2020-12-01 23:51:45 +01:00
Colin Walters
887d362906 Convert some code to compile in C++ mode
This is part of investigating using https://cxx.rs/
In order to make this really work, we need to convert some of our C
code to C++ so we can include cxx.rs-generated code.

This starts by converting just two files as a starting point.
I did the minimal porting; I didn't try to actually rewrite them
to resemble modern C++, just "C in C++ mode".
2020-12-01 22:07:49 +01:00
dependabot[bot]
ecbc805d6f build(deps): bump libdnf from 7b7df67 to 35f2062
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `7b7df67` to `35f2062`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](7b7df67e1f...35f2062c85)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-30 18:38:08 +01:00
dependabot[bot]
be41946737 build(deps): bump nix from 0.19.0 to 0.19.1 in /rust
Bumps [nix](https://github.com/nix-rust/nix) from 0.19.0 to 0.19.1.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.19.0...v0.19.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-30 18:10:22 +01:00
Jonathan Lebon
b42ec86dbe daemon: Drop CreateOSName
This is technically an API break, but that method has never really been
very useful and I doubt it was ever seriously used. There is no wrapper
for it in the CLI client. Let's just delete it and pretend it never
existed.

In the end, I don't think the ability of supporting multiple separate
stateroots is widely used in practice.

Closes: #551
2020-11-29 20:51:31 +01:00
Colin Walters
67db9342bd scripts: Neuter RHEL8 nvme-cli %post
There's some crazy stuff going on there with udev rules
that we don't need.  See some discussion in
https://bugzilla.redhat.com/show_bug.cgi?id=1742764

Filed for RHEL8 as https://bugzilla.redhat.com/show_bug.cgi?id=1900691
2020-11-23 16:27:19 +01:00
Colin Walters
5e4b37c354 tree-wide: Add extern "C" wrapping to our headers
Prep for (potentially) using https://cxx.rs
We want our header files to be includable in C++.
2020-11-23 13:56:13 +01:00
dependabot[bot]
75404fb0b5 build(deps): bump libglnx from 493d399 to a8b4418
Bumps libglnx from `493d399` to `a8b4418`.

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 11:54:09 +01:00
dependabot[bot]
09e2c6ea6b build(deps): bump libdnf from dd2abd1 to 7b7df67
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `dd2abd1` to `7b7df67`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](dd2abd1564...7b7df67e1f)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 10:25:09 +01:00
Jonathan Lebon
589d0cbd2b rust: Move to new systemd journal API for opening
The `Journal::open` API has been deprecated in favour of the new
`OpenOptions` builder pattern.

We could dedupe this a bit more, though the mock journal in the history
code makes it trickier and there's little value in mocking the builder
pattern too.
2020-11-19 00:09:27 +01:00
Colin Walters
956d96bd1f livefs: Fix --target, add --reset and print diff
Makes this more useful.
2020-11-17 22:34:44 +01:00
Prajna Sariputra
3412108ad0 docs: Update links to the OSTree documentation
Those got moved to GitHub from readthedocs.io, meaning links pointing
to specific pages return a 404, so this fixes that along with
skipping the redirect for the links that just point to the main page.
2020-11-17 14:14:23 +01:00
Colin Walters
341ec7d044 service: Enable ProtectHome=true
We have no business accessing `/var/roothome` or `/var/home`.  In general
the ostree design clearly avoids touching those, but since systemd offers
us easy tools to toggle on protection, let's use them.  In the future
it'd be nice to do something like using `DynamicUser=yes` for the main service,
and have a system `rpm-ostreed-transaction.service` that runs privileged
but as a subprocess.
2020-11-16 19:07:16 +01:00
Colin Walters
a76ddf0cef Rewrite livefs
Now always based on an overlayfs:
f2773c1b55
This fixes a whole swath of problems with the previous design,
including the danger in replacing `/usr/lib/ostree-boot` which
broke booting for some people.

Further, we don't need to push a rollback deployment; the livefs
changes are always transient.  So now we store livefs state
in `/run` instead of in the origin file.

Since we're doing a rewrite, it's now in Rust for much more safety.

We also always work in terms of incremental diffs between commits;
the previous huge hammer of swapping `/usr` was way too dangerous.
2020-11-16 19:07:16 +01:00
dependabot[bot]
213d8f0aa2 build(deps): bump openat-ext from 0.1.8 to 0.1.9 in /rust
Bumps [openat-ext](https://github.com/cgwalters/openat-ext) from 0.1.8 to 0.1.9.
- [Release notes](https://github.com/cgwalters/openat-ext/releases)
- [Commits](https://github.com/cgwalters/openat-ext/compare/v0.1.8...v0.1.9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 11:02:20 +01:00
dependabot[bot]
f77cf1a968 build(deps): bump systemd from 0.7.1 to 0.8.1 in /rust
Bumps [systemd](https://github.com/jmesmon/rust-systemd) from 0.7.1 to 0.8.1.
- [Release notes](https://github.com/jmesmon/rust-systemd/releases)
- [Commits](https://github.com/jmesmon/rust-systemd/compare/systemd-0.7.1...systemd-0.8.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 10:39:06 +01:00
dependabot[bot]
858239b8b1 build(deps): bump libdnf from 0b09cd8 to dd2abd1
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `0b09cd8` to `dd2abd1`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](0b09cd850e...dd2abd1564)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 09:58:22 +01:00
Jonathan Lebon
a3bd694e53 core: Disable libdnf plugin loading
The libdnf plugins are not really relevant for us (the only in-tree one
is for RHSM). Let's tell libdnf to not even bother trying to load them
in.

Prompted by the fact that libdnf tries to load the plugins from the
bundled path which doesn't exist:

```
libdnf-WARNING **: 13:49:33.207: Can't read plugin directory
"/usr/libexec/rpm-ostree/lib64/libdnf/plugins/": No such file or
directory
```

In test contexts, this warning causes a `SIGABRT`.
2020-11-14 12:42:27 +01:00
dependabot[bot]
c2bebe9991 build(deps): bump libdnf from 53aca12 to 0b09cd8
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `53aca12` to `0b09cd8`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](53aca1273b...0b09cd850e)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-14 12:42:27 +01:00
Colin Walters
96dea82c50 Release 2020.8
This mainly has two build-side fixes for coreos-assembler.
2020-11-13 23:03:23 +01:00
Jonathan Lebon
eaf8ab8cf3 ci: Freeze FCOS commit to f32
Short-term workaround until cosa is bumped to f33. See:
- https://github.com/coreos/rpm-ostree/pull/2320
- https://github.com/coreos/coreos-assembler/issues/1863
2020-11-13 23:03:23 +01:00
Colin Walters
7ed1c0b1e8 Remove coreos-rootfs command
This effectively reverts commit: c8113bde32
We never ended up using it; instead the `rdcore` bits from
`coreos-installer` have the rootfs reprovisioning logic.
2020-11-12 18:59:49 +01:00
Luca BRUNO
b4e4005f56 sh: fix bash shebang
This updates a couple of shebangs for scripts using bash `pipefail`
option.
2020-11-11 16:50:43 +01:00
Colin Walters
a46db3ddc6 compose: Add --previous-commit
This allows us to fix RHCOS builds with coreos-assembler
after e76b270198
That broke change detection.

We need to explicitly provide the previous commit.  This is
very similar to `--parent`, and arguably we should
have made `--parent` have change detection semantics too
at the time.
2020-11-10 14:27:26 +00:00
dependabot[bot]
f069cd24e3 build(deps): bump libglnx from 1dd01d5 to 493d399
Bumps libglnx from `1dd01d5` to `493d399`.

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-09 14:29:52 +00:00
dependabot[bot]
25c80101fc build(deps): bump anyhow from 1.0.33 to 1.0.34 in /rust
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.33 to 1.0.34.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.33...1.0.34)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-09 08:08:30 +00:00
Colin Walters
6ccf0e06bb treefile: Fix hashing of externals
See https://github.com/coreos/rpm-ostree/pull/2206#issuecomment-721372634

The commit 7f579a55d3fb7ec1cb9f74f8ec6bc36675df2ccc broke hashing
of overlay commits; this is a super evil bug because it causes us
to silently do the wrong thing.

The cause here is the GLib bindings don't (AFAICS) support getting
a `&mut` for a GLib boxed value.

Move all of the treefile checksum code into one place - this is
far saner.  The reason I didn't do this before is that it
will cause a spurious rebuild when one updates rpm-ostree, but...eh.
2020-11-04 22:05:54 +01:00
Colin Walters
ed44037155 scripts: Link to lua issue on error
Everyone who hits this really just wants to see the GH issue.
2020-11-04 13:15:57 +01:00
Jonathan Lebon
bc61622a79 Drop use of volatile
As detailed in
https://gitlab.gnome.org/GNOME/glib/-/issues/600#note_877282, `volatile`
isn't actually needed in these contexts because the atomic operations
already give us strong enough guarantees. In GCC 11, this triggers a
diagnostic due to the `volatile` qualifier getting dropped anyway.

There is a WIP to do the same in glib:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

This obsoletes this downstream patch:
https://src.fedoraproject.org/rpms/rpm-ostree/c/bbd2d17f
2020-11-04 06:04:24 -05:00
Colin Walters
10906f4a00 rust/lockfile: Use from_glib_full to avoid manual free
This is cleaner.
2020-11-04 03:48:42 -05:00
Colin Walters
96c2d8998d daemon: Rewrite some core initramfs-overlay logic in Rust
We had a memory safety/UB bug in the C code; let's use
that as a good motivation to rewrite in Rust.  It's a nice
self contained bit.
2020-11-02 21:27:35 +01:00
Jonathan Lebon
a1b35d0d75 Release 2020.7
To get https://github.com/coreos/rpm-ostree/pull/2301 out.
2020-11-02 16:47:10 +01:00
dependabot[bot]
542453a1f9 build(deps): bump serde_yaml from 0.8.13 to 0.8.14 in /rust
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.13 to 0.8.14.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.13...0.8.14)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-02 11:37:28 +01:00