Commit Graph

3471 Commits

Author SHA1 Message Date
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
dependabot[bot]
926c55c63d build(deps): bump systemd from 0.7.0 to 0.7.1 in /rust
Bumps [systemd](https://github.com/jmesmon/rust-systemd) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/jmesmon/rust-systemd/releases)
- [Commits](https://github.com/jmesmon/rust-systemd/compare/systemd-0.7.0...systemd-0.7.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-02 09:28:50 +01:00
Colin Walters
17045990b4 OWNERS: extend/reorder approvers section
Add more people from the CoreOS updates&remoting team.
2020-10-30 19:42:31 +01:00
Colin Walters
bbfdbe7916 upgrader: Fix potential use of NULL value
Current gcc in Fedora rawhide correctly points out:
```
In function 'generate_initramfs_overlay',
    inlined from 'rpmostree_sysroot_upgrader_deploy' at src/daemon/rpmostree-sysroot-upgrader.c:1604:12:
src/daemon/rpmostree-sysroot-upgrader.c:1166:65: error: argument 1 null where non-null expected [-Werror=nonnull]
 1166 |                                       g_steal_pointer (&path), (strlen (path))+1, g_free);
      |                                                                ~^~~~~~~~~~~~~~
```
2020-10-30 18:59:41 +01:00
Colin Walters
607a04ae12 Release 2020.6
We have the 32 bit fix, the new initramfs command, and various
other cleanups.  I also want to see if this fixes https://bugzilla.redhat.com/show_bug.cgi?id=1865839
so let's get a release out.
2020-10-30 15:21:45 +01:00
Colin Walters
0345ef2da1 Disable boot-location: new test
We marked this as deprecated, and our CI is expensive right now.
We're unlikely to break this.
2020-10-30 11:55:38 +01:00
Colin Walters
5775b00570 rust: Use Borrow<GString> in a few places
Particularly in places like the lockfile code where we were iterating
on a list of packages, validating UTF-8 and `memcpy()`ing strings
from C is...well, unnecessary.

I don't think there's any actual real performance concerns right
now but let's use this as a best practice because the patterns
we establish *will* be copy+pasted or at least used as inspiration
for other places where performance might matter.
2020-10-30 11:25:55 +01:00
Colin Walters
1e0a15c8d8 treefile: Directly write to String
I happened to scroll past this code while doing something
else and noticed what we were doing here was silly - no need
to re-validate UTF-8 etc when serde can hand us a `String` directly.
2020-10-30 10:59:27 +01:00
Colin Walters
520b29f1b5 composepost: Fix to use write_all()
Clippy reports this as an error; I think in practice Linux
doesn't return short writes for regular files, but it's still
a good idea to do the right thing here.
2020-10-30 10:21:23 +01:00
Jonathan Lebon
4da10dc11e Add new ex initramfs-etc command
This command allows users to cheaply inject configuration files in the
initramfs stage without having to regenerate the whole initramfs (or
even a new OSTree commit). This will be useful for configuring services
involved in bringing up the root block device.

```
$ echo 'hello world' > /etc/foobar
$ rpm-ostree ex initramfs-etc --track /etc/foobar
Staging deployment... done
Run "systemctl reboot" to start a reboot
$ rpm-ostree status
State: idle
Deployments:
  ostree://fedora:fedora/x86_64/coreos/testing-devel
                   Version: 32.20200716.dev.1 (2020-07-16T02:47:29Z)
                    Commit: 9a817d75bef81b955179be6e602d1e6ae350645b6323231a62ba2ee6e5b9644b
              GPGSignature: (unsigned)
              InitramfsEtc: /etc/foobar

● ostree://fedora:fedora/x86_64/coreos/testing-devel
                   Version: 32.20200716.dev.1 (2020-07-16T02:47:29Z)
                    Commit: 9a817d75bef81b955179be6e602d1e6ae350645b6323231a62ba2ee6e5b9644b
              GPGSignature: (unsigned)
$ reboot
(boot into rd.break)
sh-5.0# cat /etc/foobar
hello world
```

See the libostree side of this at:
https://github.com/ostreedev/ostree/pull/2155

Lots more discussions in:
https://github.com/coreos/fedora-coreos-tracker/issues/94

Closes: #1930
2020-10-30 00:48:54 +01:00
Colin Walters
885eb9ce01 Remove ffi_view_str/ffi_new_string functions
Let's just use the GLib translation bits rather than rolling our own;
this applies primarily to `ffi_new_string()`.

However, I think in most cases performance here doesn't
matter enough to have an even more special case that avoids duplicating
the string.  Let's remove the `ffi_view_str()` optimization too
in favor of consistently using GLib translation.

In the future perhaps we should argue for adding a `from_glib_str_unchecked()`
to the upstream GLib bindings.
2020-10-29 20:00:29 +01:00