Commit Graph

990 Commits

Author SHA1 Message Date
Colin Walters 8c31e6fda7 tests: Add xattr test case
Since it was broken up until now for multiple attributes =(
2013-08-14 15:07:14 +02:00
Stef Walter 860cc11160 Fix crasher when running 'ostree cat'
Cause was a buffer read overrun.

https://bugzilla.gnome.org/show_bug.cgi?id=705964
2013-08-14 14:53:17 +02:00
Stef Walter 97947373ee Add some verbose log output when xattr functions fail
If any of the system xattr functions fail, clearly write out the
reason in the verbose log output.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
2013-08-14 07:50:49 +02:00
Stef Walter 3f9c150b77 Don't use XATTR_REPLACE with lsetxattr()
If we pass XATTR_REPLACE then the attribute must already exist, which
is not our intent. Passing zero creates the attribute if necessary,
or replaces it when it already exists.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
2013-08-13 15:42:54 +02:00
Stef Walter c246c4194f Properly separate sorted xattr names
We expect to be handling a string delimited by \0 characters, as
returned by llistxattr(). So stick to that behavior here.

https://bugzilla.gnome.org/show_bug.cgi?id=705893
2013-08-13 15:42:54 +02:00
Stef Walter 0111ec1307 Add some verbose logging to 'ostree commit'
This is so we can see near which file we fail when 'ostree commit'
falls over.

https://bugzilla.gnome.org/show_bug.cgi?id=705905
2013-08-13 15:38:51 +02:00
Stef Walter 462bcd86de Add --verbose and -v arguments to ostree for details
Use the GLib debug mechanism to handle verbose output.

https://bugzilla.gnome.org/show_bug.cgi?id=705905
2013-08-13 15:37:12 +02:00
Stef Walter 1f8c7a2524 Better parsing for global ostree options
* Specifying global options after the command for a more natural:
   # ostree commit --repo=/path/to/repo ...
 * Support asking for --help without --repo
   # ostree commit --help
 * Support short form of -h
 * Support specifying --repo without equals sign
   # ostree --repo /path/to/repo commit ...
 * Support global --help and -h
   # ostree --help
 * Ditto for ostree admin sub commands
 * Removed some leaky code

https://bugzilla.gnome.org/show_bug.cgi?id=705903
2013-08-13 14:28:36 +02:00
Colin Walters 44012dbdd9 Update libgsystem
With fd leak fix.
2013-08-07 10:36:52 +02:00
Colin Walters 71c4ea67f7 core: Clean up temporary file creation
Use new libgsystem API, don't expose the repo's tmpdir.
2013-08-06 23:58:29 +02:00
Colin Walters 9e480cd6a9 core: Finish making object path API private
This allows us to more easily change the internals later.
2013-07-31 03:48:33 -04:00
Colin Walters 0dec1b287c core: Reduce API surface for file access
This function was only used by internals, make it private.
2013-07-31 00:35:53 -04:00
Colin Walters 8d5b8dd740 admin: Clean up builtin prototype
Pass through GCancellable, and just use GFile *sysroot, since that's
all OtAdminBuiltinOpts was.
2013-07-29 18:44:41 -04:00
Colin Walters 760b866104 main: Assume / for ls if no path given
Since it just is kind of a sane default.
2013-07-27 20:12:07 -04:00
Colin Walters 7c5c3f2af8 core: Fix all introspection warnings
Still lots more docs to write and API to cleanup, but this is better.
2013-07-27 10:13:30 -04:00
Colin Walters a5d43bb959 Install a shared library
This required a fair bit of surgery because previously ostree.h
included otutil.h, but that's supposed to be a private library.
2013-07-26 19:25:07 -04:00
Colin Walters 74b2c7aab3 core: Work around libguestfs/FUSE issue with setuid binaries
For some reason, the setuid bits are being stripped.  This
workaround is enough for now.
2013-07-26 14:48:15 -04:00
Colin Walters 5aea9db3f2 Add API to retrieve statistics from transactions, use it in commit
It's just interesting to see =) This is also kind of prototyping out
some more "structured" output.
2013-07-25 19:23:25 -04:00
Colin Walters 8aa48a5f9c fsck: Fix crash on repositories with < 10 objects 2013-07-25 12:06:21 -04:00
Colin Walters 2bcb024824 pull: Tweak status line again, do what git does
Almost, we don't have bytes transferred.  And we lie about percentages
since as metadata comes in the total number of objects to fetch goes
up.
2013-07-24 18:20:19 -04:00
Colin Walters 89430bbe71 main: Fix previous commit to find repo in cwd over /ostree/repo
The tests when run inside gnome-ostree broke, and this is better
behavior.
2013-07-24 14:46:53 -04:00
Colin Walters 187c75eae5 main: Support using repo from current directory
$ cd repo
$ ostree ls foo /
...

Can be a lot more convenient than typing --repo=repo a lot.
2013-07-24 14:05:12 -04:00
Colin Walters c9b61cbfee Drop support for related objects and metadata in commit objects
While the actual commit object format is presently the same, for a
number of reasons we'd like to change it fairly radically.  Among
other things, we need to drop our a{sv} types in objects, to protect
against GVariant changing format.

Since now gnome-ostree now longer uses related objects, and nothing
ever used metadata, just drop them both.
2013-07-24 12:59:27 -04:00
Colin Walters 1e7c0bb70b main: Fix an uninitialized variable 2013-07-24 09:36:51 -04:00
Colin Walters 688d8f176b pull: Always scan for commit object, even if ref is unchanged
If the admin encounters corruption and does:

$ ostree admin fsck --delete

We want them to be able to recover the objects easily from the
network; with this patch, they do:

$ ln -s dummyvalue /ostree/repo/transaction
$ ostree refs --delete remotename:branchname
$ ostree pull remotename

This patch avoids the need for the refs --delete; we might as well
force scan the commit, and with this patch we still print that it
changed.
2013-07-23 19:36:15 -04:00
Colin Walters 3ea62abe75 main: ls: Behave like standard Unix "ls" with directories
Default to listing directory contents, add -d/--dironly to suppress
this.
2013-07-23 18:41:03 -04:00
Colin Walters 4de1d51266 main: Squash a compiler warning 2013-07-23 18:34:34 -04:00
Colin Walters 7b056e3c50 main: Consistently use "opt_" as a prefix for option local variables
This makes it easier to find where we're using global state, which is
useful when refactoring code into libostree.
2013-07-23 18:33:29 -04:00
Colin Walters b6ab480272 main: commit: Drop broken --parent option
No idea why we had this, it didn't do anything in the current code.
Noticed while doing other refactoring.
2013-07-23 18:24:52 -04:00
Colin Walters 3b9da094d8 main: Drop log builtin
We may revive this later, but commits in their current form aren't
very useful for humans to read, so it doesn't make sense to have a
tool to show a history of useless stuff.

More interesting things are diffs between commits, object statistics,
etc.
2013-07-23 18:19:14 -04:00
Colin Walters ea914e7e49 main: pull: Reduce the status line length a bit
Drop "objects" where it's obvious [ to me anyways =) ], and drop the
bytes transferred since our math was off, and the HTTP status kind of
shows that.
2013-07-23 17:29:46 -04:00
Colin Walters 3d7bff2d41 admin: Add an "undeploy" command
Otherwise it's really easy to keep accumulating deployments.  Also, we
may want to run this after rebooting, so we're back down to one
operating system.
2013-07-23 09:19:24 -04:00
Colin Walters 67823beb1f core: Don't strip setuid bits when creating files
This ugly regression occurred because I overlooked the fact that our
chown() invocation would strip off setuid.
2013-07-18 14:23:55 -04:00
Colin Walters 3e2d2f3e9e main: show: Don't strip mode, let's see the whole thing
Just useful for debugging.
2013-07-18 14:23:12 -04:00
Colin Walters f0c5a5f334 main: Add --delete option to fsck
This is useful for clearing out all corrupted objects locally.
2013-07-18 12:09:44 -04:00
Colin Walters c8801ae489 main: Clean up fsck code: honor --quiet, warn (but continue) on missing objects
When we make fsck --delete work again, it will be convenient to
continue on missing objects.
2013-07-18 09:05:58 -04:00
Colin Walters a4f5ad8542 Update libgsystem 2013-07-17 23:00:03 -04:00
Colin Walters 41cb37a858 main: Make "ostree show" actually useful for files
We already have "ostree cat" for files, here we want to see a dump of
the metadata.
2013-07-17 21:10:04 -04:00
Colin Walters 1b3ef57cf4 diff: Add --stats option
This a neat way to see how many objects are shared between two
commits.
2013-07-17 19:20:53 -04:00
Colin Walters a3b6401788 main: Add --link-checkout-speedup option to commit
And disable devino scan by default.  For the gnome-ostree build case,
our commits are from "make install DESTDIR=", so they won't be
hardlinks into the repo.  In that case, particularly as the repository
size grows, the cost of building up the devino -> checksum mapping
becomes a problem.

The compose step will use this option though.
2013-07-17 19:20:53 -04:00
Colin Walters aac52cb9f7 main: Move GCancellable to toplevel
This is just cleaner, and makes the builtins slightly more of a
library, which in turn makes it easier to turn them into real API.
2013-07-16 18:13:39 -04:00
Colin Walters 272274f0af prune: Don't fail if a to-be-pruned object doesn't exist
Previously, if a prune was interrupted, further attempts would fail.
It's just better to silently continue here.
2013-07-16 10:01:58 -04:00
Colin Walters 62a896350b Drop support for fifos and devices
While the first was useful way back in the day when we were importing
Debian bits and /sbin/init was expecting to find /dev/.initctl as a
named pipe, that's no longer an issue with systemd since it uses
dynamic Unix sockets.

Likewise, character and block devices in /dev are now dynamically
created by the devtmpfs from the kernel.

Less complexity and code here if we just support directories, regular
files, and symbolic links.
2013-07-16 09:35:44 -04:00
Colin Walters 8724565291 core: Drop a leftover unnecessary #define _GNU_SOURCE
We now use AC_USE_SYSTEM_EXTENSIONS.
2013-07-16 09:22:42 -04:00
Colin Walters 444234e7db core: Use gsystem API for generating temporary names
Drops duplicated code.
2013-07-16 08:51:53 -04:00
Colin Walters acdf1ca4fe core: Use gs_file_create()
This allows us to drop a chmod() invocation, since the regular file
path was the only thing that didn't handle mode.
2013-07-16 08:51:53 -04:00
Colin Walters ed55998f36 Update libgsystem 2013-07-16 08:51:53 -04:00
Colin Walters fb93b95807 admin: Rename prune -> cleanup, avoid doing repo prune twice
Calling it "cleanup" is better since it does more than repo pruning.

We were also doing a prune twice; ot_admin_cleanup() already does one,
so drop the bits to do it in cleanup.c.
2013-07-15 16:13:12 -04:00
Colin Walters d5f1ce4e17 admin: Initialize sysroot to / by default, not garbage from the stack
Oops.
2013-07-11 17:29:04 -04:00
Colin Walters 60f5183298 admin status: Print out origin too
This is useful data.
2013-07-11 17:07:14 -04:00
Colin Walters e95935a3f6 main: Also make ostree admin foo --help work
A followup for the previous commit.
2013-07-10 18:42:58 -04:00
Colin Walters b7460cf0b6 main: Only parse options in subcommands
This makes e.g. "ostree commit --help" work, which is really good.
2013-07-10 18:23:52 -04:00
Colin Walters be2bebaf3e main: Don't look for /sysroot/ostree too
No longer necessary now that we expect OS/ trees to have
/ostree -> /sysroot/ostree.
2013-07-10 18:13:55 -04:00
Colin Walters 124416d832 Use AC_USE_SYSTEM_EXTENSIONS instead of #define _GNU_SOURCE
It's less copy/paste, works everywhere, etc.

Also fix some missing #include "config.h".
2013-07-10 13:25:35 -04:00
Colin Walters 8cb348315e main: Print "error: " prefix on errors
It's just clearer that something went wrong.
2013-07-10 13:25:15 -04:00
Colin Walters 32d2cd57c1 admin: Add a warm fuzzy message to deploy about transactions
Since it sounds cool and stuff.
2013-07-10 02:30:26 -04:00
Colin Walters 12c76188c0 Delete leftover kernel update hooks 2013-07-09 20:38:05 -04:00
Colin Walters 89181c4e8e Build without libsoup again 2013-07-09 20:35:15 -04:00
Colin Walters 88cca89317 ostree: Some header file cleanups 2013-07-09 20:30:00 -04:00
Colin Walters 45c7536697 cmd: Drop "ostree admin install" and curl fetcher
It isn't useful at the moment, since the deploy stuff all changed.  It
will make sense to bring back later, but for now let's not carry
broken untested code.
2013-07-09 20:18:29 -04:00
Colin Walters 2535f32c56 libostree: Move pull code into here
More library work.
2013-07-09 20:14:53 -04:00
Colin Walters 5dd0d5da40 libostree: Move prune into OstreeRepo namespace
More library work.
2013-07-09 20:05:31 -04:00
Colin Walters 2aa0251b1b libostree: Rename ostree-traverse.h into OstreeRepo namespace
This operates on the repo, it might as well be methods on it.
2013-07-09 19:59:39 -04:00
Colin Walters cb6b69616c libostree: Split off -refs.c
Continuing to break up ostree-repo.c.
2013-07-09 19:49:00 -04:00
Colin Walters 3b6a94d272 libostree: Split off libarchive code 2013-07-09 19:11:37 -04:00
Colin Walters dbffd31017 libostree: Start splitting up the monstrous ostree-repo.c
Checkout now lives in its own file.
2013-07-09 19:02:38 -04:00
Colin Walters 5ad0671cd2 Switch to #pragma once for headers
It's just less tedious, and we're GCC/LLVM specific anyways.
2013-07-09 18:53:22 -04:00
Colin Walters 7f48c77204 pull: Explicitly use thread-default main context
As preparation for pushing our own temporary context.
2013-07-09 18:46:00 -04:00
Colin Walters 13e33cd76b admin: Use internal pull API instead of subprocess
So we're doing more of the library thing.
2013-07-09 18:34:05 -04:00
Colin Walters 4c2a8bc210 pull: Destroy queue watching GSource
When being more of a library, we can't leave garbage attached to the
default main context.
2013-07-09 18:33:30 -04:00
Colin Walters b18e21be1d core: Move pull logic into an API
The general trend should be becoming more of a shared library with
command line wrappers.
2013-07-09 17:58:03 -04:00
Colin Walters a181310a49 pull: Add "tls-permissive" config option to disable SSL/TLS certificate checks
Like GIT_SSL_NO_VERIFY=true, available for the same reasons.
2013-07-09 15:40:20 -04:00
Colin Walters 7092e88eac pull: Verify SSL/TLS certificates against system CA file by default
We also need a mechanism like GIT_SSL_NO_VERIFY...probably an option
in the config.
2013-07-09 15:02:48 -04:00
Colin Walters b5b2aca592 prepare-root: Don't be strict about the sysroot mount name here
While the systemd integration effectively requires /sysroot, it will
help people trying to use OSTree with other initramfs systems
(e.g. initramfs-tools) if we don't hardcode that requirement in this
tool.
2013-07-09 12:04:02 -04:00
Colin Walters 43d69ac8a3 tests: Drop numeric prefix
Theoretically it's useful to have layers of tests, but in practice
it's just annoying to assign numbers.
2013-07-09 10:41:07 -04:00
Colin Walters 56f8584fe4 repo: Store transaction file, use it to optimize for pull resumes
If pull is interrupted, we may have downloaded an arbitrary subset of
the requested objects.  Previously, we handled this by scanning for
all objects each time.

However, there's an easy optimization - this patch creates a lock file
in the repo.  If we don't see that file when starting a pull, we know
we don't need to stat() every file; presence of a dirtree object for
example implies the existence of everything it references.
2013-07-08 09:05:34 -04:00
Colin Walters 305cd02e0c Drop obsolete GRUB2 and kernel update hooks
We only support syslinux at the moment; grub2 should learn to parse
the bootloader spec.
2013-07-07 21:56:54 -04:00
Colin Walters 53dcb3a68d Remove stub daemon code
This really shouldn't have lived so long...it does nothing now, and we
should probably just be exposing an API for packagekit anyways.
2013-07-07 18:14:53 -04:00
Colin Walters 26cef497a6 Remove built in "triggers"
Originally, the idea was that clients would replicate "OS/tree"s from
a build server, but we'd run things like "ldconfig" on the client.
This was to allow adding e.g. the nVidia binary driver.

However, the triggers were the only thing in the system at the moment
that really had expected knowledge of the *contents* of the OS, like
the location of binaries.

For now, it's architecturally cleaner if we move the burden of
triggers to the tree builder (e.g. gnome-ostree or RPM).  Eventually
we may want OSTree to assist with this type of thing (perhaps
something like RPM %ghost), but this is the right thing to do now.
2013-07-07 14:37:59 -04:00
Colin Walters f6bca20551 admin: Fix various compiler warnings 2013-07-07 14:30:01 -04:00
Colin Walters c66148160c admin: Also delete unsed boot directories
My VM filled up /boot.  Oops.
2013-07-07 13:45:18 -04:00
Colin Walters 1fa1443bae admin: Split up the monstrous ot-admin-functions.c
Now util, cleanup, and functions.
2013-07-07 12:42:02 -04:00
Colin Walters 4b170d656c Switch to libgsystem local allocation macros
And drop our compatibility wrapper.
2013-07-07 12:27:44 -04:00
Colin Walters bb6eedfb25 [INCOMPATIBLE CHANGE] Implement new deployment model
See https://wiki.gnome.org/OSTree/DeploymentModel2

This is a major rework of the on-disk filesystem layout, and the boot
process.  OSTree now explicitly supports upgrading kernels, and these
upgrades are also atomic.

The core concept of the new model is the "deployment list", which is
an ordered list of bootable operating system trees.  The deployment
list is reflected in the bootloader configuration; which has a kernel
argument that tells the initramfs (dracut) which operating system root
to use.

Invidiual notable changes that come along with this:

1) Operating systems should now come with their etc in usr/etc; OSTree
   will perform a 3-way merge at deployment time, and place etc in
   the actual root.  This avoids the need for a bind mount, and is
   just a lot cleaner.
