Commit Graph

2024 Commits

Author SHA1 Message Date
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
Colin Walters c4efbf6718 core: Deduplicate code converting struct stat -> GFileInfo
We were doing the same thing in a number of places, make a helper
function.
2014-12-19 10:18:59 -05:00
Matthew Barnes 880328ba03 Add ostree_repo_pull_default_console_progress_changed()
Replaces ot_common_pull_progress() in ostree binary, so it can be shared
with rpm-ostree.
2014-12-18 21:31:53 -05:00
Colin Walters abb88336b3 repo: Minor cleanup: Move size generation code initialization
It has a global effect, so do it in the entrypoint.
2014-12-18 18:06:56 -05:00
Giuseppe Scrivano 6e60c05d2f Remove unused variable warning 2014-12-18 12:48:47 +01:00
Giuseppe Scrivano ed2b56a430 fix --help for static-delta
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-12-18 12:48:47 +01:00
Colin Walters 5c47389243 test-rollsum: Process all input, print more statistics
Copying the bup code, we need to loop over all chunks even after
hitting the rollsum returning 0.

Also print more statistics.
2014-12-18 12:48:47 +01:00
Colin Walters ca678224be Static deltas support
https://bugzilla.gnome.org/show_bug.cgi?id=721799
2014-12-18 12:48:47 +01:00
Giuseppe Scrivano a23b3b332e Revert "ostree-repo-pull: Remove currently #if 0 static delta code"
This reverts commit 1c2e20af25.
2014-12-18 12:48:47 +01:00
Matthew Barnes 880940f93b doc: Update gtk-docs 2014-12-17 19:34:17 -05:00
Matthew Barnes e54d48be39 Add "ostree remote list" command
Lists available remote names.
2014-12-17 16:05:53 -05:00
Matthew Barnes 39be27fc93 Add ostree_repo_remote_list()
Lists available remote names.
2014-12-17 16:05:37 -05:00
Colin Walters fd07a6a862 Release 2014.13 2014-12-17 11:35:52 -05:00
Colin Walters d3edda5edc basic-test: Fixup mtime check for bare-user
https://bugzilla.gnome.org/show_bug.cgi?id=741662
2014-12-17 11:34:10 -05:00
Colin Walters 9dadebb501 tests: Fix two bugs in tests revealed by new remote changes 2014-12-17 10:43:01 -05:00