Commit Graph

1838 Commits

Author SHA1 Message Date
Giuseppe Scrivano
7ebf7676cb Fix make distcheck
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Colin Walters
5b4500faf6 pull: (trivial) Fix English in function name
s/writed/written/
2015-01-25 09:14:21 -05:00
Colin Walters
94e2ac0253 Release 2015.3 2015-01-23 14:54:38 -05:00
Colin Walters
6ce80f9685 Explicitly label .origin files as configuration
subscription-manager has a daemon that runs in a confined domain,
and it doesn't have permission to write usr_t, which is the default
label of /ostree/deploy/$osname/deploy.

A better long term fix is probably to move the origin file into the
deployment root as /etc/ostree/origin.conf or so.

In the meantime, let's ensure the .origin files are labeled as
configuration.
2015-01-23 12:44:06 -05:00
Colin Walters
8f4999c854 build: Add --disable-static-deltas
Since they're unstable, we want to allow organizations shipping ostree
now to be future proof against any changes.
2015-01-22 21:21:34 -05:00
Colin Walters
f2e4830409 pull: Further extend static delta progress
With deltas, we have an accurate total size, among other things.
2015-01-22 09:07:13 -05:00
Colin Walters
e40b86221a pull: Distingiush delta pulls from loose better 2015-01-22 09:07:13 -05:00
Colin Walters
549f1ec7df commit: Fix segfault on async writes if object exists and checksum requested
If an object already existed and we somehow tried to pull it, the
caller would still expect a returned checksum.

This appears to happen with static deltas for some reason; we might be
including duplicate metadata objects.  Regardless, this is a bug that
should be fixed.
2015-01-21 21:17:47 -05:00
Colin Walters
28e5e6f27f traverse: Fix transfer on hash table
Otherwise, bindings try to erroneously unref the key/values as well.
2015-01-21 11:59:32 -05:00
Colin Walters
8195fd18e2 deltas: Use trusted writes
We have a chain of checksums from the root up until here.  While doing
checksums of the objects individually would be a good redundancy check
for test cases and the like, when doing a pull there's no good reason
to burn cycles on SHA256.
2015-01-20 23:28:26 -05:00
Colin Walters
6d1de23f87 deltas: Drop async content writes
This caused deadlocks and/or EMFILE due to the interaction between
threads and fds.  What we really want here is a better pull-based
model for parsing content objects.

Another idea would be to change static deltas so that content objects
have a special opcode that includes their metadata first, and then do
rollsums etc. only over actual content.
2015-01-20 23:21:26 -05:00
Colin Walters
d49fc876bb deltas: Unlink temporary metadata files before processing
Leaking them is bad.
2015-01-20 23:16:30 -05:00
Giuseppe Scrivano
4991e9ab6a static-delta: limit the number of writes in process to 1
This will avoid too many open files at the same time that could cause
an EMFILE error.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit bc092b06f0e34e93f7d6102957bf55fd7ffd1b9e)
2015-01-20 09:51:02 -05:00
Alexander Larsson
638431045c static delta generation: Separate max chunk size from min fallback size
There is no particular reason these have to be the same.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
2015-01-20 14:45:45 +01:00
Colin Walters
6bbfa5f85a admin: Add set-origin command
See projectatomic/rpm-ostree#42 for rationale. There are two high
level use cases:

 - If the OS comes unconfigured, this is a way to point it at a repo of your choice.
 - To switch between repositories while keeping the same branch easily.
2015-01-19 13:55:20 -05:00
Colin Walters
886913abdc sysroot: Add ostree_sysroot_write_origin_file() API
We want to allow admins to change the origin file without doing a new
deployment, so this will be part of a future "admin set-origin"
command.
2015-01-19 13:45:11 -05:00
Colin Walters
1d216a8c60 cmdline: (cleanup) Add internal helper to parse key=value options
This will be used by a later "ostree admin set-origin" as well.
2015-01-19 13:45:11 -05:00
Colin Walters
0eac91a253 admin: (cleanup) Add internal API to find a deployment given an index
At some point, we might want to expose a uniform way to refer
to deployments by an index.  At the moment undeploy is the only
command that does.