2) OSTree no longer bind mounts /root, /home, and /tmp.  It is expected
   that the the OS/ has these as symbolic links into /var.

At the moment, OSTree only supports managing syslinux; other
bootloader backends will follow.
2013-07-07 11:31:26 -04:00
Colin Walters ecb3f0de03 deploy: Error out if we see usr/etc
This version of the code doesn't know what to do with new-model trees,
so just abort if we see that.  We'll likely never care about upgrades
from 1.0 to 2.0.
2013-07-05 17:29:07 -04:00
Colin Walters e8cba55a34 core: Allow '.' in refspecs too
For version numbers.
2013-07-05 16:51:47 -04:00
Colin Walters ec21dc4242 Add "trivial-httpd" builtin, use it in tests
A simple HTTP server implementation is so few lines of code when one
is linking to libsoup anyways, so let's just have one here in ostree
that will be used for the test suite.

This allows us to run the archive tests that previously required
apache even in gnome-ostree.
2013-07-05 16:28:40 -04:00
Colin Walters a93f2b8d16 pull: Make fetcher work for file:/// URIs too
Even if very suboptimally, for now; we copy the files, then copy them
again.

The obvious long term plan is to merge pull-local and pull together,
but truly optimizing that requires the pull code to know how to use
the OstreeRepo APIs when operating on local repositories (as
pull-local does), rather than assuming the remote is an archive-z
fetched over HTTP.
2013-07-01 22:43:17 -04:00
Colin Walters dc0f3c3dcb Add support for deleting refs
The internal API will be used by admin, and "ostree refs --delete"
is handy for interactive management.
2013-07-01 15:41:27 -04:00
Colin Walters 5b3fca8426 Add "refs" builtin
This is just useful to look at before pruning, etc.
2013-06-29 14:51:08 -04:00
Colin Walters 613f57007c Extract prune logic into an internal API
This will be used by ostree admin deploy.
2013-06-29 13:49:34 -04:00
Colin Walters a167bb7342 pull-local: Support --remote argument
For offline upgrades, pull-local can now write the refs into a
specific remote, rather than using the local heads.
2013-06-29 13:00:42 -04:00
Colin Walters 1ba852ebaa core: Add "refspec" which is remote:refname
This allows an unambiguous reference; otherwise, it was too easy to
have confusion between local heads and remotes.
2013-06-29 12:51:29 -04:00
Colin Walters e3dc0c91df gioutils: Many new utility functions
Reading symbolic links becomes a much more common thing now.
2013-06-29 12:51:29 -04:00
Colin Walters f6946a368f prepare-root: Only bind mount /home, /tmp, /root if they are directories
What we expect for new systems is for these to be symbolic links:
/home -> /sysroot/home
etc.
2013-06-23 17:56:14 -04:00
Colin Walters 7bb20b0533 core: Port more callsites to gs_file_enumerator_iterate()
See previous commit.
2013-06-14 19:45:40 -04:00
Colin Walters fbd9f17e39 core: Update libgsystem, port some uses of GFileEnumerator
This makes the code *so* much nicer.
2013-06-14 19:14:35 -04:00
Colin Walters c57e63a515 pull-local: Fix race condition pointed out by Benjamin
We could drop into g_main_loop_run() after the worker
thread had called g_main_loop_quit().

