Commit Graph

2148 Commits

Author SHA1 Message Date
Giuseppe Scrivano
ccbb10d107 ostree-repo.c: fix typo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-16 11:34:48 +01:00
Matthew Barnes
5a3300fe5b repo: Delete .commitmeta file on empty metadata
The API docs for ostree_repo_write_commit_detached_metadata() were
written as though it already behaved that way.

https://bugzilla.gnome.org/746123
2015-03-13 12:34:19 -04:00
Colin Walters
c732178a43 build: Use both pkg-config and AM_PATH_GPGME
Apparently OpenEmbeddeded only supports pkg-config (and includes
gpgme.pc in its content), and Fedora only has the latter.  So do both.
2015-03-11 16:22:52 -04:00
Matthew Barnes
187e8d632e configure.ac: Make gpgme a hard dependency
In anticipation of API enhancements for GPG signature verification, which
would otherwise require a non-functional stub version were GPGME excluded.

GPGME is a pretty lightweight dependency, and the motivation to exclude
it is not clear.
2015-03-11 12:03:33 -04:00
Colin Walters
8724adc193 README.md: Note make check 2015-03-10 21:51:20 -04:00
Colin Walters
9630d06ec7 sysroot: Port some deployment reading code to fd-relative APIs
More low hanging fruit in the sysroot department.
2015-03-10 10:47:47 -04:00
Colin Walters
6ac880c959 deployment: Add an API to get relative origin path
This will be used for fd-relative cleanups.
2015-03-10 10:47:47 -04:00
Colin Walters
c86a86f742 sysroot: Drop unnecessary new sysroot object
We're asserting that "/" is the same as our path, so we don't need to
make a new object.
2015-03-10 08:41:04 -04:00
Daniel Drake
5c1839c4db ostree-prepare-root: log informational messages to stdout
ostree-prepare-root was logging normal, informational messages
to stderr which the systemd unit points to the console.

To achieve silent boot, log these ordinary messages to stdout only.
2015-03-09 21:26:13 -04:00
Colin Walters
40385c9874 glnx: Update 2015-03-09 21:25:06 -04:00
Colin Walters
a282f94f5d sysroot: Make origin parsing code fd-relative
Just more API conversion.
2015-03-09 14:29:14 -04:00
Colin Walters
68ce554202 sysroot: Read the bootloader configuration with fd-relative API
Another piece of the conversion.
2015-03-09 14:29:14 -04:00
Colin Walters
a5ffaca9d7 sysroot: Read some bootloader state with fd-relative API
This is the start of migrating the deployment path to fd-relative
code.
2015-03-09 14:29:14 -04:00
Giuseppe Scrivano
3f3096a65c tests: Add tests for test-ot-tool-util
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Giuseppe Scrivano
ab39f59249 src: Drop unused argument "value" from ot_parse_boolean
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Giuseppe Scrivano
c70abfd43c src: Move ot-tool-util from ostree/ to libotutil/
These utilities are not actually specific to the ostree commandline.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Giuseppe Scrivano
479b5ab4fc libotutil: remove ot-waitable-queue.
The module is not not used anymore.  It can be restored from git if
needed again.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Giuseppe Scrivano
c1c34c601a tests: add test for test-ot-opt-utils.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Giuseppe Scrivano
50c69c3392 keyfile-utils: add tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:37 +01:00
Giuseppe Scrivano
021c55f430 ot_keyfile_copy_group: return FALSE on invalid inputs
The function returns a gboolean, replace g_return_if_fail with
g_return_val_if_fail.

Add similar checks to the other functions.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:37 +01:00
Giuseppe Scrivano
bfd92653c3 ostree-repo-refs: Drop unused function "parse_rev_file".
If it will be needed in future, it can be retrieved from the git
history.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:37 +01:00
Giuseppe Scrivano
150048f9b8 src: drop some dead assignments
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:37 +01:00
Matthew Barnes
c2b01adbf0 OstreeGpgVerifier: Take the signature as a GBytes
The signature data is in memory to begin with, so there's no need to
write it to disk only to immediately read it back.

Also, because the GPGME multi-keyring workaround is somewhat expensive
to setup and teardown, concatenate all signatures into a single GBytes
so _ostree_gpg_verifier_check_signature() is only called once.  We're
currently only looking for one valid signature anyway.
2015-03-06 08:22:44 -05:00
Matthew Barnes
70cabcea0a gpg: Rewrite OstreeGpgVerifier to use GPGME
This sets the stage for more advanced signature management.

(Also, talking to GPG over pipes sucks.)

Previously we were spawning gpgv2 with a bunch of --keyring options
for /usr/share/ostree/trusted.gpg.d/ and whatever other keyring files
were explicitly added.  GPGME has no public API for multiple keyrings,
so we work around the issue by setting up a temp directory to serve as
a fake "home" directory for the crypto engine and then concatenate all
the keyring files into a single public keyring (pubring.gpg).

Unfortunately at present we do this on every signature verification.
There's a desire to cache this concatenation, but the problem is the
user may be unprivileged.  So it seems the cache would have to be per
user under $XDG_CACHE_HOME, which OSTree doesn't otherwise use.  I'm
open to suggestions.