I plan to introduce another command which optionally takes an index,
so prepare a helper function for this.
2015-01-19 13:45:11 -05:00
Giuseppe Scrivano
ce957f8649 editor: honor arguments environment variable
My EDITOR looks like "EDITOR=emacs -nw", ensure that it is honored.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-16 09:21:30 -05:00
Giuseppe Scrivano
f2ae405f9f static-delta: do not accept both --from=REV and --empty for generate
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-15 22:54:56 -05:00
Matthew Barnes
4841d9a935 doc: Manpage love for static-delta command 2015-01-15 15:49:49 -05:00
Colin Walters
2f9567ad56 deltas: Use *at() for writes
Yet another GFile* user goes away in a performance sensitive path.
2015-01-14 22:29:45 -05:00
Colin Walters
ebd03216a1 pull: Delete processed delta parts
Otherwise they stay around until a much later GC.
2015-01-14 22:18:00 -05:00
Colin Walters
9020fe2547 Change OstreeFetcher to be dirfd-relative
This is a noticeable cleanup, and fixes another big user of GFile* in
performance/security sensitive codepaths.

I'm specifically making this change because the static deltas code was
leaking temporary files, and cleaning that up nicely would be best if
we were fd relative.
2015-01-14 22:12:08 -05:00
Colin Walters
a7300a828d core: Add an API to parse a content file using dirfd relative lookup
This will be used for a later change to use openat() for the fetching
code.  Note that we drop the code to use mmap() - it was an attempt to
avoid keeping a fd open, but we do correctly close anyways.
2015-01-14 22:03:02 -05:00
Colin Walters
9b6b352181 checksumutils: Support splicing stream to arbitrary checksum type
This will be used later by the metalink code; you can splice with a
NULL output stream to an arbitrary GChecksum instead of just a SHA256
one.
2015-01-14 22:01:54 -05:00
Colin Walters
92c338de74 deltas: (trivial) delete some debugging prints
They create too much noise.
2015-01-14 11:38:10 -05:00
Alexander Larsson
5b721a5b08 Allow creating and pulling static deltas starting from "empty"
You create these with something like:
  ostree static-delta generate --empty --to=master

These will be automatically used during pull if no previous revision
exists in the target repo.

These work very much like the normal static deltas except they
are named just by the "to" revision. I.e:

deltas/94/f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d

for a from-scratch to 94f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d delta.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
2015-01-14 14:43:32 +01:00
Alexander Larsson
82ed6c43ed Fix ostree_repo_list_static_delta_names
The current layout uses a prefix of two bytes as the initial dir
and a second directory inside that with the superblock. This
updates the list code to handle that.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
2015-01-14 14:36:35 +01:00
Colin Walters
97fbd872ae deltas: Do not traverse all objects, only both commits
That's the way they were designed.  We really don't want to include
all intervening objects.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
2015-01-13 21:32:39 -05:00
Colin Walters
019635d9c2 repo: Fix bare-user file loads
Regression from 86764dbf00

This function is kind of fiendish now that we have 3 cases, each of
which want to be optimized somewhat to only load what's necessary
(e.g. don't open the file if we don't have an output for stream
requested).

Clean things up so that BARE_USER and BARE are separate conditionals
that share as much as possible, and fix the bug that asserted we
were in BARE mode.