Fix this by following the pattern suggested by Ryan of a while loop
around our termination condition, and g_main_context_iteration().
2013-06-08 14:15:43 -04:00
Colin Walters 3e1e26352f pull-local: Fix race condition
https://bugzilla.gnome.org/show_bug.cgi?id=701861
2013-06-08 12:58:44 -04:00
Colin Walters 7e882cc2cf dracut: Add ostree-remount
Linux creates a copy of the soure mount flags when creating a bind
mount; if the source is read-only, then the bind mount is.

The problem is that systemd will remount the rootfs read/write, but
each mount (/home, /var etc.) will still be read-only.  We need to
remount every bind mount except for /usr to read-write too.

This only "worked" with the old ostree-switch-root because it
effectively force mounted the rootfs read-write always, ignoring the
"ro" flag.
2013-06-04 15:59:52 -04:00
Colin Walters 26baee6c3b dracut: Also ensure we're using the systemd module
I can't work out how this happens otherwise in Fedora...
2013-06-03 20:49:07 -04:00
Colin Walters 6496abacbd Add --with-dracut
This installs a Dracut module which parses the ostree= kernel command
line argument, and if given, sets up the OS/ at /sysroot, which
systemd's switch-root then moves into.  This only works if dracut is
configured to use systemd itself.
2013-06-03 15:28:09 -04:00
Colin Walters 35df7a7eb4 ostree-prepare-root: Don't require an extraneous argument 2013-06-02 22:19:24 -04:00
Colin Walters 8eaaea795c ostree-prepare-root: Parse /proc/cmdline, make RPRIVATE, set up /sysroot
This does everything we need except for the actual switch-root.
2013-06-02 21:41:08 -04:00
Colin Walters 1e080b9c73 ostree-prepare-root: New binary, used for systemd-in-initramfs setups
Rather than attempting to hack up the "switch-root" functionality of
systemd, this binary allows us to simply prepare the root before we
switch into it.
2013-06-02 15:39:20 -04:00
Colin Walters 16157c61af Drop support for generating initramfs images client side using dracut
This is the responsibility of whatever is generating filesystem trees.
2013-05-31 13:09:27 -04:00
Colin Walters ba5fc5cbcc Fold ostree-pull into main binary
The rationale for the separation was always kind of weak; I want to
refactor the command line argument parsing, and it was complicating
things.
2013-05-30 19:26:48 -04:00
Colin Walters 86e504ba1d pull: Exit cleanly with an error on failure to fetch refs 2013-05-27 09:29:33 -04:00
Colin Walters fab160562d upgrade: Actually prune deployments again
That was a rather critical logic error...
2013-05-27 09:29:05 -04:00
Colin Walters 0852362efa upgrade: Actually deploy upgraded tree again
I need a brown paper bag for this one...
2013-05-16 15:38:17 -04:00
Colin Walters f9484e9bab admin: Add -r option to upgrade to initiate a reboot if tree changes
$ ostree admin upgrade -r

