Commit Graph

1598 Commits

Author SHA1 Message Date
Jonathan Lebon
2f6f8a910d libvm: set up ControlPath socket in /var/tmp
It turns out there's a much smaller limit than PATH_MAX for Unix
sockets. On Linux, it's 108 characters. It took me some time to figure
out why `vmcheck` would sometimes fail depending on where the src
directory is and how ${topsrcdir} is defined. Let's just make things
safer by just using /var/tmp.

Closes: #949
Approved by: cgwalters
2017-08-24 22:12:17 +00:00
Jonathan Lebon
b05b9679f9 scripts: fix argument ordering
Just noticed this while trying out the unified core work. We were
passing arguments in the wrong order (or alternatively, receiving them
in the wrong order).

Closes: #952
Approved by: cgwalters
2017-08-24 21:48:14 +00:00
Jonathan Lebon
f5bcd62364 ci: run the improved-sanity-test
Start running the improved-sanity-test from atomic-host-tests to make
sure the system works. This is an easy way to get PR-level comprehensive
integration tests for free.

But note that we *don't* mark it as required since the tests are not
stored here and it can happen that they need to be adjusted for new
rpm-ostree behaviours. In this way, this added check also allows us to
give a heads-up that breaking changes are coming.

Closes: #899
Approved by: cgwalters
2017-08-24 20:43:16 +00:00
Jonathan Lebon
c7837d003a Makefile-tests.am: drop vmshell target
I actually stopped using this a long time ago. Looking at it now, it
doesn't make much sense in multi-host situations. Let's just nix it.

Closes: #899
Approved by: cgwalters
2017-08-24 20:43:16 +00:00
Jonathan Lebon
a1b5109e8b docs/manual: be more explicit about bootloader order
Make it more clear that bootloader order implies what the default
deployment is.

Closes: #947
Approved by: cgwalters
2017-08-24 20:13:05 +00:00
Colin Walters
00231446b3 app: Clarify message on repeated Ctrl-C
While we have cancellation issues¹, let's help the
user understand that we heard them the first time.

¹ <https://github.com/projectatomic/rpm-ostree/issues/897>

Closes: #948
Approved by: jlebon
2017-08-24 17:30:10 +00:00
Colin Walters
06f3a1811a lib/passwd: Port passwd checking to fd-relative
Prep for unified core.

Closes: #943
Approved by: jlebon
2017-08-24 15:13:30 +00:00
Colin Walters
a4ca8c8888 app/compose: Drop GFile usage from package install path
Prep for unified core.

Closes: #943
Approved by: jlebon
2017-08-24 15:13:30 +00:00
Colin Walters
addc53a707 tree-wide: Fix extra colon in error prefixes
This is a trap when doing style porting; we added a rule to ostree's `maint.mk`
to catch it but not here. Not sure I want to add `maint.mk` here yet.

Note that in newer libglnx `glnx_opendirat()` does error prefixing, so
drop the prefixing there.

Closes: #943
Approved by: jlebon
2017-08-24 15:13:30 +00:00
Colin Walters
278ed216d0 tree-wide: A bit more libglnx porting
Mostly for `glnx_renameat()`.

Closes: #941
Approved by: jlebon
2017-08-24 13:33:59 +00:00
Colin Walters
3840fad28e tree-wide: Fully purge the rest of "noscripts" support
It was partially removed in 325ee354e9
from PR #873 - this removes all of the rest of the layers in
the daemon and core for this.

Note that while working on this I found it astoundingly confusing that
`rpmts_add_install()` and `add_install()` had separate orderings for `gboolean
noscripts, is_install`. That's fixed by having the latter lose the `noscripts`
flag entirely, but while we're here change `rpmts_add_install()` to use flags
for clarity.

Closes: #938
Approved by: jlebon
2017-08-23 16:31:27 +00:00
Colin Walters
4d32f736e1 lib/unpacker: Port unpack function to new style
Missed this in the tmpdir porting since it used `g_mkdtemp_full()`.
We also now have autocleanups for `OstreeRepoCommitModifier`.