I tested this by running test-basic-user.sh by hand.
2015-01-12 12:43:33 -05:00
Colin Walters
25a5909500 repo: Deduplicate some code in load_file 2015-01-12 12:43:33 -05:00
Colin Walters
865fab7653 Release 2015.2 2015-01-12 12:43:03 -05:00
Colin Walters
e3f9f331a2 Two 32 bit compilation fixes 2015-01-12 12:43:03 -05:00
Matthew Barnes
6ff841d3b0 repo: Report metadata fetch progress separately
Partially resolves https://bugzilla.gnome.org/740276
2015-01-12 11:21:18 -05:00
Matthew Barnes
4b5b450d5c pull: Prioritize fetching metadata objects over content objects 2015-01-11 18:48:21 -05:00
Matthew Barnes
5c26e392ec fetcher: Add a priority value to async requests 2015-01-11 18:48:21 -05:00
Colin Walters
a9532bc34f Release 2015.1 2015-01-08 13:00:43 -05:00
Colin Walters
911eafd0d8 Bump libgsystem dependency 2015-01-08 13:00:27 -05:00
Colin Walters
f23f556f03 checkout: Add --fsync=false
Some use cases for checkouts don't need to fsync during checkout.
Installer programs for example will just do a global fsync at the end.

In the future, the default "ostree admin" core could also be
rearchitected to only do a transaction commit right before reboot, and
do the fsync then.

https://bugzilla.gnome.org/show_bug.cgi?id=742482
2015-01-07 11:41:46 -05:00
Colin Walters
687a6f8314 Add internal ot_openat_read_stream() helper
We had two cases which were creating an input stream using openat().
2015-01-07 08:41:45 -05:00
Colin Walters
026c5c60d3 Use *at() functions for native filesystem commits
This is just an efficiency optimization.  We're getting fairly close
to all of the hot code paths using `*at()`.

Note that we end up maintaining a half-duplicate code path set here,
because we still need to support commits from an arbitrary GFile *,
which in a possible common case is an OSTree commit.

I think it's worth it though.
2015-01-06 22:43:14 -05:00
Colin Walters
cf8d6848b3 refs: Use G_IO_ERROR_NOT_FOUND when a ref lookup fails
rpm-ostree had code to check for this, which didn't actually work.

I don't see a no backwards compatibility concern in changing this, as
it's unlikely a caller would try to sensibly disambiguate FAILED.
2015-01-06 18:47:04 -05:00
Colin Walters
86764dbf00 repo: Improve ostree_repo_load_file() to use *at() for xattrs
We were already using openat() for the contents, but not the xattrs.
Now that libgsystem 2014.3 has gs_fd_get_all_xattrs(), make use of it.

Clean things up a bit so we only open the fd once.
2015-01-06 16:47:03 -05:00
Colin Walters
6dab41ba77 deploy: Update to use latest libgsystem API 2015-01-06 12:46:21 -05:00
Colin Walters
01f6d68c60 deploy: Actually copy xattrs of modified config files
Regression from 7b01bd2e43
where we stopped using g_file_copy() - we lost copying xattrs.

This specifically breaks /etc/shadow SELinux labeling, with the
obvious bad consequences.

https://bugzilla.gnome.org/show_bug.cgi?id=742289
2015-01-06 10:55:44 -05:00
Matthew Barnes
7727fe84d9 Require a PREFIX when deleting refs
Also fix the "ostree refs" help output to not give the impression that
the --delete option takes its own PREFIX argument.

https://bugzilla.gnome.org/show_bug.cgi?id=742454
2015-01-06 10:33:12 -05:00
Colin Walters
1e8e070102 Port to libgsystem errno API, hard depend on 2014.3
This is long overdue to make it to libgsystem.  Update our dependency.
2015-01-04 21:17:11 -05:00
Colin Walters
1bcc7a8e3a Merge branch 'giuseppe/staticdeltas' of https://github.com/giuseppe/ostree 2014-12-19 16:31:31 -05:00
Colin Walters
125889fd7e Enforce 'rdev' (device file major/minor) is 0
Historically OSTree supported device files, but it wasn't useful, and
added attack surface.  Support was removed in

https://git.gnome.org/browse/ostree/commit/?id=62a896350bd54bff5a9413d2ee0fad7ff4364f9a

Perform a further cleanup by enforcing internally that the device
major/minor must be 0.

Conflicts:
	src/libostree/ostree-core.c
2014-12-19 10:20:05 -05:00