is convenient to fire off inside a VM and come back to it later.
2013-05-16 08:29:20 -04:00
Colin Walters 18af230e17 upgrade: Don't require specification of osname
Since this is a highly visible command, let's have a sane default and
upgrade the currently running OS.
2013-05-15 08:18:53 -04:00
Colin Walters 82f444020e Add a --version argument that also outputs features
And use it in the tests to skip libarchive tests when the build
doesn't support it.
2013-05-01 19:15:06 -04:00
Colin Walters c60c70e9a9 checkout: Add --allow-noent option
This is useful for the gnome-ostree build system where each build is
one commit, but it's split up into /runtime /devel /debug etc. trees.
Ideally we wouldn't have a /debug subdirectory for "noarch"
components for example.

So add an option to not error out if the given path doesn't exist in
the commit.
2013-05-01 12:15:02 -04:00
Colin Walters f4327cc6a0 repo: Fix race condition in async checkout
When multiple threads need to uncompress an object, there was
a race condition where thread A could get EEXIST, unlink,
then thread B calls linkat(), then thread A tries to link() but
fails.

We can just loop in this case.
2013-04-30 19:34:20 -04:00
Colin Walters 8e4b296a96 libotutil: Drop is-hidden from fast queryinfo
Since now we look at .hidden files and bang on the mainloop for every
file lookup if that's specified =(
2013-04-29 22:08:56 -04:00
Colin Walters c110680f5d libgsystem: Update to latest 2013-04-29 14:04:48 -04:00
Colin Walters 8c694622b1 deploy: Swap current symlink only after updating the kernel
While this still isn't fully atomic (that depends on the bootloader),
this better ensures that the deployed kernel is booted with the
intended tree.  For example, if we get ENOSPC when writing out the
kernel, we won't have swapped the symlink.
2013-04-26 18:15:51 -04:00
Colin Walters 52a3369709 libgsystem: Update 2013-04-22 12:27:47 -04:00
Colin Walters b06c4a2081 pull-deploy: Tweak documentation to show using it for switching trees 2013-04-21 10:39:27 -04:00
Colin Walters 5565735bcb admin: Use linkcopy_sync_data() for initramfs instead of rename()
It's possible (likely even) that /tmp is on a separate filesystem; in
that case, a raw rename() is going to fail.

Saw this on the ostree.gnome.org builder.
2013-04-15 12:50:58 -04:00
Colin Walters a01783dafd prune: Use g_format_size() so we get a human-readable number
We don't really care about the precise bytes.
2013-04-08 16:56:05 -04:00
Colin Walters 4271f84755 waitablequeue: Only use API from GLib 2.34
As intended.
2013-04-03 00:50:16 -04:00
Colin Walters c563d07cb6 switchroot: Suppress compiler warning for asprintf
We're not going to run OOM here, if we do, we're totally screwed
anyways.
2013-04-01 21:52:24 -04:00
Colin Walters bac4d7a0d2 pull: Rework threading communication model
Previously, I've observed bugs where we either:
1) Exit too early, leaving undownloaded objects
2) Hang while downloading

