Commit Graph

2891 Commits

Author SHA1 Message Date
Colin Walters
b797a42f3e core,kernel: Set up /etc/passwd for dracut
This fixes a longstanding spew of error messages from the initramfs
because we don't have nss-altfiles set up there.  Rather than
trying to do it, just do the dance of re-synthesizing `/etc/passwd`
as it traditionally looks around running dracut, the same as we
do for scripts during core layering.

Yes, this is all a mess and hopefully I'll get to sysusers soon...
2020-02-13 23:26:04 +01:00
dependabot-preview[bot]
9c4e7590b2 build(deps): bump libdnf from 249eda5 to 3fe7935
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `249eda5` to `3fe7935`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](249eda5cae...3fe793530e)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-11 17:00:12 +01:00
dependabot-preview[bot]
4b779befac build(deps): bump serde_json from 1.0.46 to 1.0.47 in /rust
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.46 to 1.0.47.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.46...v1.0.47)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 15:53:44 +01:00
dependabot-preview[bot]
dd835e861f build(deps): bump libdnf from 4a7ab08 to 249eda5
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `4a7ab08` to `249eda5`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](4a7ab081ec...249eda5cae)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 04:36:00 +01:00
Jonathan Lebon
35818cefd5 Release 2020.1 2020-02-05 23:18:45 +01:00
Colin Walters
5a0d3356ef treefile: Add exclude-packages
In FCOS we have a kola test that basically does `rpm -q python`.
It's...a bit silly to spawn a whole VM for this.  Ensuring that
some specific packages don't get included has come up in a few
cases.

I think FCOS/RHCOS at least will want to blacklist `dnf` for example.
And as noted above, FCOS could blacklist `python`.

One major benefit of doing this inside rpm-ostree is that one
gets the full "libsolv error message experience" when dependency
resolution fails, e.g. blacklisting `glibc` I get:

