Commit Graph

3209 Commits

Author SHA1 Message Date
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
Colin Walters
a2bbc12812 rust: Enable lto by default
This avoids us leaking all of the Rust symbols as public
into our shared library.

Came up in team chat since one person tried to copy just `/usr/bin/rpm-ostree`
from the dev container into a target and got a linker crash; but
really we want to avoid all the duplicated symbols entirely.

(And we should investigate cross-language LTO because that's the
 only way to get full savings)
2020-10-29 19:00:14 +01:00
Luca BRUNO
87775cb6a9 daemon/syscore: push livefs introspection to Rust
This starts bridging parts of the daemon syscore logic to Rust
plumbing, moving the livefs detection logic over there as a first
consumer. That was the simplest logic available for wiring, and
mostly meant as a sanity check.
2020-10-29 17:57:02 +01:00
Colin Walters
af37608d9b Update to openat-ext 0.1.8, use new file writing API
This cleans up several cases.

Remove the utils path.
2020-10-28 05:51:27 -04:00
Luca BRUNO
2c4f265587 daemon: drop an unused sysroot parameter
This is a minor cleanup, dropping an unused sysroot parameter from
deployment logic in daemon codebase.
2020-10-27 16:43:28 +01:00
Jonathan Lebon
535a6f4327 rust/libdnf-sys: Drop Cargo.lock
As Luca pointed out in #2258, this is a library and technically
shouldn't have a lockfile.
2020-10-26 16:51:04 +01:00
dependabot[bot]
aee2e0ec9d build(deps): bump systemd from 0.6.0 to 0.7.0 in /rust
Bumps [systemd](https://github.com/jmesmon/rust-systemd) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/jmesmon/rust-systemd/releases)
- [Commits](https://github.com/jmesmon/rust-systemd/compare/v0.6.0...systemd-0.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 16:15:58 +01:00
dependabot[bot]
cee8869af3 build(deps): bump rayon from 1.4.1 to 1.5.0 in /rust
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.4.1...rayon-core-v1.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 16:15:50 +01:00
dependabot[bot]
1fef9515ec build(deps): bump libdnf from c50652f to 53aca12
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `c50652f` to `53aca12`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](c50652fa28...53aca1273b)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 15:33:04 +01:00
dependabot[bot]
2b93098826 build(deps): bump libc from 0.2.79 to 0.2.80 in /rust
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.79 to 0.2.80.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.79...0.2.80)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 14:54:57 +01:00
dependabot-preview[bot]
89d44d9489 build(deps): bump libdnf from c5f20d4 to c50652f
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `c5f20d4` to `c50652f`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](c5f20d4f30...c50652fa28)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-23 14:55:57 -04:00
Colin Walters
9a472f923b compose: Print a warning with boot-location: new
It's tempting to flip the default, but let's encourage
people to adapt to the `modules` version now.

Plus infrastructure to add deprecation warnings here
will come in handy in the future.
2020-10-23 12:43:26 -04:00
Colin Walters
9cc0510ee8 sysroot: Fix usage of sd_journal_send on 32 bit
See https://bugzilla.redhat.com/show_bug.cgi?id=1890577

This is the same as https://github.com/ostreedev/ostree/pull/2219
2020-10-22 17:53:23 -04:00