This rewrite hopefully fixes both.
2013-04-01 18:56:38 -04:00
Colin Walters 5d1b0ec1b3 core: Fix object enumeration for archive-z2 repositories
This makes fsck work again, among other things.
2013-04-01 11:43:03 -04:00
Colin Walters bde7e5c719 pull: Drop support for original archive repositories
For future refactoring here, it's just too complex to maintain support
for both of them, and the advantages of archive-z2 outweigh archive
too much.
2013-03-29 17:22:56 -04:00
Colin Walters 7b2fc8df36 admin: Assume we're using /ostree if there's a toplevel /usr
Mainly so admin install works without an existing /ostree again.
2013-03-18 18:11:00 -04:00
Colin Walters e4faf0d98e admin: Support installing pregenerated initramfs images from tree
Us running dracut is a hack, basically.  We should default to
generating this on the server.
2013-03-16 17:45:15 -04:00
Colin Walters ae3945210c config-diff: Properly print files relative to root
Just less ugly.
2013-03-12 08:48:05 -04:00
Colin Walters d6d2253f5a admin: Fix lookup of active root
This should hopefully *really* fix deleting running deployments

https://bugzilla.gnome.org/show_bug.cgi?id=694762
2013-03-07 16:46:41 -05:00
Colin Walters 30d46f9a02 admin: Don't delete the running deployment
https://bugzilla.gnome.org/show_bug.cgi?id=694762
2013-03-04 22:52:08 -05:00
Colin Walters dba406bb8f deploy: Don't run triggers if /usr/share/ostree/triggers-run exists
This is preparatory work for a future gnome-ostree commit where we'll
default to running triggers on the build server side.
2013-03-04 11:52:43 -05:00
Colin Walters a016d744ea Update libgsystem 2013-02-26 12:19:05 -05:00
Colin Walters 202c5e35c9 core: Use default /sysroot/ostree/repo or just /ostree/repo as appropriate
The old logic was just weird, special casing root, and we can easily
autodetect the case where we need /ostree/repo.
2013-02-24 10:00:23 -05:00
Colin Walters 99fe7b66b3 pull-local: Don't call g_hash_table_init() on a NULL hash
Not sure why this wasn't crashing before.
2013-02-23 11:15:19 -05:00
Colin Walters a821420711 core: Add API to convert csum -> checksum without malloc()
Just doing some profiling, this was in the top malloc() callers.
2013-02-23 11:02:56 -05:00
Colin Walters a305c79f7a pull-local: Fix uninitialized variable ref 2013-02-21 13:05:14 -05:00
Colin Walters 8521438273 pull-local: Output status even in non-tty case
This way I can see progress when running builddisks.
2013-02-21 08:54:13 -05:00
Colin Walters 420e5f706a admin: Use /sysroot/ostree automatically
When booted inside an ostree system, we want /sysroot/ostree, not
just /ostree by default.
2013-02-19 11:02:33 -05:00
Colin Walters c9f56564a3 switchroot: Use MS_MOVE to / rather than chroot
This fixes a number of bugs; the two biggest are:

1) On shutdown systemd can correctly umount /
2) We can use linux-user-chroot inside the system, as is
   necessary to do upgrades

See http://lists.freedesktop.org/archives/systemd-devel/2012-September/006703.html
2013-02-11 20:46:53 -05:00
Colin Walters 1d98f8865c pull-deploy: Allow switching trees too
$ ostree admin pull-deploy gnome-ostree trees/gnomeos-3.8-x86_64-devel

Now works to switch your current tree to -devel from the current
runtime.
2013-02-01 10:56:06 -05:00
Colin Walters 42e3f1f4ab pull-local: Fix crasher in previous commit when not connected to tty 2013-01-28 15:44:13 -05:00
Colin Walters aa5e11af12 pull-local: Port to GSConsole 2013-01-28 15:35:47 -05:00
Colin Walters 13f36aa224 pull-local: Support pulling checksums too
This matches what pull allows.
2013-01-28 15:32:06 -05:00
Colin Walters 5424652a7e libgsystem: Update to the latest 2013-01-25 15:19:34 -05:00
Colin Walters 64934202e4 admin: Don't overwrite previous ref unless it's different
We shouldn't overwrite deploy/<osname>/previous unless we actually
have something new.

This fixes the bug where two consecutive:

$ ostree admin upgrade foo
$ ostree admin upgrade foo

would end up pruning the data for foo/previous from the repo.
2013-01-24 17:32:59 -05:00
Colin Walters 59c98d0a04 pull: Drop dead code to pad output strings too
This is in GSConsole now.
2013-01-24 15:38:06 -05:00
Colin Walters 6fde0b61a8 Port ostree-pull to GSConsole
As part of this, we need to ensure our streams are inherited across
the chain of child processes.
2013-01-24 15:22:16 -05:00
Colin Walters fafb256f57 Update to the latest libgsystem 2013-01-23 15:20:19 -05:00
Colin Walters 13aefbc096 admin install: Ensure /ostree is initialized first
https://bugzilla.gnome.org/show_bug.cgi?id=692008
2013-01-18 08:38:09 -05:00
Colin Walters 341923b928 admin: Ensure /var/log/journal exists
This is admittedly a hack, since the story is that services should be
handling /var on their own.  But on the other hand the current systemd
story is that admins should create it to enable it.  Possibly a better
fix is --enable-journal-always or something for systemd.
2013-01-17 22:08:21 -05:00
Colin Walters 50ca6b672b update-kernel: Change dracut to use tmpdir on host, fix deploy path lookup
We had a bit of legacy code that looked for "current" if the deploy
path was unspecified; this needs to be deploy/OSNAME/current.

Secondly, we need to point dracut at a tmpdir outside of the root when
doing FUSE, because directories with mode 0700 and owned by root:root
aren't writable.

