Commit Graph

2904 Commits

Author SHA1 Message Date
Simon McVittie c800f12250 libostree-dev: stop depending on ostree
It isn't necessary to use the library, and would break multiarch
installability.
2016-09-30 22:42:02 +01:00
Simon McVittie a413cd0c28 Install GObject-Introspection typelibs to multiarch path, and mark gir1.2-ostree-1.0 as Multi-Arch: same 2016-09-30 22:38:41 +01:00
Simon McVittie 0229850943 Relicense debian/ from GPL-2+ to LGPL-2+, with permission from David King 2016-09-21 21:58:57 +01:00
Simon McVittie d7132eda03 2016.10-1 2016-09-15 08:27:07 +01:00
Simon McVittie 9b8038c28c Make libostree-doc Multi-Arch: foreign 2016-09-14 23:32:59 +01:00
Simon McVittie 3cbb901ce4 Make libostree-dev Multi-Arch: same 2016-09-14 23:32:27 +01:00
Simon McVittie c3e29fcf3b New upstream release 2016-09-09 16:57:59 +01:00
Simon McVittie b9c0804186 Merge tag 'upstream/2016.10' into debian/master
Upstream version 2016.10
2016-09-09 16:56:47 +01:00
Simon McVittie 9732c6c712 New upstream version 2016.10 2016-09-09 16:56:45 +01:00
Simon McVittie b83b3d05ee Terminate individual tests after 30 minutes
This is an attempt to debug what happened on the ppc64el buildd.
2016-09-09 08:25:07 +01:00
Colin Walters 36e8ba124e Release 2016.10
Closes: #502
Approved by: cgwalters
2016-09-09 00:28:02 +00:00
Colin Walters 916684ba0d core: Make OSTREE_TIMESTAMP public API
This way e.g. flatpak can detect which timestamp it should use.
See `flatpak/common/flatpak-utils.c:flatpak_zero_mtime`.

Closes: #501
Approved by: cgwalters
2016-09-09 00:10:21 +00:00
Colin Walters 30aaffa995 sysroot: Avoid double cleanup, and ensure no cleanup if specified
Since forever, we've been doing two cleanups.  In
8ece4d6d51
I thought we were doing just one and wanted to go to zero (if specified),
but I actually just dropped one cleanup.

In https://github.com/projectatomic/rpm-ostree/pull/452
@jlebon pointed out the duplication.  Fix this by creating a new internal
deploy wrapper that takes cleanup flags.

(Since we already had the "piecemeal cleanup" API internally, let's
 frame it in terms of that, rather than passing down a boolean).

Closes: #500
Approved by: jlebon
2016-09-08 20:42:09 +00:00
Colin Walters 82b756783b fetcher: Fix another finalization deadlock
If the current repo is already up to date (we have no content to
fetch), it's possible for the fetcher to not request any URIs.  So
create and then finalize it quickly.

Finalization involves calling `g_main_loop_quit()` +
`g_thread_wait()`.  However, if `g_main_loop_quit()` is run *before*
`g_main_loop_run()`, we'll deadlock because GMainLoop assumes in
`_run()` to start things.

This is a common trap - ideally, GMainLoop would record if `_quit()`
was called before `_run()` or something, but doing that now would
likely break people who are expecting quit() -> run() to restart.

In general, we've moved in various GLib-consuming apps to an
explicit "main context iteration with termination condition" model;
see `pull_termination_condition()` in the pull code.

This fixes this race condition.

I verified that an assertion in `_finalize` that more than
zero URIs were requested was hit in multiple test cases, and this patch
has survived a while of make check loops.

Closes: https://github.com/ostreedev/ostree/issues/496

Closes: #499
Approved by: jlebon
2016-09-08 20:09:07 +00:00
Colin Walters 23b4b58d57 delta: Unreference files we've processed
This should help avoid address space exhaustion on 32 bit systems,
and in general is obviously going to improve efficiency.

Closes: #498
Approved by: alexlarsson
2016-09-08 15:21:41 +00:00
Colin Walters e127070550 repo: Only use mmap() for metadata > 16k
See http://stackoverflow.com/questions/258091/when-should-i-use-mmap-for-file-access
and
https://lwn.net/Articles/591978/