We do at least clean up the temp directory when finished, and I have
further API changes planned to OstreeGpgVerifier to help mitigate the
performance impact.
2015-03-06 08:22:44 -05:00
Giuseppe Scrivano
d414ee5852 tests: add tests for mutable tree.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-04 17:52:17 -05:00
Colin Walters
191d78ebfc repo: Fix assertion to allow NULL options
Spotted by Adam Coldrick.
2015-03-03 21:18:40 -05:00
Colin Walters
d750e2e2eb commit: Add missing (allow-none) in write_ref_immediate()
Spotted by Adam Coldrick.
2015-03-03 21:16:33 -05:00
Colin Walters
67cec3a4de deltas: Use mmap() instead of copying input file
It's more efficient.
2015-03-03 18:39:45 -05:00
Colin Walters
3e3eb01335 deltas: Gather statistics on total number rollsum'd and bsdiff'd
Useful for debugging at least.  Though in the future it'd be nice to
store this inside the delta metadata maybe?
2015-03-03 18:32:24 -05:00
Giuseppe Scrivano
aeafdfff05 tests: Remove some duplications from Makefile-tests.am
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 18:32:24 -05:00
Giuseppe Scrivano
aea173b3f8 tests: enforce ${CMD_PREFIX} on all ostree processes
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 18:32:24 -05:00
Giuseppe Scrivano
948327fb67 ostree_repo_static_delta_generate: add new param "verbose"
it will be used by the next patch that adds "--generate-static-delta"
to the commit command.

As part of the patch, update the list of supported "params" in the
documentation.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Colin Walters
392929d9bc static-delta: Add --disable-bsdiff option
A builder may not want to pay the CPU penalty.  Also it's useful for
evaluating performance.
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
9843c4c245 Makefile.dist-packaging: fix make rpm with submodules
Makefile.dist-packaging seems to assume to be run under packaging/ as
"make -C packaging -f Makefile.dist-packaging rpm" so ensure the
srcdir is set correctly to point to the parent directory.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
494d3535e4 Fix "make syntax-check" failures.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
9e3a018d85 autogen.sh: replace all $(libbsdiff_srcpath) and $(libglnx_srcpath)
The variable could be specified more times on the same line, having
something like:

EXTRA_DIST += ./libglnx/README $(libglnx_srcpath)/COPYING

Now the change ensures that it looks like:

EXTRA_DIST += ./libglnx/README ./libglnx/COPYING

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
6029f4d820 tests: add test for bsdiff
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
439e1c1b97 static-delta: increase threshold for rollsum to 50%
It favours bsdiff usage for files that are not very rollsum friendly.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
3f3bb8e37d Add bsdiff support to deltas
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Giuseppe Scrivano
a705d9cf29 Add bsdiff submodule
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-03 12:16:17 -05:00
Colin Walters
488efac728 repo: Port hardlink-scanning code to fd-relative calls
Continuing the migration.
2015-03-03 11:48:41 -05:00
Colin Walters
6e0d92db00 repo: Drop internal GFile* API helper
There are no users anymore.
2015-03-03 11:48:41 -05:00
Colin Walters
5b3a495018 deploy: Use glnx file copy code
This is centralizing more generic utility code in libglnx.
2015-03-03 11:48:41 -05:00
Matthew Barnes
c107561171 core: Fix duplication bug in _ostree_detached_metadata_append_gpg_sig()
g_variant_builder_add() does not replace identical keys in a VARDICT
variant, so signing a commit multiple times results in multiple copies
of "ostree.gpgsigs" in the metadata.  And since g_variant_lookup_value()
stops on the first match, subsequent signatures have no net effect.

Instead of GVariantBuilder use GVariantDict, which behaves more like a
hash table.
2015-03-02 15:13:49 -05:00
Matthew Barnes
c04f9f47e3 core: Add definitions for GPG signature metadata
_OSTREE_METADATA_GPGSIGS_NAME
_OSTREE_METADATA_GPGSIGS_TYPE
2015-03-02 15:12:06 -05:00
Matthew Barnes
fdda36eb77 libotutil: Allow no variant in ot_util_variant_builder_from_variant()
For programming convenience in cases where we may or may not have a
GVariant to initialize the builder with.
2015-03-02 15:12:06 -05:00
Matthew Barnes
b05d670031 libotutil: Remove ot_variant_new_from_bytes()
Not needed anymore - use g_variant_new_from_bytes().
2015-03-02 15:12:06 -05:00
Matthew Barnes
85933c7cca configure.ac: Bump GLib requirement to 2.40
Mainly for GVariantDict, useful for metadata.
2015-03-02 15:06:46 -05:00
Matthew Barnes
0bae648977 gpg: Remove _ostree_gpg_verifier_set_homedir()
Never called, and the setting is never applied anyway.
2015-03-02 12:03:04 -05:00
Matthew Barnes
a5b002dae6 ostree: Add gpg-sign command
Signs a commit with one or more GPG keys.
2015-02-26 12:53:01 -05:00