Also update libgsystem to the latest.
2013-01-09 04:32:51 -05:00
Colin Walters 77fa143bf3 admin: Add --no-bootloader option to update-kernel
Will be used by the QA scripts, since we need to inspect the kernel
configuration and generate a correct grub conf from that, rather than
trying to have update-bootloader reuse an existing config, since there
won't be one initially.
2013-01-08 13:57:24 -05:00
Colin Walters ecc0d1e07f Update to the latest libgsystem 2013-01-08 07:04:29 -05:00
Colin Walters 1dcf796868 admin update-kernel: Drop support for booting from host kernel
Now that gnome-ostree has a kernel, this functionality is no longer
necessary.  It was always a hack.
2013-01-06 12:37:45 -05:00
Colin Walters 6b868d84d8 admin update-kernel: Ensure initramfs has correct owner/mode
It was 0600, and owned by the creating process (in the fuse case,
non-root!).  We want it 0644/root/root.
2013-01-06 06:43:49 -05:00
Colin Walters 9795f4a67e admin: Propagate --boot-dir to subcommands
Really, I should be using internal functions here...
2013-01-06 06:12:42 -05:00
Colin Walters ccfdf22bb8 core: Drop dead prototypes from header
Followup to previous commit.
2013-01-04 19:47:56 -05:00
Colin Walters cd5fce713c core: Reuse more libgsystem API in utils
More code drain to libgsystem.
2013-01-04 19:46:02 -05:00
Colin Walters c9a840c659 core: Ensure kernel and initramfs are put into place with fdatasync()
Via a new libgsystem API.
2013-01-04 19:32:26 -05:00
Colin Walters 47bd290065 core: Drain fdatasync() API into libgsystem
Just code cleanup.
2013-01-04 17:25:32 -05:00
Colin Walters 2db497fd3f admin: Allow specifying --boot-dir
This is intended for use by QA tools that want to manipulate a
loopback-mounted disk image or the like.
2013-01-02 22:44:06 -05:00
Giovanni Campagna 6c9c7b0173 admin: restore current-etc symlink
It is useful now like it was before, and it is used by the grub
update script.

https://bugzilla.gnome.org/show_bug.cgi?id=690743
2012-12-26 19:42:46 +01:00
Colin Walters 9bd4d35c2b pull: Fix a race condition causing an early exit
This is a little less magical than what we had before.
2012-12-23 17:22:08 -05:00
Colin Walters 3c67c209db pull: Use a basic exponential moving average for bytes/sec
Still should look what other downloading programs do, but this
is better then what we had before.
2012-12-23 14:29:15 -05:00
Colin Walters 0ab1f78ec8 admin: Add new run-triggers command
In some cases we want the ability to run triggers independently of
checking out a tree.  For example, due to kernel limitations which
impact the gnome-ostree build system, we may need to run triggers on
first boot via systemd.

Secondarily, if the user installs a system extension which adds a new
shared library to /usr/lib for example, the system will need to run
the triggers again.

Also, I think I want to take triggers out of the core and put them in
ostree admin anyways.
2012-12-22 14:52:33 -05:00
Colin Walters 3832544ac4 admin: Rework /ostree/deploy to support multiple independent operating systems
The real vision of OSTree is to "multiple versions of multiple
operating systems".  Up until now, it's worked to install gnome-ostree
inside a host distribution, but several things don't work quite right
if you try to do completely different systems.

In the new model, there's the concept of an "osname" which encompasses
a few properties:

1) Its own /var
2) A set of trees deployed in /ostree/deploy/OSNAME/
3) Its own "current" and "previous" links.

Now it no longer really makes sense to boot with "ostree=current".
Instead, you specify e.g. "ostree=gnome/current".

This is an incompatible change to the deployment code - you will need
to run init-os gnome and redeploy.

All "ostree admin" subcommands now take an OSNAME argument.
2012-12-21 13:47:15 -05:00
Colin Walters 16d312e82f admin: Support installing a kernel from the tree, default to it
The "protocol" here is rather lame; we just look for
/boot/vmlinuz-RELEASE and /lib/modules/RELEASE.  But good enough for
now.
2012-12-21 12:20:55 -05:00
Colin Walters 19df2d372d core: Use new libgsystem GSSubprocess API
It's less screwing around with GPtrArray in most cases.
2012-12-21 11:52:28 -05:00
Colin Walters 90ccc7b2d2 core: Pick better names for tmpfiles if no prefix given
Just makes it easier to track down where files came from.
2012-12-21 11:30:58 -05:00
Colin Walters 3d41d1d2db OtWorkerQueue: Don't exit until we've fulfilled initial requests
This counts as an implicit "hold" on the first items, which we must
complete.  Otherwise there are race conditions where the queue may
signal idle when in fact the main process is still working.
2012-12-21 09:36:38 -05:00
Colin Walters fddc11ca74 Update to latest libgsystem
Has a bugfix change to gs_subprocess_new().
2012-12-20 21:14:31 -05:00
Colin Walters ad956ff9e2 core: Allow creating tempfile without associated output stream
Just slightly more efficient, and we'll use this for spawning curl to
a tempfile.
2012-12-20 21:14:27 -05:00
Colin Walters a97211e3d0 core: Clean up tmpfile creation code
I have been seeing random failures here...not entirely sure why yet,
but this code is cleaner.
2012-12-13 15:12:51 -05:00
Colin Walters 380b54d689 Update libgsystem
Just keeping up.
2012-12-13 15:12:33 -05:00
Colin Walters b637ea7674 admin init-fs: New builtin
Should be used when initializing a new root filesystem for a "pure
OSTree" system; for example, what "ostbuild privhelper-deploy-qemu"
does when creating a filesystem image loopback.
2012-12-09 17:01:51 -05:00
Colin Walters a2acaedfdc admin: Process newly added config files recursively
Previously we just failed out if there was a new directory in /etc
added by the user (or the system).
2012-12-07 18:29:03 -05:00
Colin Walters 227d22adca Update to the latest libgsystem 2012-12-03 12:05:41 -05:00
Colin Walters a9a9baeb2a Update to latest libgsystem
Has a rather important bugfix.
2012-12-02 23:02:39 -05:00
Colin Walters fc7f05940c core: Use mmap() with O_NOATIME if merely reading archive-z2 entries
Previously we'd open(path, O_NOATIME) and do a series of small read()
calls to just parse the header.  I think this will trigger kernel readahead
into the compressed portion, but we don't care about that.

This should be more efficient.
2012-12-02 15:20:17 -05:00
Colin Walters 7fcebed4e8 cleanup: Rebase spawn API on top of libgsystem GSSubprocess
We didn't need most the parameters anyways, so this is fewer lines of
code.  It also helps me test GSubprocess.
2012-12-01 16:53:06 -05:00
Colin Walters b423ea2041 Update to the latest libgsystem 2012-11-29 18:16:45 -05:00
Colin Walters 6dda8da6c5 Switch to using libgsystem shutil
More code moved into libgsystem.
2012-11-29 17:11:24 -05:00
Colin Walters 1ac307e6b8 Switch to libgsystem file reading API
More draining common utilities into libgsystem.
2012-11-29 16:58:39 -05:00
Colin Walters f3d765c903 Switch to libgsystem directory creation API
More code being dropped into a common place.
2012-11-29 16:40:17 -05:00
Colin Walters 6d81120455 otutil: Move checksum related bits into checksum-utils.[ch]
This paves the way for slimming ot-gio-utils.[ch] into libgsystem.
2012-11-29 16:28:24 -05:00
Colin Walters 5761733218 Drop some bits from libotutil that are now merged in libgsystem 2012-11-29 16:24:49 -05:00
Colin Walters d1ddfc973c libotutil: Drop dead prototype
Was never implemented.
2012-11-29 15:56:17 -05:00
Colin Walters f2b1be6a1e deploy: With --no-kernel, do copy host kernel modules
This is used by the qemu scripts, and there we *do* need the kernel
modules inside the target system.
2012-11-21 12:38:29 -05:00
Colin Walters 05e7b6d596 pull-local: Make multithreaded
We were blocking for easily 1/10 or 1/5 of a second in fdatasync(),
which drastically slows down the whole process.