Closes: #939
Approved by: jlebon
2017-08-23 15:14:53 +00:00
Colin Walters
4be8658f65 lib/passwd: Error if presented with an unknown check-passwd value
Prep for sysusers work; let's cleanly reject things we don't know.

Closes: #935
Approved by: jlebon
2017-08-23 14:51:08 +00:00
Colin Walters
5f7d860a33 app: Set GSETTINGS_BACKEND=memory early on if root
I was about to copy this bit from the daemon for subprocess work, so let's
centralize it. Further, we should invoke `setenv()` as early as possible; see
<https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2>.

Closes: #934
Approved by: jlebon
2017-08-22 21:18:08 +00:00
Jonathan Lebon
c2b422a19b libdnf: bump for metadata_expire fix
To officially bring in
https://github.com/rpm-software-management/libdnf/pull/320.

Update submodule: libdnf

Closes: #930

Closes: #937
Approved by: cgwalters
2017-08-22 19:49:55 +00:00
Colin Walters
6b3a99c3a9 lib/bwrap: Use --die-with-parent
See <https://github.com/projectatomic/bubblewrap/pull/165>; really every
bwrap use case I can think of should specify this (including ours), it's
just not the default out of conservatism.

This way if the daemon happens to e.g. SEGV it'll also cleanly `SIGKILL` any
outstanding scripts.

Was just looking at our bwrap usage for multiprocess work.

Closes: #936
Approved by: jlebon
2017-08-22 18:58:58 +00:00
Colin Walters
0428275a3c tree-wide: Port to new libglnx tmpdir API
Lots of cleanups, and this also allows us to fully port to new style in several
places.

We can drop our own `rpmostree_mkdtemp()`.

Update submodule: libglnx

Closes: #928
Approved by: jlebon
2017-08-22 17:21:37 +00:00
Colin Walters
82f95e7761 daemon/upgrader: Use new libostree timestamp-check option
Since we have a copy of this libostree code, pick up the new
changes from <https://github.com/ostreedev/ostree/pull/1055>.

Note the added test doesn't really test our logic since
we're only doing local pulls, but at least we have something.

Closes: #932
Approved by: jlebon
2017-08-22 16:08:21 +00:00
Colin Walters
ce2033c182 lib/core: Unlink to-import RPMs before unpacking
Was just reading the code. We have similar logic in libostree for individual
objects and deltas.

Closes: #933
Approved by: jlebon
2017-08-22 15:51:05 +00:00
Colin Walters
83bd3c8d13 bin/compose: Move /etc/{passwd,group} injection later
There's no reason to touch things in the target root *before*
we've even downloaded the repodata.  Further, doing so has
the potential trigger the "existing root" logic in libdnf if
it detects `/usr`.  This doesn't matter now since we're writing
to `/etc/`, but it will for later work, so let's put these bits
in the right place.

Prep for <https://github.com/projectatomic/rpm-ostree/pull/927>

Closes: #931
Approved by: jlebon
2017-08-22 01:02:52 +00:00
Colin Walters
932520a0c7 tests/compose: Be a bit more verbose
This would have helped me debug an issue that caused the first compose to fail.

Closes: #931
Approved by: jlebon
2017-08-22 01:02:52 +00:00
Colin Walters
129f95b6d8 bin/compose: Move treefile variable into self struct
Prep for a future patch.

Closes: #931
Approved by: jlebon
2017-08-22 01:02:52 +00:00
Colin Walters
b419cb9071 lib/passwd: Misc code cleanup and style porting
I was briefly thinking about sysusers work, and decided to do some quick cleanup
here.

Closes: #929
Approved by: jlebon
2017-08-21 16:59:46 +00:00
Colin Walters
f51611dc74 tree-wide: Some misc libglnx porting
Port away from `glnx_set_error_from_errno` to prefixing errors or libglnx
wrappers as appropriate.

