Commit Graph

1622 Commits

Author SHA1 Message Date
James Antill 54c271001f commit: Hide --disable-fsync option, add --fsync which takes a boolean
Per discussion on mailing list, the --disable-fsync has a
double-negative thing going on; --fsync=false is clearer.
2014-06-18 17:33:03 -04:00
Anne LoVerso f2f3b67804 cat: Fix a typo in usage error printout 2014-06-17 16:06:15 -04:00
Colin Walters 6a5e66b152 pull: Support --mirror option
There's several use cases for calling into ostree itself to do
mirroring, instead of using bare rsync.  For example, it's a bit more
efficient as it doesn't require syncing the objects/ directory.

https://bugzilla.gnome.org/show_bug.cgi?id=728351
2014-06-16 17:14:13 -04:00
Colin Walters 4ac27caefd log: Print a friendly error if we haven't downloaded the complete history
For the local repository on the system, it's not the usual case to
have the complete compose history.  Rather than erroring out, provide
a bit more friendly message.

https://bugzilla.gnome.org/show_bug.cgi?id=731538
2014-06-11 16:41:35 -04:00
Colin Walters a5b2a233e8 Release 2014.5 2014-06-09 18:39:14 -04:00
Colin Walters e31daf448a libostree: Silently ignore EPERM when setting EXT2_IMMUTABLE_FL
In the case of running ostree as non-root on a regular filesystem (not
tmpfs which doesn't support immutable), we should just silently do
nothing if we encounter EPERM.  Cache the result to avoid spam in
strace.

https://bugzilla.gnome.org/show_bug.cgi?id=728006
2014-06-09 14:44:17 -04:00
Colin Walters 24c64d6b4f libostree: Make OstreeFetcher explicitly private
Per previous commit.  We're not attempting to export an HTTP to
clients, the high level API is ostree_repo_pull().

https://bugzilla.gnome.org/show_bug.cgi?id=731369
2014-06-09 14:04:53 -04:00
Colin Walters 4ce93db595 libostree: Make OstreeTlsCertInteraction explicitly private
Similar to previous commit, this should be private.

https://bugzilla.gnome.org/show_bug.cgi?id=731369
2014-06-09 14:04:53 -04:00
Colin Walters 9f734494ff libostree: Make OstreeLibarchiveInputStream explicitly private
We weren't installing the headers, but at the moment all symbols
starting with ostree_ were being exported.  Fix that by prefixing
non-static symbols with '_'.

https://bugzilla.gnome.org/show_bug.cgi?id=731369
2014-06-09 14:04:53 -04:00
Colin Walters 51bf1fab0f repo: Support fsync=false configuration
See rationale in the updated docs.  Basically developer use cases as
well as UPS-backed servers.
2014-06-05 17:35:50 -04:00
Vadim Rutkovsky ef00572999 Honor disable_fsync during checkout also
Finally, fsync to ensure all entries are on disk, unless disabled.
 We support disabling this for cases like server-side buildroot
 construction where we don't need to be robust against power loss
2014-06-04 16:14:46 +02:00
Colin Walters cb43d2942f ostree-remount: Check for / being *mounted* read-only, not necessarily writable
The previous S_IMMUTABLE commit broke ostree-remount; / is now not
actually writable.  All we really wanted to know though was whether it
was *mounted* writable, so check that via statvfs() which is cleaner
anyways (i.e. not via access() which kernel people hate).

https://bugzilla.gnome.org/show_bug.cgi?id=728006
2014-06-03 17:38:00 -04:00
James Antill f22fa92aef Add --disable-fsync option to both commit and pull (non-local)
On some storage configurations, fsync() can be extremely expensive.
Developers and users with slow hard drives may want the ability to opt
for speed over safety.

Furthermore, many production servers have UPS and stable kernels, and
the risk of not fsync'ing in that scenario is fairly low.  These users
should also be able to opt out.
2014-06-03 15:41:02 -04:00
Colin Walters b4d21e9406 deploy: Set the immutable bit on the deployment root
This prevents people from creating new directories there and expecting
them to be persisted.  The OSTree model has all local state to be in
/etc and /var.

This introduces a compile-time dependency on libe2fsprogs.

We're only doing this for the root directory at the moment.

https://bugzilla.gnome.org/show_bug.cgi?id=728006
2014-06-03 13:41:48 -04:00
Colin Walters 93c68083ac Move Makefile.dist-packaging under packaging/ 2014-06-02 15:27:40 -04:00
Colin Walters 47610b45c2 Limit metadata to 10 MiB
If fetching GPG-signed commits over plain HTTP, a MitM attacker can
fill up the drive of targets by simply returning an enormous stream
for the commit object.

Related to this, an attacker can also cause OSTree to perform large
memory allocations by returning enormous GVariants in the metadata.

This helps close that attack by limiting all metadata objects to 10
MiB, so the initial fetch will be truncated.

But now the attack is only slightly more difficult as the attacker
will have to return a correctly formed commit object, then return a
large stream of < 10 MiB dirmeta/dirtree objects.

https://bugzilla.gnome.org/show_bug.cgi?id=725921
2014-05-27 14:15:27 -04:00
Colin Walters 6002356747 fetcher: Unref pending result when completing
Otherwise we were just leaking it.

https://bugzilla.gnome.org/show_bug.cgi?id=725921
2014-05-27 12:01:14 -04:00
Colin Walters f1ccaa581e repo: Don't require a txn for writing
The current "transaction" symlink was introduced to fix issues with
interrupted pulls; normally we assume that if we have a metadata
object, we also have all objects to which it refers.

There used to be a "summary" which had all the available refs, but I
deleted it because it wasn't really used, and was still racy despite
the transaction bits.

We still want the pull process to use the transaction link, so don't
delete the APIs, just relax the restriction on object writing, and
introduce a new ostree_repo_set_ref_immediate().
2014-05-26 18:49:17 -04:00
Colin Walters a4d01976bb repo: Only load /etc/ostree/remotes.d for system repo
They shouldn't be loaded for random test/personal repositories.  Doing
so triggers another bug in that we return them from
ostree_repo_get_config() when then causes clients to write them out
permanently to disk with ostree_repo_write_config().  This caused test
suite failures.
2014-05-26 18:38:35 -04:00
Colin Walters 62c2a204c9 trivial: commit: Fix docstring typos 2014-05-26 17:57:36 -04:00
Colin Walters 78726244a0 deploy: Convert remaining g_print() to systemd journal messages
These bits should be logged more sanely.
2014-05-24 13:19:29 -04:00
Colin Walters bf37a9c741 deploy: Remove deployment root print
It doesn't look very professional; in the future though we should have
a progress bar here or something.
2014-05-24 12:30:56 -04:00
Colin Walters fc11c8673f trivial: TODO: Add link sizes/progress bar 2014-05-23 07:59:35 -04:00
Colin Walters 1a6a8dcb83 trivial: TODO: Add link for http unprivileged 2014-05-23 07:57:23 -04:00
Colin Walters ac56501dfa packaging: BR libgsystem 2014-05-22 22:51:21 -04:00
Colin Walters 19abd8277f selinux-ensure-labeled: Support no arguments to just traverse deployment root
This makes it easy to use for the case where rpm-ostree-toolbox is
injecting systemd services into the deployment root, and we don't
actually need to traverse the whole FS.
2014-05-22 22:51:21 -04:00
Colin Walters a864190a04 admin switch: Allow switching just remote names
This is a followup to the previous commit; for the installation media
case we want to keep the current origin ref, and only switch remotes.
2014-05-15 08:58:44 -04:00
Colin Walters 24e1bf2552 admin switch: Support switching remotes as well
Say I have an installation from CDROM; the remote name may be
"installmedia" or something like that.  We want to allow also
switching remotes.
2014-05-12 17:31:34 -04:00
Colin Walters 7ccfc93f71 build: Add missing DESTDIR
Hooray for read-only bind mounts and building as non-root.
2014-05-09 09:07:00 -04:00
Colin Walters f47a20fb81 Support /etc/ostree/remotes.d
For many OS install scenarios, one runs through an installer which may
come with embedded data, and then the OS is configured post-install to
receive updates.

In this model, it'd be nice to avoid the post-install having to rewrite
the /ostree/repo/config file.

Additionally, it feels weird for admins to interact with "/ostree" -
let's make the system feel more like Unix and have our important
configuration in /etc.

https://bugzilla.gnome.org/show_bug.cgi?id=729343
2014-05-08 18:59:24 -04:00
Owen W. Taylor 466671407d trivial-httpd: flush after writing the port to stdout
The option --port-file=- is most useful when the stdout of the daemon
is programatically redirected and not going to a terminal. The
flush-after-a-line behavior of stdout is specific to terminals, so
we need an explicit flush.

https://bugzilla.gnome.org/show_bug.cgi?id=729609
2014-05-05 19:02:59 -04:00
Colin Walters 25ad4a9f65 pull: Add tls-client-cert-{path,key} (if we have new enough libsoup)
This is an actually working version of client-side certificates.
Depends on:
See: https://bugzilla.gnome.org/show_bug.cgi?id=334021

We detect whether libsoup is new enough for this.

https://bugzilla.gnome.org/show_bug.cgi?id=729356
2014-05-01 17:13:13 -04:00
Colin Walters 64b4ec6ef0 Revert "pull: Add tls-client-cert-{path,key}"
This reverts commit 94f9ee7bce.
Doesn't actually work, see
https://bugzilla.gnome.org/show_bug.cgi?id=334021
2014-05-01 10:23:11 -04:00
Colin Walters 94f9ee7bce pull: Add tls-client-cert-{path,key}
These can be used to present a client certificate when making requests
to a repository.
2014-05-01 07:57:06 -04:00
Colin Walters 7cc4a20f3b pull: Correctly handle error state when fetching optional data
For the static deltas work, we're using the already-extant internal
API to perform a HTTP fetch for optional data - static deltas are
optional.

Except that we didn't correctly unset the error if we were doing an
optional fetch and the data wasn't found.
2014-04-29 10:59:57 -04:00
Colin Walters 626fc8519b pull: Stay in mainloop if we're synchronously fetching URI
The static deltas work will be doing some synchronous fetching even
after refs are downloaded.
2014-04-29 10:59:57 -04:00
Colin Walters 006e8f0073 deltas: Link to liblzma, add internal API to use it
For future static deltas work, we'll be linking to liblzma.  Since
it's fairly widespread, let's just make it a hard dependency.
2014-04-29 10:59:57 -04:00
Colin Walters f040c02048 libostree: Add _finish() API to async progress
Since OstreeAsyncProgress queues to the mainloop, we might "lose" the
last message.  Give callers a way to force a flush.
2014-04-29 10:59:57 -04:00
Colin Walters 349083194d otutil: Correctly add ref to bytes when creating GVariant
This one went undiscovered for a while because it turned out we
weren't using it...
2014-04-29 08:53:28 -04:00
Colin Walters 959db9f0de core: Add _STRING variants of GVariant object formats
For the static deltas work, we're going to embed a commit in the delta
superblock, so we need a format string without the G_VARIANT_TYPE().
2014-04-29 08:51:00 -04:00
Colin Walters 021c4ee9d3 show: Fix segfault if we can't find an object
We need to use the original rev here.
2014-04-29 07:42:30 -04:00
Colin Walters 5346e0615b libotutil: Fix two bugs in usage of posix_fallocate()
* It's invalid to call it with a size of 0, so don't do that.

* posix_* apparently don't set errno.  So capture the return value and
  use that.
2014-04-29 07:40:25 -04:00
Colin Walters 22ab7b3e79 core: Use posix_fallocate() when writing objects
This helps ensure the filesystem allocates space efficiently.
2014-04-28 19:42:12 -04:00
Cosimo Cecchi 4903fba08c os-init: don't create /var/log/journal on deploy
Leave the policy of whether to persistently store journal logs to the
system integrator when the default journald configuration is in use.

https://bugzilla.gnome.org/show_bug.cgi?id=728762
2014-04-25 16:47:02 -04:00
Colin Walters 32663a5a50 build: Remove --enable-embedded-dependencies
This is going to bitrot too much; we'll figure out a better way to do
this when someone if a RHEL6 port ever happens.  Probably Software
Collections.
2014-04-22 09:08:35 -04:00
Colin Walters 7cb7d8f741 Release 2014.4 2014-04-13 10:50:27 -07:00
Colin Walters 2c5d726076 deploy: fsync() copy of /etc
This unfortunately requires reimplementing gs_shutil_cp_a(), except
while we're here, we also use the *at calls.
2014-04-11 18:43:58 -04:00
Colin Walters b423d9e9cf deploy: fsync() kernel/initramfs and bootloader config parent directories
Ensure they've hit disk.
2014-04-11 18:43:27 -04:00
Colin Walters 646c8be8dc deploy: fdatasync() bootloader configuration files
Yet more data we're writing out that needs to be sync'd.
2014-04-11 18:43:27 -04:00
Colin Walters 18aaa49724 libotutil: Make use of dirfd-relative API in ot_gfile_replace_contents_fsync()
It's just more efficient.
2014-04-11 18:43:27 -04:00