Commit Graph

3441 Commits

Author SHA1 Message Date
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
Colin Walters
1b40810916 Make /run a directory in scripts
It's part of the expected standard environment, and its omission
ended up breaking some bootupd work.
See https://github.com/coreos/bootupd/pull/84#issuecomment-709414840
2020-10-22 16:43:00 -04:00
Colin Walters
5650f376fb Add --enable-rojig, disable by default
We're seeing some CI failures that I think are a bug in rojig.
In the bigger picture...we never actually started using this,
and I think longer term shipping os updates via containers
probably makes more sense.

I put a *lot* of effort into this code and it's pretty cool
so it's hard to just delete it.  And *maybe* someone out there
is using it (but I doubt it).  So rather than just deleting
it entirely let's make it a build-time option.

I verified that it builds at least.
2020-10-22 15:38:50 -04:00
Jonathan Lebon
e99be88af8 rust: Update deps
```
$ cargo upgrade
$ cargo update
```
2020-10-19 18:34:16 -04:00
Jonathan Lebon
7bb5d411e3 dependabot: Drop pull request limit to 3
Until Dependabot learns to batch PRs
(https://github.com/dependabot/dependabot-core/issues/1190), let's
reduce the churn here by limiting to 3 PRs at a time. Otherwise, it's a
massive pain to get them all in and taxes our CI heavily.
2020-10-19 18:05:19 -04:00
dependabot-preview[bot]
7b1cdca433 Create Dependabot config file 2020-10-19 18:05:19 -04:00
Colin Walters
0c3f73b720 daemon: Defer reload to an idle
I suspect that having two DBus connections involved
is part of potential races in
https://bugzilla.redhat.com/show_bug.cgi?id=1865839
https://github.com/coreos/rpm-ostree/pull/2255

Right now the client calls Reload when done - by
having the daemon defer it to an idle, we help ensure
that any other pending events (fd close,
transaction completions) are processed before
we even start the reload.
2020-10-16 17:43:06 -04:00
dependabot-preview[bot]
8f8b4411ac build(deps): bump libc from 0.2.77 to 0.2.79 in /rust
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.77 to 0.2.79.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.77...0.2.79)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-16 10:38:02 -04:00
dependabot-preview[bot]
5cc77f9ea1 build(deps): bump serde_json from 1.0.57 to 1.0.59 in /rust
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.57 to 1.0.59.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.57...v1.0.59)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-15 22:52:24 -04:00
Colin Walters
d0d22c0060 transaction: Unlock more reliably at txn finish
Today we unlock in the finalize path, which means that
the unlock can be delayed if something is referencing
the gobject for the transaction, even after it's done.

Worse, we do `g_clear_object (&priv->sysroot)` in the dispose
handler which means that if something calls dispose before
the last unref, we will never unlock!

Fix all this by unlocking when the transaction is done
executing.  At that point we aren't going to do any
further modifications, so there's no reason to hold the lock.
This should be much more reliable.

While we're here also track the locked state via an explicit
boolean rather than keying off whether we happen to have
a sysroot object.
2020-10-15 19:11:08 -04:00
dependabot-preview[bot]
3f768241af build(deps): bump structopt from 0.3.18 to 0.3.19 in /rust
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.18 to 0.3.19.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.18...v0.3.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-15 17:55:30 -04:00
Colin Walters
0a27fc4a6b client: Close DBus connection before calling reload
Part of looking at
https://bugzilla.redhat.com/show_bug.cgi?id=1865839
https://github.com/coreos/rpm-ostree/pull/2255/

Basically the transaction can be lifecycle bound to the
DBus connection.  We hold that connection open even
after we get a success response and then call back into the
daemon again to do a reload.

Rework the client code here so that all of the txn
stuff is in a method itself, and move the reload outside
of it.  That way the bus connection will have been closed
reliably by autocleanups before we reload.
2020-10-15 10:39:49 -04:00
dependabot-preview[bot]
277afe276c build(deps): bump libdnf from 1904bb7 to c5f20d4
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `1904bb7` to `c5f20d4`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](1904bb75b3...c5f20d4f30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-14 18:33:36 -04:00
Colin Walters
1fee00c15c sysroot: Log when forcibly closing a transaction
This *shouldn't* be happening but maybe it is somehow in
https://bugzilla.redhat.com/show_bug.cgi?id=1865839
2020-10-14 17:57:21 -04:00
Colin Walters
38df392eee transaction: Port to declare-and-initialize style
Had this file open for other work, decided to port to new
style on general principle.
2020-10-14 16:19:12 -04:00
Jonathan Lebon
821d2e1a46 tests/compose: Check filecaps of arping instead of ping
In f32, ping is no longer privileged since it ships with the sysctl for
`ping_group_range` which allows unpriv pings. Check the file caps of
arping instead, which does still use them.
2020-10-14 03:44:19 +02:00
Colin Walters
f370f7d24f tests: Loosen regexp for French date
Something changed format, not sure what.
2020-10-14 03:44:19 +02:00
Jonathan Lebon
d414ca1168 tests/compose: Drop FCOS postprocess scripts
Now that we've bumped to the latest FCOS commit for compose tests, one
thing that came up was that our compose tests never actually included
FCOS overlays in the compose the way cosa does.

This then cause compose failures because one of the postprocess scripts
expects those files there.

Let's just nuke all postprocess scripts here to work around this. I
initially wanted to import the overlay logic from cosa, but overlays
only work in unified core mode, and sadly we still want some coverage in
non-unified mode until that's fully dropped.

And anyway, we also already do a proper `cosa build` in the vmcheck
branch of CI so it's not like we're losing that coverage.

Down the line though, I think this is a good argument for folding the
overlay dirs into rpm-ostree more natively as discussed here:

https://github.com/coreos/coreos-assembler/pull/639#issuecomment-534713737
2020-10-14 03:44:19 +02:00
Jonathan Lebon
96af966b38 rust/treefile: Use shorthand initialization for Treefile
This lit up in my editor which does linting in the background.
2020-10-14 03:44:19 +02:00