I didn't really notice much performance difference in some small
tests, but I happened to be stracing and realized we were `mmap()`ing
even for 50 bytes which is not very useful, so let's not do it.

Closes: #489
Approved by: alexlarsson
2016-09-08 14:56:30 +00:00
Colin Walters 8dbb104cdc delta: Add missing `goto out` for failure to mmap()
This was hit in practice when generating a delta for a flatpak app on ARM
it looks like.

Closes: #497
Approved by: alexlarsson
2016-09-08 14:34:04 +00:00
Colin Walters 845dc65196 repo: Revert default timestamp from 1 back to 0
Quoting Dan Nicholson in

  <https://github.com/ostreedev/ostree/pull/330#issuecomment-245499099>

  mtime of 0 has been the semantics of ostree deployments from basically
  the beginning of the project. We (and others, see
  flatpak/flatpak@b5204c9) rely on that fact when generating trees.

  In particular, this affects caches that use the mtime of the
  associated file or directory to determine if the cache is valid. By
  arbitrarily changing the mtime of the files to something else, all
  the caches we setup in the build are now invalidated. Preseeding
  caches is really important to the user experience as it avoids
  having the user wait while they're regenerated on first run.

  Now, we could change our build infrastructure to preset all the
  mtimes to 1 to match this change, but what does that do for our
  existing users who are on an ostree that deploys with mtimes of 0?
  We could just revert this change at Endless (and the associated one
  in Flatpak), and that would be fine for our users. However, if we
  point non-Endless users to our apps, they'll have the great
  experience of waiting 10 seconds the first time they launch it while
  the fontconfig cache is rebuilt unnecessarily.

Closes: #495
Approved by: jlebon
2016-09-08 13:35:59 +00:00
Giuseppe Scrivano f760a4612a gpg: do not segfault when the algorithm name is not known
Reported by: Patrick Uiterwijk
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #494
Approved by: cgwalters
2016-09-08 11:19:20 +00:00
Simon McVittie 05a9a7e9d4 2016.9-1 2016-09-06 09:59:08 +01:00
Simon McVittie 54cca3dbd3 Add some more new ABI 2016-09-06 09:52:19 +01:00
Simon McVittie a840448250 d/p/Makefile-tests.am-make-check-uses-the-built-binaries.patch: drop, applied upstream 2016-09-06 09:34:37 +01:00
Simon McVittie 746f509b53 drop libgsystem build-dependency 2016-09-06 09:33:26 +01:00
Simon McVittie a5d90759a7 New upstream version
- update symbols file for new ABI
  - update copyright file
  - update ostree-boot packaging: the utilities in /usr/sbin moved to
    /usr/lib/ostree
2016-09-06 09:32:41 +01:00
Simon McVittie 0922be3ba5 Merge tag 'upstream/2016.9' into debian/master
Upstream version 2016.9
2016-09-06 09:14:31 +01:00
Simon McVittie 9caebfc847 New upstream version 2016.9 2016-09-06 09:14:29 +01:00
Simon McVittie 37c36fe4f7 Merge tag 'upstream/2016.8' into debian/master
Upstream version 2016.8
2016-09-06 09:02:00 +01:00
Simon McVittie ba02f3eb2f New upstream version 2016.8 2016-09-06 09:01:54 +01:00
William Manley 2aacc6912b ostree-prepare-root: Fix running with musl
musl libc's implementation of `realpath` works by opening the path and then
doing a lookup in `/proc/self/fd` to find the canonical path.  This fails
if `/proc` is not mounted.  This causes problems for us if
`ostree-prepare-root` is `init` as `/proc` won't be mounted.

We have to mount `/proc` anyway for `/proc/cmdline` so this fix just
expands the scope over which `/proc` is mounted to include both our
`realpath` calls.

See also:

* http://www.openwall.com/lists/musl/2016/06/08/2 and
* http://git.musl-libc.org/cgit/musl/tree/src/misc/realpath.c?id=e738b8cbe64b6dd3ed9f47b6d4cd7eb2c422b38d

Closes: #485
Approved by: cgwalters
2016-09-01 20:17:58 +00:00
William Manley 5424404813 ostree-prepare-root: Error if realpath fails
I've seen it fail with musl which needs `/proc` to be mounted for it to
work.  The error messages we're rather confusing before.  At least this
now points to the right location.