Closes: #926
Approved by: jlebon
2017-08-18 17:38:49 +00:00
Colin Walters
9711ea6c16 Release 2017.8
Closes: #925
Approved by: jlebon
2017-08-17 21:04:26 +00:00
Colin Walters
fe1be77025 sysroot: Prefix error when loading deployment with index
This would have helped me debug <https://github.com/projectatomic/rpm-ostree/issues/923>.

Closes: #924
Approved by: jlebon
2017-08-17 16:53:48 +00:00
Colin Walters
8bb604ce67 tree-wide: Port to ostree_repo_{open,create}_at()
A lot of code gets nicer.

Closes: #922
Approved by: jlebon
2017-08-17 15:28:14 +00:00
Colin Walters
1f0a76985e daemon: Use journal over syslog
systemd has to go to a bit more effort to integrate `syslog()`, let's
use the journal directly for consistency.  Just happened to be
reading the code.

Closes: #921
Approved by: jlebon
2017-08-17 13:47:33 +00:00
Jonathan Lebon
ef889b0b3a daemon: use new journal-msg signal
Make use of the new journal-msg signal that OstreeSysroot emits. Since
we now also only rely on the output API to print messages, this allows
us to drop the outrageous hacks we had to do to watch our own stdout,
part of which Coverity didn't like.

Coverity CID: 163694

Closes: #919
Approved by: cgwalters
2017-08-16 16:05:06 +00:00
Jonathan Lebon
1fb9dc57c9 daemon: ensure we consistently use output API
There were places where we were relying on the stdout self read hack to
relay messages to clients. Fix those by explicitly using the output API
in all spots where the daemon may pass. Really, we should exclusively be
using the output API in the daemon and libpriv trees, though many other
instances exist for now.

Closes: #919
Approved by: cgwalters
2017-08-16 16:05:06 +00:00
Jonathan Lebon
7b774cee7e output: add support for messages
This is already supported by the D-Bus API, though not in our output
wrapper.

Closes: #919
Approved by: cgwalters
2017-08-16 16:05:06 +00:00
Jonathan Lebon
da2c4ea8ca libglnx: bump for Coverity fixes
Update submodule: libglnx

Closes: #920
Approved by: cgwalters
2017-08-16 15:48:49 +00:00
Jonathan Lebon
35d69c1577 container-builtins: squash a -Wmaybe-uninitialized
Closes: #920
Approved by: cgwalters
2017-08-16 15:48:49 +00:00
Colin Walters
b6705f3feb daemon: Check for updated rpms when upgrading
This closes a longstanding bug - since package layering first
landed, we only checked for newer RPMs if the base tree changed.
In some scenarios like RHELAH, this doesn't matter much by default
since they move at the same cadence.  Except if you use EPEL for example.
In Fedora, today the FAH releases are async of the rpm-md repos, and
there's also COPR which can update more than once a day even.

We should check for both update sources. Luckily we'd already introduced logic
for this in the treecompose case (checksumming the depsolved package sack). We
just need to start using it for client side assembly too.

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

Closes: #911
Approved by: jlebon
2017-08-16 15:33:11 +00:00
Jonathan Lebon
8dddefbad3 unpacker: properly check for glib error
`g_mkdtemp_full` returns a pointer to the template var itself or NULl on
error. We were treating it like an integer.

Coverity CID: 163698

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
8ee1385492 scripts: check var before use
We were using the `bwrap` var before checking it for `NULL`.

Coverity CID: 163704

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
b4411f5fc0 core: log error to journal
I hesitated on this one. Really, we *could* just explicitly cast the
result to mark it as used, though OTOH, we really should at least drop
something in the journal. It's not fatal, but it shouldn't happen so we
should know about it.

Coverity CID: 163717

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
7553b0000b livefs: comment out dead code
The `replacing` var was already checked to be FALSE higher up.