This threading isn't quite as good as the ostree-pull command, but it
lets us avoid the dependency on libsoup everywhere, and it's simpler.
2012-11-19 12:08:41 -05:00
Colin Walters de1ce843f1 core: Drop old GLIB_CHECK_VERSION(2.32) bits
We hard require 2.34 now; if it doesn't exist on the system, that's
what embedded dependencies are for.
2012-11-18 15:44:21 -05:00
Colin Walters 3f4d223361 admin prune: New builtin for cleaning up deployments and repo
After a while of pull-deploy cycles, you start to accumulate a lot of
them.  While the deployment read-only part is hardlinked, the -etc
space adds up.

Additionally, the repository itself just gets large.

The new command "ostree admin prune" deletes everything except the
"current" and "previous" deployments.
2012-11-16 17:41:46 -05:00
Colin Walters 05895780a3 deploy: Write refs into repo for current/previous deployments
We don't want this data to be gc'd by default by a prune.
2012-11-16 17:14:23 -05:00
Colin Walters ffd774e2e6 prune: Report how much disk space we freed
Just nicer to see...
2012-11-16 15:45:05 -05:00
Colin Walters 7861b98673 prune: Add option to traverse refs only
The previous code (unintentionally) only traversed from refs; so data
only reachable from previous commits would be deleted.  That shouldn't
be the default, but we do want to offer it as an option.

So add a --refs-only option.
2012-11-16 12:50:13 -05:00
Colin Walters 51b1dd7cbd traverse: Skip already traversed commits
This is just more efficient, since e.g. "ostree prune" may invoke
ostree_traverse_commit() multiple times for the same commit.
2012-11-16 12:35:52 -05:00
Colin Walters 4169d628c5 prune: Default to deleting loose objects, code cleanup
We're getting closer to matching 'git gc'.
2012-11-16 10:58:35 -05:00
Colin Walters ee533d6ab9 admin: code cleanup
Refactor internal functions so they can be used by a later patch.
2012-11-16 10:40:49 -05:00
Jasper St. Pierre cda5b28bab ot-main: Ignore lt- prefixes in binary names
libtool is the best

https://bugzilla.gnome.org/show_bug.cgi?id=682438
2012-10-24 12:20:15 -04:00
Colin Walters cc4df4f3c2 admin: Add new pull-deploy command
Fetch the latest for the current tree, and deploy it in one go.
2012-10-22 20:41:49 -04:00
Colin Walters f405737164 libgsystem: Update 2012-10-22 18:24:31 -04:00
Matthias Clasen a0449ed246 Make ostree admin --help output more useful
At a minimum, it should list the available subcommands. This is
still not perfect, since there is no way to get at the help output
of the subcommands - getting that right needs more refactoring.