Closes: #485
Approved by: cgwalters
2016-09-01 20:17:58 +00:00
William Manley 598e3240ff switchroot: Fix test-switchroot now autotools can build static
This test previously depended on manually building ostree-prepare-root.
Since 42dab85 we've been able to build static binaries with the usual
autotools build-system.  This change reflects the fact that
`ostree-prepare-root` is built into $srcdir rather than `src/switchroot`
where I was building manually.

This test now passes with `./configure --with-static-compiler=gcc` (glibc)
but still fails with `./configure --with-static-compiler=musl-gcc` (musl).

Closes: #485
Approved by: cgwalters
2016-09-01 20:17:58 +00:00
William Manley 4d3b93e2ad switchroot: Fix build on Ubuntu
Was failing with error:

    src/switchroot/ostree-prepare-root.c:30:20: fatal error: config.h: No such file or directory
    compilation terminated.

Reported by and fix provided by @gatispaeglis.

Closes: #485
Approved by: cgwalters
2016-09-01 20:17:58 +00:00
Dan Nicholson 39918179d1 build: Actually distribute man page XML source
The make substitution pattern was wrong. The source files are
"ostree.xml", not "ostree.1.xml", for instance.

Closes: #488
Approved by: cgwalters
2016-09-01 19:23:49 +00:00
Dan Nicholson 7adc943596 build: Distribute man page XML source
Without this, the manual pages can't actually be regenerated from a dist
tarball, and running make clean will remove all traces of them.

Closes: #486
Approved by: cgwalters
2016-09-01 19:03:23 +00:00
Dan Nicholson 973ec467ce build: Set --enable-man during distcheck
If xsltproc is not installed, then ENABLE_MAN will be false and the
generated man pages won't be distributed. Pass --enable-man to enforce
that the man pages will be generated and distributed.

Closes: #486
Approved by: cgwalters
2016-09-01 19:03:23 +00:00
Jonathan Lebon 3b55db9661 pull code: clean up mirrorlist hack
While converting the mirrorlist code from using GSList to GPtrArray, I
completely missed the fact that there is now a much cleaner way to do
this.

Closes: #484
Approved by: cgwalters
2016-08-31 18:54:59 +00:00
Jonathan Lebon 661e4636f5 tests: add tests for contenturl and mirrorlist
Closes: #469
Approved by: cgwalters
2016-08-31 16:52:12 +00:00
Jonathan Lebon c4c030cc79 libtest: add has_gpgme() helper function
Closes: #469
Approved by: cgwalters
2016-08-31 16:52:12 +00:00
Jonathan Lebon 157d878ce1 pull: add mirrorlist support
This commit adds mirrorlist support to the fetcher. Users can now
prepend url or/and contenturl by mirrorlist= to interpret the link as a
mirrorlist.

If an object is not found, the fetcher will automatically try the next
mirror in the order given in the list (assuming the order returned by
the server is significant).

Closes: #469
Approved by: cgwalters
2016-08-31 16:52:12 +00:00
Jonathan Lebon 9546b93382 pull: drop fetching_sync_uri
This made sense back when we used a main loop even when we needed to
fetch objects synchronously. Nowadays, we no longer actually update
progress before the FETCHING_OBJECTS phase, which is only for async
requests.

This allows us to get rid of fetch_uri_contents_membuf_sync() and to
generalize fetch_uri_contents_utf8_sync() so that it only requires a
fetcher. This will be needed later.

Closes: #469
Approved by: cgwalters
2016-08-31 16:52:12 +00:00
Jonathan Lebon bfa8eaccd3 trivial-httpd: prepend timestamp in log file
I've found this useful when monitoring multiple logs at the same time to
test the upcoming content & meta URL splitting.

Closes: #469
Approved by: cgwalters
2016-08-31 16:52:12 +00:00
Jonathan Lebon 8d9d3a1d4a pull code: support contenturl setting
Allow users to pass a --contenturl during `remote add` and store it in
the remote config.

Fish out the contenturl setting from the remote config and use it when
downloading static deltas and objects (except for commit signatures).
The idea here is that items in the trust chain (summary & sigs) can be
fetched from a more secure e.g. TLS-pinned location, while objects
themselves are fetched from another location. Once mirrorlist support is
added, this use-case will become even more advantageous.

