Commit Graph

1362 Commits

Author SHA1 Message Date
Colin Walters
88b8f1a655 unpacker: Don't error out layering fcaps-only binaries
In f25 now, `kubernetes-master` is changed to be owned by `root:root`
but still has file capabilities.  Our "non-root owned" check was
bombing out because we need to explicitly ignore "root" ownership.

(If there were no fcaps, then there's no override to check)

Closes: #532
Approved by: jlebon
2016-12-05 19:35:07 +00:00
Colin Walters
7149e9fee5 unpacker: Reorganize code for non-root checks
No functional changes, but I find this more legible - fewer
interacting conditionals.

Closes: #532
Approved by: jlebon
2016-12-05 19:35:07 +00:00
Colin Walters
74c43a0209 core: Error out if we're trying to do an empty install set
This is a partial fix for
https://github.com/projectatomic/rpm-ostree/issues/529

We could drop into this codepath via multiple ways (containers,
etc.), so it makes sense to have a last ditch error here, even
if we should really give an error earlier.

Closes: #530
Approved by: jlebon
2016-12-01 21:15:38 +00:00
Colin Walters
fec4b885ea docs: Document mutate-os-release
Since I actually forgot the semantics when working on
CentOS AH, and noticed we were missing docs.

Closes: #528
Approved by: jlebon
2016-11-30 17:19:57 +00:00
Colin Walters
351832f29e Fix install-langs support
We're looking at changing Atomic Host to use multiple locales (but not all);
See: https://bugzilla.redhat.com/show_bug.cgi?id=1186757

This revealed our `install-langs` support didn't really work.  Our
`treecompose-post.sh` was deleting the extraneous translations anyways,
which masked this.  And for other cases like workstations where
we drag along all the translations anyways, it was fine too.

There were two bugs:
 - In the keyfile spec it's `instlangs`
 - We were setting the macro a bit too late, it should be before
   `dnf_context_setup()`.

Closes: #525
Approved by: jlebon
2016-11-24 14:38:16 +00:00
Jonathan Lebon
05c59d11fa .redhat-ci.yml: run vmcheck tests
Use the newly added support for cluster tests in Red Hat CI to run the
vmcheck testsuite.

Closes: #524
Approved by: cgwalters
2016-11-22 17:15:20 +00:00
Jonathan Lebon
12c4b5b16f vmcheck: adapt for non-vagrant hosts
This is just the final bit required to make sure the vagrant and
non-vagrant paths can work happily together. It's mostly minor fixes,
though the most major change which also affects vagrant is that we now
sync to the root home dir, rather than ~vagrant.

Closes: #524
Approved by: cgwalters
2016-11-22 17:15:20 +00:00
Yunchih Chen
2d12d436ec hacking: add builddep command
Closes: #523
Approved by: cgwalters
2016-11-21 16:07:35 +00:00
Colin Walters
6074a6d728 daemon: Use new OSTree API to verify commits by remotes
Otherwise, we would show remotes using the new `gpgkeypath`
as unknown.

See: https://github.com/ostreedev/ostree/pull/575
See: https://github.com/ostreedev/ostree/issues/573
See: https://bugzilla.redhat.com/show_bug.cgi?id=1393545

Closes: #521
Approved by: jlebon
2016-11-17 16:32:11 +00:00
Colin Walters
2f9d586bdc Redo vmcheck to abstract over ssh-config, drop all building
My development environment is now using "pet" docker containers.
I use VMs for testing things that require that (like rpm-ostree).

This patch builds on work from @jlebon in
https://github.com/projectatomic/rpm-ostree/pull/509
to rework `vmcheck` such that it can work on any `ssh-config`.  By
default we expect this to be Vagrant.

However, I go a lot farther and delete the `vmbuild` code that was
trying to do builds in a container on the target VM.  I think this is
still worth pursuing at some point, but for now I think it's
reasonable to assume that the rpm-ostree developer audience uses Linux
as their host workstation and hence has containers.

(There's another important point here in that for developing lower
 level things like rpm-ostree, there's a strong push to make the VM
 disposable and not a pet)

Closes: #516
Approved by: jlebon
2016-11-16 18:14:23 +00:00
Colin Walters
1577afd85c vagrant: Switch to c7alpha, set up sshfs
The default C7 box gets old, I'd like to have Alpha be a focus
for development.

Let's use sshfs if available.

Closes: #516
Approved by: jlebon
2016-11-16 18:14:23 +00:00
Jonathan Lebon
313a832d7c vagrant: generate ssh-config
We further split libvm from vagrant. It no longer does 'vagrant
ssh-config'. Instead, it always assumes that an ssh-config is provided.
We now have complete separation of libvm from vagrant.

We change the ansible provisioner as follows:
  - Allow passing in a VAGRANT_BOX env var to override the default
    CentOS box.
  - No longer assume that the root user account is unlocked and has a
    valid 'vagrant' password. This worked for the centos box but isn't
    sure to work on every box. Instead, we now just run ansible as the
    default vagrant user, and during provisioning set up the root
    account and generate an ssh-config so that libvm can connect
    directly as root.
  - No longer build the buildimg during provisioning. This actually
    stopped working a while ago since the default rsync is disabled. We
    can just let the buildimg get created on the first compilation. In
    practice, the bigger issue isn't creating the buildimg, but being
    able to easily update the host and buildimg pkgs.

Closes: #516
Approved by: jlebon
2016-11-16 18:14:23 +00:00
Colin Walters
ae108e08a5 Add rpmostree.clientlayer metadata to derived commits
In the future we may add more commands that take as input commit
IDs.  However, we really want to distinguish between server and
client generated commits, as some of these operations won't
make sense for derived commits.

This changes the API to have callers say which type of commit
they're generating, which also fixes a FIXME, and helps get us
a bit closer to the "unified core".

Closes: #520
Approved by: jlebon
2016-11-15 17:11:11 +00:00
Colin Walters
78eba17c2e Release 2016.12
Closes: #519
Approved by: jlebon
2016-11-15 15:11:56 +00:00
Colin Walters
a5379a2520 tests: Test pinned package version
It should work for both layering and treecompose.

Closes: #518
Approved by: jlebon
2016-11-14 21:31:54 +00:00
Colin Walters
96cf2326ac redhat-ci: Update to match ostree
Let's try the buildapi and clang bits etc.

Closes: #514
Approved by: jlebon
2016-11-11 21:49:53 +00:00
Colin Walters
3138fcd8f9 libdnf: Update to latest master
For the fixes below, mostly Clang and install semantics.

```
$ git shortlog 34a9906d9311b59ba00e67b57eb038516cb2c7af..f102fd3785516b691864b2d48ef0a01825213d1a
Colin Walters (4):
      build: Use -std=gnu11
      tree-wide: Remove some unused variables
      package: Fix return type of checksum conversion function
      context: Change install() to honor exact NEVRAs, provides, paths

Michael Mraka (1):
      fixing SIGSEGV in dnf_package_get_location()

Michal Luscon (1):
      repo: remove assert nonsense
```

Closes: #513
Approved by: jlebon
2016-11-11 20:53:24 +00:00
Colin Walters
c8e7c63ab2 Final removal of libgsystem dependency
Just like ostree.  Now we can consider it dead.

Closes: #511
Approved by: jlebon
2016-11-08 14:38:54 +00:00
Colin Walters
90d52e3d5e libpriv: Pull in copy of gs_file_get_path_cached()
This is the same thing done in OSTree; we still have a lot of
references to it.  Maybe it should go in libglnx actually, since
flatpak uses it too.

Closes: #511
Approved by: jlebon
2016-11-08 14:38:54 +00:00
Colin Walters
a347ff5f69 postprocess: Port remaining libgsystem call sites
Except for `gs_file_get_path_cached()`.  We have to carry
the recursive hardlinking code, oh well.

Closes: #511
Approved by: jlebon
2016-11-08 14:38:54 +00:00
Colin Walters
5c8d80042c postprocess: More fd-relative-ification
I hit a bit of a wall here around `gs_shutil_cp_al_or_fallback()`.
I guess we'll have to reimplement it here.

In the meantime, this gets us closer.

Closes: #510
Approved by: jlebon
2016-11-04 14:59:27 +00:00
Colin Walters
634a475ae4 postprocess: Drop a libgsystem use in add-files
I'm cowardly just using gs_file_get_path_cached() for now.

Closes: #510
Approved by: jlebon
2016-11-04 14:59:27 +00:00
Colin Walters
e0357f41d1 postprocess: Port tmpfiles.d-copying code to fd-relative
Drops libgsystem use.

Closes: #510
Approved by: jlebon
2016-11-04 14:59:27 +00:00
Colin Walters
68898217ed postprocess: Drop use of gs_file_rename(), use fd-relative
Another libgsystem use gone.

Closes: #510
Approved by: jlebon
2016-11-04 14:59:27 +00:00
Colin Walters
1e6f4d4f21 compose: Create rootdir more directly, use fd-relative
Mostly to drop a libgsystem use.

Closes: #510
Approved by: jlebon
2016-11-04 14:59:27 +00:00
Colin Walters
d45c0253a0 compose: Honor --dry-run --touch-if-changed
Some people using Jenkins jobs and the like may want to separate
"trigger detection" from execution.  If combined with `--cachedir`,
it's reasonably efficient to separate the two.

Closes: #508
Approved by: jlebon
2016-11-02 16:54:29 +00:00
Jonathan Lebon
47ba21aca1 daemon: use refspec after pulling ancestry
Previously, in preparation for validating e.g. versions during 'deploy'
operations, we would pull the latest commit metadata. However, we would
then do resolve on the branch name only rather than the full refspec.
But this can sometimes give the wrong checksum. For example, if we have
multiple remotes holding the same branch name, ostree_repo_resolve_rev
will just start looking in each remote for the specified ref, and we may
thus end up with the checksum from the wrong remote.

Related: RHBZ#1390259

Closes: #507
Approved by: cgwalters
2016-10-31 16:45:08 +00:00
Jonathan Lebon
e2e7908d39 upgrader: small amendment to previous commit
I actually meant to push this during PR review so that it could be
squashed with 5cbc57b, but forgot.

Closes: #507
Approved by: cgwalters
2016-10-31 16:45:08 +00:00
Colin Walters
0d720e46e0 Add .redhat-ci.yml
Copied from ostree, tweaked a little bit.  We can't yet use
`-Werror=unused-variable` until
https://github.com/rpm-software-management/libhif/pull/205

Closes: #506
Approved by: jlebon
2016-10-31 13:17:26 +00:00
Colin Walters
e4068c5094 tree-wide: Fix use of potentially uninitialized variables
These were caught by Clang.

Closes: #505
Approved by: jlebon
2016-10-28 20:28:35 +00:00
Colin Walters
55593b77c4 tree-wide: Fix use of incorrect flag type
This is clang's `-Wenum-conversion`, which I'd like to make fatal,
except libdnf trips it too.

Closes: #505
Approved by: jlebon
2016-10-28 20:28:35 +00:00
Colin Walters
7ee4edf8e3 tree-wide: Remove more unused variables
Now that the other PRs are merged, kill of the rest of the unused
variables.

Closes: #504
Approved by: jlebon
2016-10-28 18:25:33 +00:00
Colin Walters
aed6077e73 core: Fix lock directory initialization
Though in practice, we just aren't using this right now.

Closes: #504
Approved by: jlebon
2016-10-28 18:25:33 +00:00
Colin Walters
be7e29fb61 libglnx: Update to master (for -fsanitize=undefined fixes)
Closes: #504
Approved by: jlebon
2016-10-28 18:25:33 +00:00
Colin Walters
5100506909 compose: Port a large chunk of postprocessing to fd-relative
Part of the de-libgsystem-ification porting.

Closes: #498
Approved by: jlebon
2016-10-27 14:57:43 +00:00
Colin Walters
233f8c7602 tree-wide: Drop the last libgsystem autocleanup usage
Closes: #498
Approved by: jlebon
2016-10-27 14:57:43 +00:00
Colin Walters
1c2908cbef tree-wide: Port away from gs_transfer_out_value()
Using `g_steal_pointer()` is a little bit more typing, but less
magical which is good.

Closes: #498
Approved by: jlebon
2016-10-27 14:57:42 +00:00
Colin Walters
94a461cb4e tree-wide: Remove some unused variables found by CLang
This isn't all of them, but I'm trying to avoid conflicting
with my other outstanding PR.

Closes: #501
Approved by: jlebon
2016-10-27 14:30:47 +00:00
Colin Walters
a9ccf765c4 daemon: Fix use of a potentially uninitialized variable
If there's no origin, we'd be adding undefined stack memory for
the value of `gpg-enabled`.

Closes: #501
Approved by: jlebon
2016-10-27 14:30:47 +00:00
Colin Walters
7025cb778e build-sys: Bump to -std=gnu11
Mostly because when building with CLang, I get a spam of warnings
like:

```
/home/walters/src/github/projectatomic/rpm-ostree/libdnf/libdnf/dnf-transaction.h:37:27: warning: redefinition of typedef 'DnfTransaction' is a C11 feature [-Wtypedef-redefinition]
G_DECLARE_DERIVABLE_TYPE (DnfTransaction, dnf_transaction, DNF, TRANSACTION, GObject)
```

Closes: #501
Approved by: jlebon
2016-10-27 14:30:47 +00:00
Colin Walters
c389b6e939 Release 2016.11
Closes: #500
Approved by: jlebon
2016-10-21 20:07:49 +00:00
Colin Walters
17100ef27c libdnf: Update to current master
This notably fixes the spam of transaction warnings.  Due to a libdnf
build system improvement, we no longer need to manually propagate
`CFLAGS`.

Closes: #499
Approved by: jlebon
2016-10-21 19:27:13 +00:00
Colin Walters
328b85d396 Add infrastructure for alternative name (currently nts)
See https://github.com/projectatomic/rpm-ostree/issues/405

This patch adds an (off by default) `--enable-new-name` build option
which currently defaults to `nts`.  This is purely additive, and
the intention is that we'll support the rpm-ostree name in
perpetuity most likely.

At the moment, we add a new name for:
  - /usr/bin/$name
  - The systemd unit file

But we notably *don't* attempt to add a new name to the DBus API,
as it'd be a lot more invasive of a patch, and less payoff (it's
mostly just programs/scripts that interact with the DBus).

