Commit Graph

1116 Commits

Author SHA1 Message Date
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
bea4a7538f Fix test reference to obsolete ostree-pull
It was leftover in my buildroot =/
2013-07-09 09:28:02 -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
48f7186e13 Release 2013.3 2013-07-07 21:35:29 -04:00
Colin Walters
d45ded3921 Add a few more bits to EXTRA_DIST 2013-07-07 21:35:29 -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
2ed49a3749 tests: Pull from file:/// only works with archive-z right now 2013-07-02 11:24:07 -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
aa1eb19eea Add a bit more testing for prune 2013-06-29 14:02:17 -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
82f803b625 TODO: Update 2013-05-16 21:42:24 -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
b1ace57ef8 archive-test: Handle umask of 022 or 002
Red Hat appears to default to 002, whereas Debian systems default
to 022.  Fun.
2013-05-01 18:43:01 -04:00
Colin Walters
e9a181c67d Install tests
Matching https://live.gnome.org/GnomeGoals/InstalledTests
2013-05-01 15:26:21 -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