Commit Graph

1616 Commits

Author SHA1 Message Date
Colin Walters
c093a587a2 tests: Add a test case for lua scripts
This is currently unsupported, let's add a test case. Prep for support for
script overrides.

Closes: #973
Approved by: jlebon
2017-09-07 14:09:47 +00:00
Colin Walters
f69717bf69 libpriv+daemon: Use autocleanup to abort ostree txn
This allows porting one function each in the unpacker and sysroot to new style.
There were also two cases in the core where we were missing an
`abort_transaction()` invocation.

libostree version in: https://github.com/ostreedev/ostree/pull/1132
Prep for: https://github.com/projectatomic/rpm-ostree/pull/970

Closes: #972
Approved by: jlebon
2017-09-07 13:50:19 +00:00
Colin Walters
20abc85243 unpacker: Translate /boot → /usr/lib/ostree-boot
At one point `rpm-ostree install libvirt` dragged in libguestfs which in turn
brought in `syslinux-extlinux-nonlinux` which has files in `/boot/extlinux`,
which we rejected.  (That dependency chain appears to have been fixed currently)

For the general case, this is just a partial fix in that we haven't nailed down
the semantics of how updates for `/boot` work.  But in this particular case,
we'll just break libguestfs' `extlinux` verb, which I'm OK with.

Another case is `fwupdate-efi` - we require manual intervention to copy the
data into `/boot` after installing the package.

This is also preparation for [unified core](https://github.com/projectatomic/rpm-ostree/issues/729)
in that we now ensure imported kernels don't end up in `/boot` unless
explicitly configured.

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

Closes: #969
Approved by: jlebon
2017-09-07 13:30:36 +00:00
Ruixin Bao
d6b3217a86 lib/core: Detect file name conflict before rpmdb
This PR uses https://github.com/ostreedev/ostree/pull/1116
to ensure that when installing packages containing conflicting files, the
error will be detected at the ostree side, rather than when
writing the rpm database.

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

Closes: #974
Approved by: cgwalters
2017-09-07 13:13:12 +00:00
Jonathan Lebon
48ddca9280 ci: workaround broken fedora:26 image
This is essentially the same workaround as
https://github.com/ostreedev/ostree/pull/1143.

See https://bugzilla.redhat.com/show_bug.cgi?id=1483553.

Closes: #975
Approved by: cgwalters
2017-09-07 12:27:54 +00:00
Jonathan Lebon
7fbf9f32d4 hacking: make it easier to use a custom tree
Let's make using a custom install tree easier and document the process.
We split out the insttree step into `build.sh` so that we no longer have
to `flock(1)` around it, and also share between `overlay.sh` and
`sync.sh`.

Closes: #968
Approved by: cgwalters
2017-09-01 19:58:55 +00:00
Jonathan Lebon
5294c1ea69 scripts: squash a -Wmaybe-uninitialized
Closes: #968
Approved by: cgwalters
2017-09-01 19:58:55 +00:00
Colin Walters
a78a88844c libpriv/scripts: Use gperf comments, not C comments
I noticed our C-style comments were actually showing up in the generated hash
table. Consistently use gperf's `#`, and also move all comments to the line
above the value for more readability.

Closes: #967
Approved by: jlebon
2017-09-01 17:58:51 +00:00
Colin Walters
213a656ddf postprocess: Unlink our treecompose-post out of the final /bin
Another variant of <https://github.com/projectatomic/rpm-ostree/pull/822> 😭

Closes: #964
Approved by: jlebon
2017-08-31 03:06:11 +00:00
Colin Walters
3047513509 core: Run %post before %posttrans
While working on unified core and the Fedora Atomic Host content set, I hit a
dependency between `docker.posttrans` which tries to read `/etc/os-release`, and
`fedora-release-atomichost.post` which creates that symlink.

It seems best practice to me to run `%post`s strictly before
`%posttrans`; we're not likely to do parallelization anytime
soon anyways.

While here I cleaned things up by having an enum for the script kind,
rather than multiple functions, otherwise we would have had another
wrapper in core.c.

Closes: #963
Approved by: jlebon
2017-08-30 15:50:09 +00:00
Colin Walters
4cbdcf93c8 daemon/syscore: Add some error prefixing to cleanup paths
Would likely have helped clarify this issue where an ostree repo txn failed
post-bootloader txn: <https://github.com/projectatomic/rpm-ostree/issues/958>

Closes: #960
Approved by: jlebon
2017-08-29 13:24:06 +00:00
Jonathan Lebon
44ea9f35a1 ci: also compile tests
This should make sure we catch test errors such as
https://github.com/GNOME/libglnx/pull/76 when bumping submodules (until
we eventually get a PR tester on libglnx).

Requires: https://github.com/GNOME/libglnx/pull/76

Update submodule: libglnx

Closes: #954
Approved by: cgwalters
2017-08-29 13:07:21 +00:00
Colin Walters
8a87887988 libpriv/postprocess: Port add-files to fd-relative
This is the last bit that used a `yumroot` variable.

Closes: #950
Approved by: jlebon
2017-08-28 13:46:44 +00:00
Colin Walters
d469323693 libpriv/passwd: Fully complete fd-relative porting
I initially thought I wouldn't need this but it turns out it makes things nicer
unified core. In the legacy path we'll need to write
`etc/passwd`, but now we need `usr/etc/passwd` in the unified path, and
we can start to match up with the other code paths which are fd-relative.

Closes: #950
Approved by: jlebon
2017-08-28 13:46:44 +00:00
Colin Walters
3f5cc629dc lib/unpacker: Add a SKIP_EXTRANEOUS flag, use it for filesystem+rootfiles
Prep for unified core. For packages we know ship stuff we want to skip, enable
this flag.

Closes: #951
Approved by: jlebon
2017-08-25 19:25:29 +00:00
Colin Walters
acbf00724d lib/unpacker: Drop ostree convention flag, always enable it
The core use case always enabled this; we exposed it on the command line, but
honestly I think it's a lot simpler if our imports always enable this. If we
need to *undo* it (for example, generating a "traditional feeling" OCI/Docker
image a la <https://github.com/projectatomic/rpm-ostree/pull/367>), we can
easily do that as postprocessing afterwards.

Closes: #951
Approved by: jlebon
2017-08-25 19:25:29 +00:00
Colin Walters
5633424628 lib/unpacker: Fix theoretical error handling case
We should be using `g_propagate_error()` to ensure we handle the case where the
caller specifies `NULL` for the error.

Closes: #951
Approved by: jlebon
2017-08-25 19:25:29 +00:00
Jonathan Lebon
e605386818 daemon: make use of the new deployment flags
Now that we have the semantics we need in libostree, let's just use that
and drop the logic here.

Closes: #942
Approved by: cgwalters
2017-08-25 18:59:24 +00:00
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