Closes: #497
Approved by: jlebon
2016-10-20 14:22:28 +00:00
Jonathan Lebon
2d07772aa3 test-basic.sh: add test for bad out-of-branch deploy
Closes: #495
Approved by: cgwalters
2016-10-20 14:06:58 +00:00
Jonathan Lebon
0b6721a10a deploy: make sure commits are on the current branch
A funky behaviour of `rpm-ostree deploy` was that specifying a csum
directly allowed you to jump to any commit, regardless of whether that
commit exists on the current branch or not. We tighten that up here so
that we check that the checksum does exist on the current branch.

The previous behaviour can be useful of course, but we might want to
change how users access it so that we don't get inconsistencies such as
rpm-ostree status saying that we're sitting on a specific branch with a
specific commit which doesn't actually belong to that branch.

Closes: #495
Approved by: cgwalters
2016-10-20 14:06:58 +00:00
Colin Walters
5cbc57b426 upgrader: Use new tree for libdnf source root to major version rebasing
I'm trying to rebase my workstation across a major version, but
hit the issue that we were pointing libdnf at the current root,
and hence it inherited the major of 24, when my target base ref
was 25.  In trivial cases this may work, but I have various things
like Emacs layered that caused dependency resolution failure.

The obvious fix here is to point libdnf at the target base ref.
However, until now we'd been checking out a minimal copy of the tree
*before* doing package upgrade resolution.  I considered trying
to add `/usr/lib/os-release` to that set, but it doesn't seem
sustainable.