Signed-off-by: Colin Walters <walters@verbum.org>
2012-10-22 18:10:56 -04:00
Colin Walters 5a51bee024 core: quiet a compiler warning 2012-10-17 20:54:52 -04:00
Colin Walters 0c3e901dae core: Check out files before directories
Otherwise we pretty easily hit maximum FD limits =(
2012-10-15 20:03:13 -04:00
Colin Walters bdbf76b6eb core: Ensure correct file data is synced in non-overwrite case 2012-10-15 18:44:55 -04:00
Colin Walters 1642310486 core: Use linkat() rather than link() in threaded checkouts
This seems to work around a likely Linux kernel VFS bug, where I
randomly see ENOENT on link() when we *definitely* called mkdir() at
an earlier point in time.
2012-10-15 10:49:48 -04:00
Colin Walters d6956bfc19 core: And one more race in multithreaded mkdir -p
Sigh =(
2012-10-15 10:49:48 -04:00
Colin Walters c0a6b5da71 core: Fix devino speedup for archive-z 2012-10-14 17:19:30 -04:00
Colin Walters 0d04738801 core: Rework archive-z mode to have header be uncompressed
This is an incompatible change to archive-z, thus it is now renamed to
archive-z2 and ostree will no longer parse archive-z.

I noticed in perf that we were spending some time zlib-decompressing
file headers, which is just inefficient.  Rather than do this, keep
the headers uncompressed, and just zlib-compress content.
2012-10-14 17:10:57 -04:00
Colin Walters 2b90e987bf core: Call fdatasync() before we rename()
Just noticed this from strace, doesn't really matter, but looks nicer.
2012-10-14 15:34:33 -04:00
Colin Walters b0b409f82e checkout: Drop uncompressed object GC for now
It's racy when multiple processes are involved, and needs a bit more
thought.
2012-10-13 19:22:29 -04:00
Colin Walters 5b512d4c78 core: Fix case where we hardlinked successfully but thought we didn't
We need to return hardlink_supported even if we had to do an unlink
first.
2012-10-13 18:41:47 -04:00
Colin Walters ad26c7a80b core: A few more error-prefixings 2012-10-13 18:02:39 -04:00
Colin Walters c159188b81 core: One more minor tweak to recursive directory creation
We would fail in the case where we were trying to create a
subdirectory of /; this didn't actually happen, just noticed
via code inspection.
2012-10-13 17:54:19 -04:00
Colin Walters a284075731 core: Prefix some error messages
To help debug why I still have this race condition...
2012-10-13 17:46:24 -04:00
Colin Walters 6b09f90122 core: Threadsafe recursive direction creation is harder than it appears 2012-10-13 10:47:03 -04:00
Colin Walters b4d408f483 core: Fix regression in previous commit 2012-10-12 15:25:25 -04:00
Colin Walters 4436ed34d8 core: Make mkdir -p function safer
Recursing here is just a more obvious way to do it, rather than
relying on the semantics of g_file_make_directory_with_parents().
2012-10-12 15:10:39 -04:00
Colin Walters 238da603b8 core: Ensure file data is synced to disk when checking out via non-hardlinks
Otherwise we aren't crash-safe.
2012-10-12 13:09:10 -04:00
Colin Walters e9dd22dc86 repo: Avoid race condition in threaded checkout with symbolic links
We were inconsistently putting symbolic links into the uncompressed
object cache, which could cause the threaded checkout to get confused.
2012-10-12 11:24:06 -04:00
Colin Walters ee73c0fa34 core: Add dynamic uncompressed object cache for archive-z
This gives us something closer to the advantages of archive and
archive-z when using the latter.  Concretely we get deduplication
among multiple checkouts, along with the "devino" hash table trick
during commits to avoid checksumming content again.

This is enabled by default.
2012-10-11 18:33:03 -04:00
Colin Walters 3c0fe01152 pull: Print elapsed time 2012-10-05 17:20:40 -04:00
Colin Walters 52a0b7bdb1 core: Only do devino scan on commit (speeds up pull)
When fetching data remotely, there's no point to the devino scan
because we're not going to be committing local files.

Only do it for "commit".
2012-10-05 17:12:39 -04:00
Colin Walters efe27f1b05 pull: Ensure worker queue finishes if we unhold an empty queue too 2012-10-04 20:32:14 -04:00
Colin Walters 9618232f4d pull: Stage content asynchronously
For similar reasons as metadata, this avoids having the main thread
blocked in fdatasync(), and even better - we can achieve much higher
parallelism if we have multiple threads blocked on fdatasync().
2012-10-04 20:00:00 -04:00
Colin Walters 5b8e833351 pull: Stage metadata objects asynchronously
This avoids the main thread being blocked on fdatasync(); also as a
bonus we checksum metadata in a separate thread too.
2012-10-04 18:24:37 -04:00
Colin Walters f1b4db15a2 pull: Ensure queued filemeta requests don't starve everything else
We need this hack for "archive mode" repositories; otherwise,
what ends up happening is that we get 10000+ requests pending
for .filemeta files, which we can't process until we also get
the .filecontent.

Note this hack is unneccessary when fetching from archive-z
repositories.
2012-10-04 18:23:18 -04:00
Colin Walters 4e51701bea pull: Merge metadata and content fetch phases
This is a notable speedup when the metadata scanner is working, and we
don't have a lot of traffic; we can pull down data at the same time.
2012-10-04 15:37:23 -04:00
Colin Walters 5c1dc390ae pull: Asynchronous metadata fetch
Create a worker thread for processing metadata, reserving the main
thread for HTTP requests.

This can create a very significant efficiency win for large pull
requests since we are much more likely to keep a full pipeline open.

The status display is also nicer now.
2012-10-03 22:35:33 -04:00
Colin Walters 8153799121 admin: Prepare /var/log/dracut.log when creating initramfs
Otherwise dracut complains.
2012-10-01 10:25:36 -04:00
Colin Walters 3e9c358628 Update libgsystem
This ensures we're disting the README, which makes the autogen.sh do
the right thing.
2012-09-25 22:25:06 -04:00
Colin Walters 26e487bacf core: use open(..., O_NOATIME) for reading loose objects
More efficient, and atime shouldn't matter for these.
2012-09-24 07:36:42 -04:00
Colin Walters 40ce43036f Add an archive-z repository mode
This is where loose content objects are stored as one compressed file,
instead of the two separate ones for regular archive mode.  This mode
would be suitable for HTTP servers, beause only one HTTP request is
necessary, and the result would be compressed.
2012-09-23 19:23:45 -04:00
Colin Walters 35a1ff51d0 pull: Fix two minor memory leaks 2012-09-23 17:32:11 -04:00
Colin Walters 34c49f0411 core: Clean up staging API and internals
Cleanly separate metadata/content APIs, rather than defaulting to
raw streams.  This helps most use cases.

Also, drop support for staging content without knowing the total
length.  This complicated the code, and for things like streaming
HTTP, we should be able to figure this out from Content-Length.
2012-09-23 16:44:12 -04:00
Colin Walters 2a0601efc7 core: Drop packfiles as they are now
They're not a large efficiency win at the moment, because we don't
do any delta compression.

At the moment, they simply served to compress data, but we will change
the archive mode to do that by default.
2012-09-23 16:02:03 -04:00
Colin Walters a8764bf996 diff: Fix case when used on native files 2012-09-23 15:55:02 -04:00
Colin Walters a6e9e54891 admin: Initialize /var more fully
This helps out gnome-ostree, because gdm needs /var/lib for example.
2012-09-18 08:58:07 -04:00
Giovanni Campagna 2881194186 Grub2: use /etc/system-release now that we have one
This matches the upstream code more, and avoids the GNOME OS trademark
in ostree, which is otherwise platform agnostic.

https://bugzilla.gnome.org/show_bug.cgi?id=684049
2012-09-17 00:25:30 +02:00
Giovanni Campagna 8c9406637c Add /ostree/current-etc symlink to current configuration
Configuration associated with a specific revision is stored in a folder
named <revision>-etc. In a similar spirit, add /ostree/current-etc, pointing
to the -etc folder for the revision named by current. This allows
easy editing of configuration from the host distribution, and allows
diffing current/etc and current-etc for configuration changes.

https://bugzilla.gnome.org/show_bug.cgi?id=684049
2012-09-17 00:25:29 +02:00
Giovanni Campagna 8a98e8d964 Update kernel files for command naming changes
ostadmin is now ostree admin.

https://bugzilla.gnome.org/show_bug.cgi?id=684049
2012-09-17 00:00:33 +02:00
Colin Walters 59ddbcc500 pull: Check the remote repo type
We can only pull from archive repositories right now.  This will also
be useful for adding compressed archives later.
2012-09-15 12:41:25 -04:00
Colin Walters 31153913ff Extract keyfile helpers into libotutil
Will be used by ostree-pull too soon.
2012-09-15 11:20:56 -04:00
Colin Walters 117b9c109e ostadmin: Fix up deploy config logic again
Clearly we need tests here...
2012-09-09 11:42:17 -04:00
Colin Walters 2f8b3517f4 admin: Ensure we pass options to subcommands
Otherwise ostree admin --ostree-dir=/foo deploy --no-kernel bar
doesn't work.
2012-09-09 11:31:22 -04:00
Colin Walters 7831ae81c2 update-kernel: Fix free -> g_object_unref 2012-09-09 10:42:13 -04:00
Colin Walters fa5485c6c4 Move "ostadmin" => "ostree admin"
This helps us avoid polluting the global binary namespace.
2012-09-08 19:34:10 -04:00
Colin Walters 2ddbeb1f71 Make /etc a writable mount
First, move deployments to /ostree/deploy.  Having them in the
toplevel clutters the filesystem layout too much.

When we deploy a tree like /ostree/deploy/NAME, there is now also a
writable directory /ostree/deploy/NAME-etc.  This is mounted as
read-write inside the system.

On an initial install, that directory is copied from
/ostree/deploy/NAME/etc.  On subsequent deployments, we find any
changes made in the current deployment's /etc, and apply that set of
changes to the new deployment's /etc.

See https://live.gnome.org/OSTree/EverythingInEtcIsABug
2012-09-06 08:17:23 -04:00
Colin Walters 9ba968a5f4 otutil: Add a few more helper functions
To be used by wip/etc-writable branch.
2012-09-03 10:43:42 -07:00