```
 Problem 79: conflicting requests
  - package coreos-installer-systemd-0.1.2-1.fc31.x86_64 requires coreos-installer = 0.1.2-1.fc31, but none of the providers can be installed
  - package coreos-installer-0.1.2-1.fc31.x86_64 requires rtld(GNU_HASH), but none of the providers can be installed
  - package glibc-2.30-10.fc31.x86_64 is filtered out by exclude filtering
  - package glibc-2.30-7.fc31.x86_64 is filtered out by exclude filtering
  - package glibc-2.30-8.fc31.x86_64 is filtered out by exclude filtering
  - package glibc-2.30-5.fc31.i686 is filtered out by exclude filtering
  - package glibc-2.30-5.fc31.x86_64 is filtered out by exclude filtering
  - package glibc-2.30-10.fc31.i686 is filtered out by exclude filtering
```
2020-02-05 21:02:06 +01:00
dependabot-preview[bot]
70c385633c build(deps): bump libdnf from 367cf8a to 4a7ab08
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `367cf8a` to `4a7ab08`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](367cf8aa97...4a7ab081ec)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-04 13:00:29 -08:00
dependabot-preview[bot]
6b80c95368 build(deps): bump nix from 0.16.1 to 0.17.0 in /rust
Bumps [nix](https://github.com/nix-rust/nix) from 0.16.1 to 0.17.0.
- [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/commits/v0.17.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-04 06:24:55 -08:00
Colin Walters
c039b72ebd importer: Use /run instead of /var/run
Translate RPM paths under `/var/run` to `/run` automatically; this
quiets down systemd.  Since we end up running `systemd-tmpfiles`
a few times in FCOS reducing spew here is particularly valuable.

The bug is really in the packages here but...we don't have an
agile process for fixing them.

Note that for this fix to take effect, if you have a `cache/pkgcache-repo`
you'll need to remove it.
2020-02-03 07:50:10 -08:00
dependabot-preview[bot]
1afa96e414 build(deps): bump serde_json from 1.0.45 to 1.0.46 in /rust
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.45 to 1.0.46.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.45...v1.0.46)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 07:04:33 -08:00
dependabot-preview[bot]
06f139eb5d build(deps): bump structopt from 0.3.8 to 0.3.9 in /rust
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.8 to 0.3.9.
- [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.8...v0.3.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 06:35:53 -08:00
dependabot-preview[bot]
470cd197e2 build(deps): bump indicatif from 0.13.0 to 0.14.0 in /rust
Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-31 06:17:12 -08:00
Colin Walters
17d3d7b313 treefile: Use ref_from_raw_ptr
This was missed in the conversion; just noticed while
working on the code around here.
2020-01-30 20:02:54 -08:00
dependabot-preview[bot]
0c734db457 build(deps): bump structopt from 0.2.18 to 0.3.8 in /rust
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.2.18 to 0.3.8.
- [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.2.18...v0.3.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-29 08:15:28 -08:00
dependabot-preview[bot]
839b96ce59 build(deps): bump clap from 2.32.0 to 2.33.0 in /rust
Bumps [clap](https://github.com/clap-rs/clap) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 18:42:50 -08:00
dependabot-preview[bot]
8db7821c30 build(deps): bump nix from 0.15.0 to 0.16.1 in /rust
Bumps [nix](https://github.com/nix-rust/nix) from 0.15.0 to 0.16.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/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 18:42:41 -08:00
dependabot-preview[bot]
de21edf4e5 build(deps): bump libdnf from cc36cb7 to 367cf8a
Bumps [libdnf](https://github.com/rpm-software-management/libdnf) from `cc36cb7` to `367cf8a`.
- [Release notes](https://github.com/rpm-software-management/libdnf/releases)
- [Commits](cc36cb7492...367cf8aa97)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 18:22:29 -08:00
dependabot-preview[bot]
e537de8321 build(deps): bump indicatif from 0.11.0 to 0.13.0 in /rust
Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.11.0 to 0.13.0.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/compare/0.11.0...0.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 13:45:16 -08:00
Jonathan Lebon
a40014f5a7 ci: Allow submodule bumps from Dependabot
Tweak the logic in `ci-commitmessage-submodules.sh` to allow Dependabot
bumps.
2020-01-28 13:14:47 -08:00
dependabot-preview[bot]
30c2444f19 build(deps): bump libglnx from 470af87 to 5f3d352
Bumps libglnx from `470af87` to `5f3d352`.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 13:14:47 -08:00
Jonathan Lebon
7ad4d58bbc ci: Bump compose tests timeout to 45m
Still trying to find the sweet spot on this. I think it may also depend
on how fast/busy the node we get allocated to is.
2020-01-28 11:13:47 -08:00
Jonathan Lebon
2dadc7b03c rust: cargo update
We haven't done one of these in a while.
2020-01-28 11:13:47 -08:00
Jonathan Lebon
c09f5412a5 libpriv/util: Fix human diff printing for upgrades/downgrades
We were basing whether to print the `Upgraded`/`Downgraded` heading on
the iteration count rather than the actual first iteration where a valid
upgrade/downgrade was found. And because of how we print our diff, this
confusingly can make it look like downgrades are part of the same
upgrade section.

Closes: #1821
2020-01-21 18:36:53 +01:00
Jonathan Lebon
2966afe44e core: Mark all repos as "modular hotfixes"
This is a follow-up hack to #1797 to force libdnf to let us use modular
packages as if they were regular packages until we actually support
modules correctly (#1435).

A repo marked as a modular hotfix means that libdnf doesn't try to
filter out modular RPMs from the repo as it usually does.

Resolves: https://pagure.io/releng/failed-composes/issue/717
2020-01-09 15:31:02 +01:00
Jonathan Lebon
654ab64409 ci: Re-org stages and parallelize tests
Build FCOS and run vmcheck in the same container, since it's only used
for that anyway right now. The main advantage is that we save time
provisioning another container and not having to stash and unstash the
FCOS image.

Also, since the compose tests don't actually need to wait for the FCOS
image, start running them in parallel with the FCOS + vmcheck branch.
2020-01-08 16:42:54 +01:00
Jonathan Lebon
9daea46d66 tests/compose: Target FCOS 31, move off of PAPR
Again, a lot going on here, but essentially, we adapt the compose tests
to run either privileged or fully unprivileged via supermin, just like
cosa.

I actually got more than halfway through this initially using `cosa
build` directly for testing. But in the end, we simply need more
flexibility than that. We want to be able to manipulate exactly how
rpm-ostree is called, and cosa is very opinionated about this (and may
also change from under us in the future).

(Another big difference for example is that cosa doesn't care about
non-unified mode, whereas we *need* to have coverage for this until we
fully kill it.)

Really, the most important bit we want from there is the
unprivileged-via-supermin bits. So we copy and adapt that here. One
obvious improvement then is sharing this code more easily (e.g. a
`cosa runasroot` or something?)

However, we still use the FCOS manifest (frozen at a specific tag). It's
a realistic example, and because of the lockfiles and pool, we get good
reproducibility.
2020-01-08 16:42:54 +01:00
Jonathan Lebon
462a389b3a tests/compose: Move files around
This is mostly cosmetic, though I want the test layout to mirror what we
do for `vmcheck`.
2020-01-08 16:42:54 +01:00
Jonathan Lebon
c59b9de3d4 ci: Run Rust unit tests
We definitely want this too.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
13f554ea5c ci: Bump MSRV to 1.39.0
This is in el8 now.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
37a6a3ab69 Don't require an OSTree repo for --print-only
This makes it easier to flatten a treefile. To do this, we make having a
workdir optional on the Rust side, and on the C side, just move
`--print-only` handling up front.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
932e8eec2a app/compose: Skip bwrap self-test if --download-only[-rpms]
We don't need any privs for just downloading the RPMs.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
c5058c662a app/tree: Drop "YAML" from error message
This helper is used for both JSON and YAML treefiles now.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
1d8537bb03 app/rojig: Explicitly check a rojig section was provided
Let's make that explicit to make it easier to debug. (This works because
right now, we auto-create the spec file on the Rust side at parse time.)
2019-12-20 21:16:24 +01:00
Jonathan Lebon
c7361af2f6 app: Print help messages on stderr
So that we keep `stdout` clean. This is important for `--print-only`.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
28d3fe428f app/compose: Support multiple --add-metadata-from-json
No reason we can't do this. I initially was going to make use of this
for tests, but ended up not needing it.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
0e84776519 libpriv/rojig: Fix unref'ing using wrong function
We were trying to unref a `GHashTable` using `g_ptr_array_unref`.
Something something... rewrite it in Rust.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
7d36ea7ebc rust: Wrap parent directory handling for Path
The parent of a `Path` of `"foobar"` is actually `""`, because
`parent()` wants to return a slice of its buffer:
https://github.com/rust-lang/rust/issues/36861

Just do a trivial wrapper around it to correctly return `"."` instead.

Hit this when trying to pass a treefile in the working directory.
2019-12-20 21:16:24 +01:00
Jonathan Lebon
82b27de843 Release 2019.7
Not the biggest release, but there are some decent targeted fixes and
enhancements and it's been a while.
2019-12-19 16:22:11 +01:00
Jonathan Lebon
774d0171d5 libdnf: Bump to cc36cb7492275e34c10148176824a35a3a67a461
Let's try to do regular-ish bumps again. Both for fixes and features,
but also so we eat regressions as they come rather than all at once when
we actually need something new there really fast.

Update submodule: libdnf
2019-12-19 15:48:49 +01:00
Colin Walters
4881435663 tests: Misc tweaks
- Have libvm.sh inherit libtest, otherwise we don't have `fatal`
- Add `error: ` prefix to `fatal` messages for clarity
- Add missing plural
2019-12-16 15:17:01 +01:00
Jonathan Lebon
c7a9c3b1dd Rework vmcheck to use kola spawn, move off of PAPR
There's a lot going on here, but essentially:

1. We change the `vmcheck` model so that it always operates on an
   immutable base image. It takes that image and dynamically launches a
   separate VM for each test using `kola spawn`. This means we can drop
   a lot of hacks around re-using the same VMs.
2. Following from 1., `vmoverlay` now takes as input a base image,
   overlays the built rpm-ostree bits, then creates a new base image. Of
   course, we don't have to do this in CI, because we build FCOS with
   the freshly built RPMs (so it uses `SKIP_VMOVERLAY=1`). `vmoverlay`
   then will be more for the developer case where one doesn't want to
   iterate via `cosa build` to test rpm-ostree changes. I say "will"
   because the functionality doesn't exist yet; I'd like to enhance
   `cosa dev-overlay` to do this. (Note `vmsync` should still works just
   as before too.)
3. `vmcheck` can be run without building the tree first, as
   `tests/vmcheck.sh`. The `make vmcheck` target still exists though for
   finger compatibility and better meshing with `vmoverlay` in the
   developer case.

What's really nice about using kola spawn is that it takes care of a lot
of things for us, such as the qemu command, journal and console
gathering, and SSH.

Similarly to the compose testsuites, we're using parallel here to run
multiple vmcheck tests at once. (On developer laptops, we cap
parallelism at `$(nproc) - 1`).
2019-12-13 19:18:30 +01:00
Jonathan Lebon
d2a4372d4d app/override: Don't include rpmostree-ex-builtins.h
Likely leftover from when it was an experimental feature. It's not
anymore.
2019-12-13 19:18:30 +01:00
Jonathan Lebon
571bd3a558 tests: Add hidden testutils subcommand
This is a hack to allow using `inject-pkglist` without having to build
the tree first.

Higher-level, I think we can split this back out again if we have a
`-tests` subpackage where we ship the vmcheck testsuite.
2019-12-13 19:18:30 +01:00
Jonathan Lebon
9d73458f0c ci: Add the built RPMs as cosa overrides
So that the built FCOS has them. This is a prereq for actually testing
what we built in `vmcheck`.
2019-12-13 19:18:30 +01:00
Jonathan Lebon
07dfb8dc3e ci: Archive built RPMs
That way, anyone can easily download the latest built RPMs from master
or a specific PR. This isn't a replacement for automated builds in Koji
though since it's not multi-arch.

Also fetch the tags so that the NEVRA derived from `git describe` is
nicer.
2019-12-13 19:18:30 +01:00
Jonathan Lebon
f673305920 ci: re-use variable for container images
Makes it less repetitive and allows controlling the images from a
central place.
2019-12-13 19:18:30 +01:00
Colin Walters
e726d008fc compose: Add an automatic-version-suffix key
This allows replacing the `.` in automatic version increments
with whatever one wants (as long as it's a single ASCII character)
right now.

The specific motivation here is for at least RHEL CoreOS to use
`version-suffix: "-"` so that its versions can become valid
semantic versions.

Related: https://github.com/coreos/rpm-ostree/issues/1954
2019-12-13 17:11:16 +01:00
Colin Walters
75c676715a daemon: Use MountFlags=slave and opt-in to OSTree read-only /sysroot
This is all we need to tell libostree that we support a read-only
`/sysroot` and `/boot`.

See https://github.com/ostreedev/ostree/issues/1265
PR in https://github.com/ostreedev/ostree/pull/1767
2019-12-13 01:44:56 +01:00
Colin Walters
4e3c41be9f kernel: Append /dev/{u,}random to initrd instead of dracut caps
Rather than giving dracut `cap_mknod` which won't work in
unprivileged scenarios, append a tiny static pre-generated CPIO
blob with `/dev/random` and `/dev/urandom` to the output of
dracut.

This is a hack until dracut does this itself.  But the problem
is patches to dracut will take eleven billion years to ship
in RHCOS.

Closes: https://github.com/coreos/rpm-ostree/issues/1950
2019-12-10 22:11:10 +01:00
Colin Walters
f295f54306 kargs: Support --append and --delete simultaneously
Code I wrote for the machine-config-operator expected it to
work, and I don't see a reason not to support it.

See https://github.com/openshift/machine-config-operator/issues/1265
2019-12-10 20:27:57 +01:00