Particularly since I think the original rationale for this was that
the checkout was slow, but that was when we had `fsync()` on, which we
don't now.

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

Closes: #496
Approved by: jlebon
2016-10-19 15:43:13 +00:00
Colin Walters
49fffad471 Run bwrap with fixed environment (PATH + LANG)
This is basically a re-implementation of
85c9dd5c07
for the same reasons: it makes things work for rpm-ostree running
inside NixOS.  But there are other cases where if e.g. an unprivileged
user runs rpm-ostree and may not have `/usr/sbin` in PATH, we still
want the container to pick it up, etc.

While changing things I nuked the hacky `RPMOSTREE_DEBUG_SCRIPT` env
var, we can re-add it later in a better way if needed.

Closes: #490
Approved by: jlebon
2016-10-17 20:29:35 +00:00
Patrick Uiterwijk
98332a3be4 compose: Add option to write commitid to file instead of updating ref
Closes: #492
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>

Closes: #494
Approved by: cgwalters
2016-10-17 20:02:55 +00:00
Colin Walters
4542778648 tree-wide: Port to g_file_enumerator_iterate()
Unlike OSTree, I'm going to assert we can take a hard dependency
on the version of GLib that has it.

Closes: #483
Approved by: jlebon
2016-10-17 19:59:40 +00:00
Colin Walters
afb7ad6bbe tree-wide: Port to g_spawn_sync instead of libgsystem subprocess API
Closes: #483
Approved by: jlebon
2016-10-17 19:59:40 +00:00