Commit Graph

2583 Commits

Author SHA1 Message Date
Jonathan Lebon
44594ca4d2 tests/compose: Fix subtest scoping
We had a subtest that wasn't actually part of the `basic_test()` and so
was being executed when the file gets sourced instead of the function
being explicitly called.

Closes: #1829
Approved by: cgwalters
2019-05-09 02:10:27 +00:00
Robert Fairley
be1be526ff vagrant: Use a Fedora 29 container
Switch the Docker + Vagrant development docs to use a Fedora 29
build container, and a Fedora 29 Atomic Host Vagrant box. CentOS
7-based testing was recently removed (#1785) - let's have the
documented development pattern reflect this.

Also no longer enables the EPEL7 repo in the Vagrant VM, as needed
dependencies are available in Fedora Atomic Host.

A note is left to later switch to Fedora CoreOS as the documented
Vagrant box to use, once Fedora CoreOS boxes are produced.
Alternatively, one may use [cosa](https://github.com/coreos/coreos-assembler).

A few notes are also added to vagrant/README.md in places where
the reader may hit problems.

squash

Closes: #1826
Approved by: cgwalters
2019-05-09 00:08:14 +00:00
Robert Fairley
03a94e21b8 HACKING: Add link to tests README
Add a link to tests/README.md to point readers to additional
information on where to find different types of tests.

Closes: #1826
Approved by: cgwalters
2019-05-09 00:08:14 +00:00
Jonathan Lebon
4c99cc765f Copy used command-line and set as transaction title
In the app, rebuild the exact command-line that the client used and pass
that to the daemon to be used as the transaction title. Especially in
transactions like `UpdateDeployment()`, we can avoid reverse-engineering
what the original command used was.

This will be used by the upcoming history feature to record the
command-line used in the journal.

Closes: #1824
Approved by: rfairley
2019-05-08 21:09:08 +00:00
Jonathan Lebon
01fbaa7ba4 libpriv/util: Expand set of safe shell chars
Expand the set to include '/' and '=' since those don't need escaping in
shells.

Closes: #1824
Approved by: rfairley
2019-05-08 21:09:08 +00:00
Jonathan Lebon
d113b6a913 app/status: Make --json output pretty JSON
Yes, it's mostly for machines, but in practice it's super useful for
humans to look at esp. when debugging.

Closes: #1828
Approved by: cgwalters
2019-05-08 19:02:32 +00:00
Jonathan Lebon
206ae24d4e tests: Bump to Python 3 only
This bumps the requirement on the controlling host to Python 3 only.
It also bumps the requirement on the target host to Python 3 as well
since FCOS doesn't ship Python 2 right now.

Though we'll need to eventually drop all Python usage anyway, but at
least let's get tests passing on FCOS first. (See related previous
patch).

Closes: #1828
Approved by: cgwalters
2019-05-08 19:02:32 +00:00
Jonathan Lebon
9f618d0acc vmcheck/overlay: Drop dependency on host Python
Also switch to using `jq` on the controlling host instead of Python.

This is also prep for switching CI to FCOS which is likely to not ship
Python at all. There are still spots a bit everywhere where we currently
assume Python on the target host. We'll have to address those soon.

Closes: #1828
Approved by: cgwalters
2019-05-08 19:02:32 +00:00
Robert Fairley
c89f81c138 libvm: Use shared memory for SSH control socket instead of /var/tmp
In Fedora 29, and Fedora 30 Silverblue, I have come across the
following error when executing `make vmsync` from my build container
(also on Fedora 29 and Fedora 30 images respectively):

```
...
Failed to connect to new control master
...
Control socket connect(/var/tmp/ssh-vmcheck-1556768111752693879.sock): Connection refused
Failed to connect to new control master
...
```

Previously this worked with Fedora 28 as the host.

After changing the socket to be in /dev/shm, the SSH connection to
the `vmcheck` VM is successful and the sources sync over.

The cause of this seems to be a problem with overlayfs and unix
sockets: https://github.com/moby/moby/issues/12080

Since overlayfs is the default graph driver in Fedora now, work
around this by switching the socket to be in /dev/shm.

Closes: #1827
Approved by: jlebon
2019-05-02 20:43:28 +00:00
Jonathan Lebon
aaccd48ef1 daemon/deploy: Set transaction title earlier
Instead of doing a bunch of work before setting the transaction title,
set it upfront.

Also make more explicit how we determine whether we're doing an upgrade.

Closes: #1825
Approved by: rfairley
2019-05-02 20:43:17 +00:00
Jonathan Lebon
e0b0ff0066 daemon: Rework kargs transaction
Make it use the `deploy()` function like the others instead of having a
separate function that sets kargs and then automatically deploys.

Prep for future patches.

Closes: #1825
Approved by: rfairley
2019-05-02 20:43:17 +00:00
Jonathan Lebon
4c2fab8f5e libpriv/util: Factor out shell quoting function
Will be used elsewhere in an upcoming patch.

Closes: #1825
Approved by: rfairley
2019-05-02 20:43:17 +00:00
Jonathan Lebon
4499ac4ce0 libpriv/util: Factor out function to get version
Will be used by the history work.

Closes: #1823
Approved by: mike-nguyen
2019-05-01 15:12:15 +00:00
Jonathan Lebon
fcd2afaade daemon/utils: Allow unfiltered deployment variant
For the history work, I'd like to be able to retrieve the full GVariant,
which includes the whole unfiltered layered and base commit metadata. So
let's add an argument to allow not filtering those.

Closes: #1823
Approved by: mike-nguyen
2019-05-01 15:12:15 +00:00
Jonathan Lebon
0aded8a85b app/status: Strengthen deployment printing
Allow `out_printed_cached_update` and `sysroot_proxy` to be `NULL`. This
will be the case for the history feature, which will reuse the same code
for printing.

Closes: #1823
Approved by: mike-nguyen
2019-05-01 15:12:15 +00:00
Jonathan Lebon
41673e921e app/compose: Add ostree-content-checksum to composejson
This is useful for tracking OSTree content across a pipeline.

See related discussions in
https://github.com/coreos/coreos-assembler/issues/159.

Closes: #1822
Approved by: cgwalters
2019-04-30 20:37:30 +00:00
Jonathan Lebon
83a267409d Add new D-Bus APIs for deployment finalization
Teach `UpdateDeployment` to make use of libostree's staging lock and
then add a `FinalizeDeployment` API to perform the final unlock &
reboot.

I also added a hidden CLI to make testing this easier, but also because
it's likely the FCOS-agent-yet-to-be-named will just end up using the
CLI to keep it simple.

Closes: #1748

Closes: #1814
Approved by: lucab
2019-04-30 08:36:28 +00:00
Jonathan Lebon
9cb1f612de libdnf: Bump for GPG subkeys fix
See https://github.com/projectatomic/rpm-ostree/issues/1094#issuecomment-480826305
and https://github.com/rpm-software-management/libdnf/pull/711.

Update submodule: libdnf

Closes: #1819
Approved by: cgwalters
2019-04-28 14:15:11 +00:00
Jonathan Lebon
3d18c417b4 core: Also suggest upgrade for base/layered split
In the case of Fedora Silverblue which has daily composes, doing
`rpm-ostree cleanup -m && rpm-ostree upgrade` would work around the
majority of incidences here.

It doesn't apply if one is pinning to a specific version for whatever
reason, but that's not the common case.

Closes: #1818
Approved by: rfairley
2019-04-26 18:29:21 +00:00
Jonathan Lebon
97bb57d7a7 daemon: Carry option GVariant into transaction type
Rather than using flags, use the new approach of just carrying the
GVariant from the D-Bus message all the way to inside the transaction
type.

Closes: #1816
Approved by: cgwalters
2019-04-26 12:56:37 +00:00
Jonathan Lebon
6334aebca1 app: Simplify option variant creation
Use the new style of creating option variants directly instead of
through a helper.

Closes: #1816
Approved by: cgwalters
2019-04-26 12:56:37 +00:00
Jonathan Lebon
27c4e40368 app: Drop ex reset prototype
This was long promoted out of experimental.

Closes: #1816
Approved by: cgwalters
2019-04-26 12:56:37 +00:00
Jonathan Lebon
d2df455238 app/main: Make rpmostree_subcommand_parse local
It's not used elsewhere. Other commands with subcommands use
`rpmostree_handle_subcommand` instead which makes use of it.

Also drop the unused `invocation` arg.

Closes: #1816
Approved by: cgwalters
2019-04-26 12:56:37 +00:00
Jonathan Lebon
6b2ac5885f rust: Stop using extern crate and #[macro_use]
Rust 2018 makes this much nicer now.

Closes: #1812
Approved by: lucab
2019-04-15 13:03:21 +00:00
Jonathan Lebon
278ba77774 rust: Reduce visibility of items
Use `pub(crate)` on the ffiutils functions since it's just for us. Drop
unnecessary `pub` fields on `TreefileExternals`.

Closes: #1812
Approved by: lucab
2019-04-15 13:03:21 +00:00
Jonathan Lebon
60e71dfc66 rust: Update to 2018 edition
This mostly involves adjusting our path uses to be anchored, e.g. at
`self::` or `crate::`. I took the opportunity to also tweak `use`
ordering so that we consistently list modules in external crates first
before our own.

Closes: #1812
Approved by: lucab
2019-04-15 13:03:21 +00:00
Jonathan Lebon
0da9f9972b tests/vmcheck: Adapt to kernel v5.0
Closes: #1810
Approved by: jlebon
2019-04-05 19:28:39 +00:00
Jonathan Lebon
749facba86 rust: Bump dependencies
Now that our minimum Rust toolchain version was bumped, we can bump all
our deps to the latest and drop the frozen `rand` version that was done
for #1777.

Closes: #1810
Approved by: jlebon
2019-04-05 19:28:39 +00:00
Colin Walters
633f173484 scripts: Update fedora-release-workstation lua override
Prep for us to switch to unified-core only.  Note this is
dead code now in f30+.

Closes: #1808
Approved by: jlebon
2019-04-01 14:06:00 +00:00
Colin Walters
fc27c6ba2b core: Add a hack for /etc/selinux/config and %pre
I'm not very proud of this code, but I'm also not yet convinced that
we should rework things to re-interleave pre/post for just this
one thing.  Particularly when there's a patch to fix it
that just needs to be applied:
https://src.fedoraproject.org/rpms/selinux-policy/pull-request/16#

But practically speaking this fixes using `coreos-assembler`
for me with Silverblue and `tpm2-abrmd-selinux`.

Closes: https://github.com/projectatomic/rpm-ostree/issues/1804

Closes: #1806
Approved by: jlebon
2019-03-29 20:28:13 +00:00
Colin Walters
0ac5f71b9f rebase: Support identical checksum rebases
Change things to only throw this error for non-checksum rebases; for
RHEL CoreOS + https://github.com/openshift/pivot/
we've had it happen that the same ostree commit can end up
in separate oscontainers.  We want to support changing
the custom origin that might point to the same commit.

Closes: #1807
Approved by: jlebon
2019-03-29 18:07:48 +00:00
Jonathan Lebon
b40e87f628 Release 2019.3
Time to get a new release out; it's been more than a month!

Closes: #1801
Approved by: cgwalters
2019-03-26 19:01:55 +00:00
Alexander Larsson
d5b907741a Test that /opt layering works
Closes: #1795
Approved by: jlebon
2019-03-26 13:22:32 +00:00
Alexander Larsson
a4c2df0bdf Support layering rpms with files in /opt
This adds support for layering rpms with files in /opt. The way we
do this is that when importing the rpms we rewrite any files in /opt
into /usr/lib/opt, and then we add back a symlink from the toplevels
of /opt into /usr/lib/opt via the per-package tmpfiles.d.

Also, in order for this to work with the %post script we bind /opt
to usr/lib/opt during the script execution.

This fixes #233 at least for Google Chrome.

Closes: #1795
Approved by: jlebon
2019-03-26 13:22:32 +00:00
Colin Walters
0975a42125 compose: Add --download-only-rpms
Prep for making `--unified-core` the only path.  It turns
out our compose testsuite has a lot of hardcoded ideas about
how the two paths work.  The rojig tests in particular need
cached RPMs, so we can't just rely on caching the pkgcache repo.

Add a `--download-only-rpms` that always returns RPMs, and doesn't
import into the pkgcache repo.

Closes: #1798
Approved by: jlebon
2019-03-25 14:33:17 +00:00
Colin Walters
468ac72d6f Always enable dfd-over-dbus
Don't care about RHEL7 anymore, newer distributions have the SELinux
policy fix.

Closes: #1794
Approved by: jlebon
2019-03-25 13:46:29 +00:00
Colin Walters
ccc244879c build-sys: Always enable compose tooling
There's no reason to separate it anymore.

Closes: #1794
Approved by: jlebon
2019-03-25 13:46:29 +00:00
Colin Walters
8331e8069a build-sys: Drop support for ancient librpm
Here's where we stop caring about RHEL7's librpm.

Closes: #1794
Approved by: jlebon
2019-03-25 13:46:29 +00:00
Jonathan Lebon
02b25c616d libpriv/kargs: Strengthen and simplify new kargs APIs
Note this patch only touches the *new* APIs that aren't part of
libostree.

Now that we can use `g_ptr_array_find_with_equal_func`, we can drop our
custom `_ostree_ptr_array_find`.

Also strengthen our handling of values everywhere to handle the `NULL`
case and properly support `KEYWORD` args. I ended up getting rid of
`_ostree_kernel_arg_query_status` in the process since it made that
assumption a lot and overall added more complexity than necessary.

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:05 +00:00
Jonathan Lebon
96130810a5 tests/test-kargs: Check for no error first
When we expect a test to not fail, let's `g_assert_no_error` first so
that if it fails, we get an exact printout of what error we encountered
when we expected none.

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:05 +00:00
Jonathan Lebon
5f1c643cc6 libpriv/kargs: Use const char* for delete API
We don't need to modify the key we're passed, so just use `const`.

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:05 +00:00
Jonathan Lebon
e2a4327477 build: Bump minimum glib2 version to 2.56
That's the latest available in (f28, el8). Prep for using some new APIs
without tripping compiler warnings.

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:04 +00:00
Jonathan Lebon
247214c27e libpriv/kargs: Copy libostree patch to support KEYWORD kargs
This is essentially a copy of
https://github.com/ostreedev/ostree/pull/1785 to our private copy of the
kargs API. Should really dedupe those...

The really confusing part though was that that patch was intended to fix
the `rpm-ostree kargs --append EMPTYKEY=` case (#1706), yet the
`rpmostree kargs --append KEYWORD` case (#1779) wasn't also fixed, even
though that same ostree patch clearly fixes and tests for that too.

To make a long story short, we were passing buggy kargs to ostree, which
before that patch, had itself buggy kargs parsing which conveniently
fixed back the kargs we passed for the `KEYWORD` case.

Closes: #1779

Closes: #1796
Approved by: cgwalters
2019-03-23 18:48:04 +00:00
Jonathan Lebon
28c3a4cd07 core: Don't exclude modular packages
For now, we don't natively support modules. But we still want to be able
to install modular packages if the repos are enabled, but libdnf
automatically filters them out. So for now, let's tell libdnf that we do
want to be able to see them.

Related: #1435

Closes: #1797
Approved by: cgwalters
2019-03-22 23:50:44 +00:00
Kalev Lember
891f5b75be daemon: Add new ModifyYumRepo DBus API
This allows clients such as gnome-software to enable and disable
yum repositories.

The API is generic, but for now we only allow changing the 'enabled'
key. If needed, it's easy to allow changing other settings in the
future. See the discussion in the PR for the reasoning.

Closes: #1771

Closes: #1780
Approved by: cgwalters
2019-03-21 12:45:51 +00:00
Jonathan Lebon
b324ee4807 app/status: Always print pending deployment diff
Right now we only print a diff of the pending deployment if we have a
cached update (which only happens if user just did an `upgrade`
operation). But really, we can just always print this for the pending
deployment regardless of whether there's a cached update calculated.

This is prep for changing chained operations to only show the diff
between the previous pending deployment to the new pending deployment.
With this patch, the full diff from booted to pending will always be
available through `status` (and `db diff` too though it's not as nice).

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
6ca9926a6a libpriv: Teach diff printer different formats
I want to reuse the same function to print the same thing in three
slightly different ways. Let's teach it to take a `format` enum and
plumb that through.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
85bfe18701 app/libbuiltin: Tweak print_treepkg_diff logic
We can check for the trivial path and return early to avoid an
indentation. Also use `ostree_deployment_equal()` rather than directly
comparing pointers for good practice.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
36fabb5cc7 app: Drop rpmostree_print_treepkg_diff()
It's only used in one place right next to the function definition. Let's
just inline it.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00
Jonathan Lebon
6c56bfd11c app: Factor out function to generate diff summary
Will be used in an upcoming patch.

Closes: #1760
Approved by: cgwalters
2019-03-20 12:42:16 +00:00