Coverity CID: 163689

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
cf410211d2 dbus-helpers: initialize bus name
In the event that we're not on a message bus, we need to make sure we're
passing NULL.

Coverity CID: 163684

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
c59c11f789 container-builtins: initialize fds to -1
1. We weren't initializing all fds to -1, but 0 is a valid fd number.
2. We were checking for nonzero rather than explicitly for -1.

Coverity CID: 163691
Coverity CID: 163700
Coverity CID: 163714

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
8d92273f3d vmcheck: create vmcheck branch and rebase onto it
I'm working on getting the vmcheck suite working as part of Fedora's new
CI pipeline. In that context, we want to test the deliverable as it is,
i.e. with SKIP_VMOVERLAY=1. For compatibility with the testsuite, we
ensure that the machine is on the vmcheck branch before starting the
tests.

Eventually, we should try to make the vmcheck suite runnable outside of
a configured build directory to make it easier to re-use in such
contexts.

Closes: #917
Approved by: cgwalters
2017-08-15 15:40:35 +00:00
Jonathan Lebon
188b45146c multitest.py: error if no hosts given
Otherwise it'll just hang waiting for a non-existent host.

Closes: #917
Approved by: cgwalters
2017-08-15 15:40:35 +00:00
Ruixin
534fc30308 app: provide command description in a better place
Before, when using rpm-ostree -h command, the command
description was shown together with the command itself

Now, we separate the command description out, providing
user a better view of the description.

Closes: #916
Approved by: jlebon
2017-08-15 13:09:09 +00:00
Ruixin
a2b2758e0f app: add more rpm-ostree -h output
This is brought up by https://github.com/projectatomic/rpm-ostree/issues/806.

When user types in rpm-ostree [subcommands] -h, the user can now see
more useful information for the subcommands.

Closes: #916
Approved by: jlebon
2017-08-15 13:09:09 +00:00
Colin Walters
ee1613e4bf livefs: Stop changing immutable bit on deployment roots
This is no longer necessary since we switched to tracking livefs state in the
origin, and we don't support changing content outside of `/usr` right now
via livefs.

Just noticed this while looking at the livefs code.

Closes: #912
Approved by: jlebon
2017-08-10 13:58:41 +00:00
Colin Walters
f41183e0e5 app/ex-container: Port to new style
Was just looking at this code as part of unified core work. It was an easy port.

Closes: #913
Approved by: jlebon
2017-08-10 13:39:08 +00:00
Colin Walters
0ff4403253 bin/compose: Port to new code style
Move basically everything except early option
processing into a helper function.

Also update a few other misc bits above that to new style.

Closes: #904
Approved by: jlebon
2017-08-08 17:09:13 +00:00
Colin Walters
162b8d4898 bin/compose: Silently ignore --workdir-tmpfs
Down the line when we have a unified core, this will be totally unnecessary.
Even without that, it's not worth the maintenance pain for us. Anyone who wants
this can easily on their own mount a tmpfs and point us at it with --workdir.

Prep for further code cleanup.

Closes: #904
Approved by: jlebon
2017-08-08 17:09:13 +00:00
Colin Walters
39e36db741 postprocess: Port a bit more to new style
Was looking at this file to change how we do kernels, and noticed these two were
straightforward ports.

Closes: #909
Approved by: jlebon
2017-08-08 16:24:45 +00:00
Colin Walters
787c880b64 bin/rebase: Add -b and -m options
The rebase command syntax has confused people a lot.  Let's follow
git here and add a `-b/--branch` option and encourage people to use
that.  The case of switching remotes is `-m/--remote`; it's definitely
unfortunate that `-r` is already taken for `--reboot`.

One thing I'm a little bit unhappy about is how we're doing logic
on the client side here.  Changing the DBus API for this would
also be awkward though.

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

Closes: #890
Approved by: jlebon
2017-08-08 16:02:15 +00:00