Closes: #469
Approved by: cgwalters
2016-08-31 16:52:12 +00:00
Colin Walters dd71999dc9 Release 2016.9
Closes: #481
Approved by: jlebon
2016-08-31 16:36:19 +00:00
Georges Basile Stavracas Neto cafc517c6b repo-pull: properly store the cancellable
OSTree function ostree_repo_pull_with_options starts a
series of operations that makes heavy use of the PullData's
cancellable.

This isn't effective, however, since nowhere in the code
the OtPullData.cancellable field is set. This is visible,
for example, when trying to cancel a Flatpak pull and nothing
happens, because the cancellable is not properly passed
to the pull data.

Fix that by setting the cancellable field of the pull data. It
owns a reference for safety reasons, and unreferences it at the
end of the operation.

ostreedev/ostree#482

Closes: #483
Approved by: cgwalters
2016-08-31 15:21:06 +00:00
William Manley 1dc69dc879 switchroot: Move `path_is_on_readonly_fs` to header file
This simplifies the build system by removing the need for
`libswitchroot-mountutil.la`.

Original idea by @cgwalters in #477.

Closes: #478
Approved by: cgwalters
2016-08-30 22:41:27 +00:00
William Manley a128abd9bc switchroot: Replace custom error printing with err/warn functions from libc
The `warn()` libc extension has exactly the same behaviour as our own
`perrorv` function, but is available in (at least) glibc and musl.  As an
added bonus the similar function `err()` which will exit with an error
code afterwards.

This implementation is tidier and allows us to get rid of our own
`perrorv`.  It paves the way to removing `ostree-mount-util.c` to simplify
the build scripts.

Original idea by @cgwalters in #477.

Closes: #478
Approved by: cgwalters
2016-08-30 22:41:27 +00:00
William Manley 42dab85728 ostree-prepare-root: Allow building statically with musl
If the `--with-static-compiler=musl-gcc` configure flag is given.

ostree-prepare-root can be used as init in a system without a populated
/lib.  To support this use case we need to link statically as we will be
unable to locate libc.so at run time if it's not installed in /lib.

We support building ostree-prepare-root with a different compiler to the
rest of ostree so we can use musl rather than glibc.  This reduces the size
of the executable significantly: from ~700K -> ~30K.  We have to use
`_SCRIPTS` here to get autotools to install this as an executable but
without generating rules to make it itself which we have specified
manually.

See https://lists.gnu.org/archive/html/help-gnu-utils/2007-01/msg00007.html
for advice on using autotools in this manner.

Closes: #477
Approved by: cgwalters
2016-08-30 20:50:33 +00:00
William Manley faee3df8ae switchroot: Fix building with musl libc
POSIX and GNU define conflicting versions of `strerror_r`.  The GNU
version returns the string but doesn't necessilary write into buf.
The POSIX version writes into buf and returns the length but doesn't
necessilary append a terminate the string with a NUL if it's too long
to fit in buf.

This commit fixes building ostree-prepare-root with musl libc.  The
stripped static build with musl on my machine is 30K vs. 724K with glibc
static and 11K with glibc shared.

Closes: #477
Approved by: cgwalters
2016-08-30 20:50:33 +00:00
Colin Walters a269075724 commit: Don't delete tmp/cache dir
We hold a fd open on this, and it's basically now expected
to be immortal.  Confer that status.

This was showing up in flatpak crashers, because we'd get
an unexpected errno.

(I didn't test this fixes the crasher, but it's clearly right)

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

Closes: #476
Approved by: alexlarsson
2016-08-29 17:30:15 +00:00
Colin Walters 8ece4d6d51 sysroot: Add a flag to suppress post-deploy cleanup
I noticed seeing the output of `prune` twice in rpm-ostree, and had
always wondered why.  When reading the rpm-ostree code to fix
something else, reasons, I noticed the reason - we were pruning once
here, and then once after rpm-ostree regenerates its "base" refs.

There's no reason to clean twice, so let's add a flag so rpm-ostree
can suppress doing it inside libostree.

Closes: #474
Approved by: giuseppe
2016-08-29 07:45:24 +00:00