Commit Graph

990 Commits

Author SHA1 Message Date
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
Colin Walters cf31942a69 core: Refactor diff to be an internal API
For future use by other code.
2012-08-31 17:39:04 -07:00
Colin Walters 38d62d79a2 ostadmin: Also ensure /ostree/modules exists
We depend on host kernel for now.
2012-08-30 17:42:36 -07:00
Colin Walters 60368fae76 Use correct libgsystem
Accidentally pushed a local patch.
2012-08-28 09:58:07 -04:00
Colin Walters a17a8e1f4e Update libgsystem 2012-08-27 18:48:14 -04:00
Colin Walters 4d2f770748 core: Use O_NOATIME to open metadata
We really don't need atime for metadata, it's just a speed hit.
2012-08-27 16:07:39 -04:00
Colin Walters 2396608754 repo: Call fdatasync() before adding objects to the repo
I run builds on my laptop, but it also crashes about 1/4 of the time
while suspending.  It's definitely undesrirable to get e.g. empty
.dirtree objects because they corrupt builds.  Concretely, I was
getting empty contents committed for xorg-util-macros.

Now, we used to write out temporary files using g_file_replace() which
does a fsync() during close, but then switched to a more "manual"
g_file_append_to().

We could switch back to g_file_replace(), but the problem is, we don't
want to call fsync() on temporary files in the case where we already
have the object.  Attempting to add an object we already have is a
*very* common case.

This is both the old and new code sequence for the case where an
object is already stored:

open(temp, O_WRONLY)
write() write() write()
close()
lstat(objects/3a/9fe332...) = 0
unlink(temp)

In the *new* code, here's the case where an object *isn't* stored:

open(temp, O_WRONLY)
write() write() write()
close()
lstat(objects/3a/9fe332...) = -1
open(temp, O_RDONLY)
fdatasync()
close()
rename(temp, objects/3a/9fe332)

Compare with the *old* code path for when an object isn't stored:

open(temp, O_WRONLY)
write() write() write()
close()
lstat(objects/3a/9fe332...) = -1
link(temp, objects/3a/9fe332)
unlink(temp)

The problem with this is we really need to fdatasync().  Also doing
just rename() instead of the weird link()/unlink() helps us express to
the filesystem that we want atomic semantics.  For example, BTRFS has
special handling for rename().
2012-08-27 15:35:40 -04:00
Colin Walters 5038a1930f traverse: Set an explicit error when loading a corrupted commit
I had a empty files for a .commit and .dirmeta, and previously we were
segfaulting.
2012-08-27 11:39:44 -04:00
Colin Walters 7b977beec8 ostadmin: Cosmetic change for option defaults 2012-08-26 17:34:32 -04:00
Colin Walters e9d23befd0 ostadmin: Add --ostree-dir option to init
Matches the option for deploy.
2012-08-26 17:34:25 -04:00
Colin Walters 8f6f3623c3 repo: Ensure all stored files are readable
We really don't have a sane story for private files.  This is a
defensive step ensuring that with old versions of gnome-ostree,
components that mistakenly have un-world-readable files don't break
pulls.
2012-08-26 16:35:44 -04:00
Colin Walters e2aabce708 prune: Don't fail if an object isn't found
We expect most people to have partial repositories.
2012-08-25 16:02:38 -04:00
Colin Walters 9d58bad7ca repo: Also traverse remote refs when enumerating objects
Otherwise ostree --repo=repo prune will delete everything =/
2012-08-25 16:02:38 -04:00
Matthias Clasen 4b0bbb94a0 Improve the pango trigger
Use the new update-cache mode of pango-querymodules, which
automatically finds the correct cache file location.

Updated to look in both places by Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=682411
2012-08-25 14:59:17 -04:00
Colin Walters 7087d28ec3 libostree: Quiet compiler warning with --disable-libarchive
This function is only used if compiling with it.
2012-08-24 16:47:31 -04:00
Matthias Clasen f5113085e1 ostree: Remove duplicate command in help output
The 'remote' command was listed twice. Also, the list
was almost-but-not-quite alphabetically sorted. Fix
that too.
2012-08-23 20:03:40 -04:00
Colin Walters 79f993beb4 pull: Only fetch pack files if we want more than 66% of their objects
This avoids some pathologically bad cases where we would fetch a 25MiB
pack file only to extract one 5KiB object from it.
2012-08-22 19:45:01 -04:00
Colin Walters b36b19eaf8 pull: Exit mainloop immediately if we encounter an error
Otherwise we'll just hang.
2012-08-22 19:45:00 -04:00
Colin Walters f115a8943a pack: Support --content-only
This should be useful for implementing more sophisticated packing
strategies.

Also clean up the pack size default handling.
2012-08-22 19:45:00 -04:00
Colin Walters ece71b22c5 pull: Set an error when we get an unsuccessful HTTP response
Otherwise we'll e.g. try to parse 404 HTML as an object which will
fail.
2012-08-22 19:45:00 -04:00
Giovanni Campagna a97bcc68d7 Add infrastructure for automatic kernel updates
If the distribution supports running arbitrary scripts at kernel
updates, we can hook into it and update the ostree side of things
automatically.
2012-08-20 23:01:58 +02:00
Giovanni Campagna affa5755a6 ostadmin: add update-kernel command to regenerate initramfs and boot config
This command regenerates kernel-dependent files. It is meant to
be run after kernel upgrades in the host distribution, to keep
the ostree installation running, and attempts to figure out the
right version automatically (and without changing the ostree checkout)
2012-08-20 23:01:57 +02:00
Giovanni Campagna 1057f8289c Don't fail for EPERM when hardlinking
As the manual page doesn't say, but the in-code kernel documentation
shows, hardlinking for normal users can fail for a variety of
reasons (including very common situations such as non regular file
or non writable file), if the owner of the file does not match
the user linking (e.g. when checking out a shadow repo with a root-
owned master).
If that happens, fail back silently to copying instead of aborting
the whole operation.

https://bugzilla.gnome.org/show_bug.cgi?id=682298
2012-08-20 23:01:57 +02:00
Giovanni Campagna 1d93a743dc ostree-run-triggers: fix typo in filename comparison function
The comparison function was comparing the first file to itself,
and this resulted in triggers being run in random order.

https://bugzilla.gnome.org/show_bug.cgi?id=682297
2012-08-20 23:01:57 +02:00
Stef Walter f5cf21e471 Include pull and other external commands in usage output 2012-08-19 15:05:01 -04:00
Giovanni Campagna edf69d6283 ostadmin: fix command line handling in the builtins
Common code was duplicating the command name and not shifting
arguments properly, which thus required the builtins to be aware
of it, instead of being treated like subcommands.
2012-08-18 19:21:22 +02:00
Stef Walter 66c8a1d3f6 Support non-builtin commands
* Support executing commands in the path
 * This makes 'ostree-pull' work as 'ostree pull'
2012-08-10 15:55:26 +02:00
Colin Walters 179fc65947 triggers: Print execution time for each trigger 2012-08-05 16:39:57 -04:00
Colin Walters 36b6ad41cb ostadmin: Use g_spawn_check_exit_status()
Just code cleanup.
2012-08-05 16:39:57 -04:00
Colin Walters a6c19aa00c ostadmin: Change command line for qemu deploy helper
The qemu helper really wants to copy kernel modules, but not
update the system bootloader.  Allow it to reuse ostadmin for
this.

Note that our previous path of shelling out to "cp -al" broke because
it refused to make cross-device links.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   src/libotutil/ot-gio-utils.c
#	modified:   src/libotutil/ot-gio-utils.h
#	modified:   src/ostadmin/ot-admin-builtin-deploy.c
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	embedded-dependencies/glib/
#	embedded-dependencies/libsoup/
2012-08-05 16:39:57 -04:00
Colin Walters 09707780b9 ostadmin: Add --ostree-dir directory
This will be used by the qemu deployment script.
2012-08-05 16:39:57 -04:00
Colin Walters 5284d21f8d ostadmin: Print an error message if run as non-root
See https://bugzilla.gnome.org/show_bug.cgi?id=680823
2012-07-30 10:29:45 -04:00
Colin Walters a179138a23 ostadmin: [incompat syntax change] Allow deploying any revision
The old command line syntax assumed you wanted the latest from
a given revision, but to bisect, you really want the ability
to deploy any given one.

Old:
$ ostadmin deploy gnomeos-3.6-i686-{runtime,devel}

New:

$ ostadmin deploy trees/gnomeos-3.6-i686-runtime
$ ostadmin deploy trees/gnomeos-3.6-i686-devel

And note that the deploy directory now changes to:
/ostree/trees/gnomeos-3.6-i686-devel

And now it's possible to:

$ ostadmin deploy trees/gnomeos-3.6-i686-devel trees/gnomeos-3.6-i686-devel^^^
2012-07-26 10:56:32 -04:00
Colin Walters 5bbdce2c06 pull: When --depth is specified, ensure we have all requested objects
We were previously optimizing by skipping object traversal if the refs
were unchanged, but if the user specifies a deeper depth than they did
before.
2012-07-26 10:17:41 -04:00
Colin Walters a310eb861b core: Add context when we fail to chmod()/chown()
This helps make things less confusing when we try to create a file not
owned by our uid, such as running ostree-pull as non-root on a
repository owned by root.
2012-07-19 11:01:39 -04:00
Colin Walters 0d86702115 core: Drop ot_clear_hashtable for g_clear_pointer() 2012-07-17 08:18:43 -04:00
Colin Walters 43a2fec6a8 core: Drop ot_clear_ptrarray in favor of g_clear_pointer 2012-07-17 08:16:54 -04:00
Colin Walters 2ced4abf11 core: Drop ot_clear_gvariant() in favor of g_clear_pointer 2012-07-17 08:14:33 -04:00
Colin Walters 57fcafd1ab core: Remove ot_clear_checksum() in favor of g_clear_pointer() 2012-07-17 08:08:57 -04:00
Colin Walters c8d7fc216d core: Use g_spawn_check_exit_status() 2012-07-17 08:06:20 -04:00
Colin Walters 6b31c580ca pull: Only take up one terminal line for status output
And print total bytes transferred at the end.
2012-07-16 22:35:18 -04:00
Colin Walters b2c2bf7e04 Fix libgsystem submodule 2012-07-15 18:29:15 -04:00
Colin Walters da43fb6db5 Hard require GLib 2.34
Anyone wanting to build against an earlier version can use the
embedded-dependencies system.
2012-07-15 18:22:41 -04:00
Colin Walters 464f4a81c9 Add libgsystem as git external
Don't replace ot_lfree and stuff yet though...to much code churn.
2012-07-15 11:59:05 -04:00
Colin Walters 95921bcbf0 pull: Correctly display concurrent libsoup requests
The "status text" code was assuming that libsoup was only doing one
thing at a time, but that's never been the case.  Change the code to
display the status of all active requests.
2012-07-12 11:19:15 -04:00
Colin Walters 664e9b404d core: drop dead/unused code
The daemon is a nice idea but needs a lot more thought.  Let's just
delete the unused code for now and come back to it later.
2012-06-30 13:49:25 -04:00
Colin Walters 311493338e core: Drop ot_gfile_new_for_path
Not necessary anymore since we switched to GIO_USE_VFS=local in the
binaries.
2012-06-30 13:42:24 -04:00
Colin Walters d5a1f1deda pull: Fix a memory leak 2012-06-28 15:18:10 -04:00
Colin Walters a98ca05676 pull: Fix use-after-free in async fetcher
Refcount the pending data structure.
2012-06-28 15:06:18 -04:00
Colin Walters d596615bab main: Fix a format string error 2012-06-27 22:26:16 -04:00
Colin Walters a7b917c856 core: Check out asynchronously
This can be a large performance win in certain circumstances:

 * Cold buffer cache (we don't block the whole process)
 * Requiring a copy instead of hardlink
2012-06-21 18:05:13 -04:00
Colin Walters 7cce6e5ba1 pull: Properly propagate errors 2012-06-20 15:42:41 -04:00
Colin Walters ee98a0b4f7 core: Don't silence output of ostree-run-triggers
We want to see which triggers are being run by default.
2012-06-19 16:14:31 -04:00
Colin Walters 4d59080f46 triggers: Quiet GConf trigger
The default is just way, way too verbose.
2012-06-19 15:03:16 -04:00
Adrian Perez bdc57338c1 Add fontconfig trigger
This wil regenerate the fontconfig caches, accounting for modifications in
the system font directories.
2012-06-13 17:58:53 +03:00
Colin Walters 35a80c8e39 core: Fall back to copying checkouts on EMLINK/EXDEV
The previous fix to just ignore symbolic links for hard linking isn't
really good enough, since it can happen for empty files too.

Since this is an optimization, when we get EMLINK, let's instead just
fall back to copying.  This also applies to EXDEV.
2012-06-12 14:50:41 -04:00
Colin Walters 270dc05176 ostbuild: Move to gnome-ostree module
Since we want to keep "ostree" buildsystem-independent, let's move
ostbuild out into the gnome-ostree module.

http://git.gnome.org/browse/gnome-ostree/commit/?id=04ba1926e33b442af1e357460e4415d4c0311e87
2012-06-08 19:01:25 -04:00
Colin Walters 6aaa2089f0 ostbuild: Fix previous commit (this should have been amended) 2012-06-08 16:51:51 -04:00
Colin Walters f4b6d88254 ostbuild: Fix -k option to git-mirror 2012-06-08 16:47:23 -04:00
Colin Walters 13b37ddaa2 ostbuild: Allow specifying components to git fetch 2012-06-07 10:19:28 -04:00
Colin Walters 210fbc3daf ostbuild: Add rootdir argument to deploy-qemu 2012-06-06 15:43:42 -04:00
Colin Walters 2c385c0078 ostbuild: Fix circular dependency between resolve and git-mirror
git-mirror was looking for the latest snapshot, which we don't
have until we resolve.

This leads to some code duplication.
2012-06-06 12:56:48 -04:00
Colin Walters a14ff0aeab core: Fix mkdtemp invocation 2012-06-06 10:03:15 -04:00
Colin Walters c436f8ac61 ostbuild: Add -k option to git-mirror
libwacom's sourceforge git server was down...
2012-06-05 22:55:53 -04:00
Colin Walters e485bace01 pull: Download and checksum asynchronously
This is quite a noticeable speedup when downloading loose objects.
2012-06-05 22:38:17 -04:00
Colin Walters df54408e5d core: Fix memory leak 2012-06-05 22:32:03 -04:00
Colin Walters 8f2dda3e25 core: Just require libsoup, not libsoup-gnome 2012-05-31 10:25:41 -04:00
Colin Walters cbd4ade053 core: Switch to using mkdtemp() so we only depend on GLib 2.28
We claim to build against 2.28, let's actually make it work.
2012-05-29 22:34:11 -04:00
Colin Walters f438d9aaa6 core: Drop some dead temporary file code 2012-05-29 22:09:31 -04:00
Matthias Clasen 90aff4f2f6 Trivial: fix a typo 2012-05-26 18:48:06 -04:00
Colin Walters d3b063cec0 ostbuild: Have resolve use git-mirror rather than duplicating code
This also brings us back to a sensible world of:

ostbuild resolve --fetch

Doing both fetch *and* writing out the updated revisions.
2012-05-26 12:10:51 -04:00
Colin Walters 9582effb8d core: Don't checkout symbolic links via hardlink
Doing so can easily get us up to the maximum ext4 hardlink count.
2012-05-26 11:55:12 -04:00
Colin Walters 1ef6bb0ef6 ostbuild: add --diffstat option for source-diff 2012-05-25 15:01:41 -04:00
Colin Walters 9c27f1de99 core: Remove leftover debug print 2012-05-25 09:55:10 -04:00
Colin Walters 88b3440eef core: ostree-pull: Add --depth option
This is useful for getting say the last 10 builds.
2012-05-24 20:58:20 -04:00
Colin Walters fb71519cd6 core: Attempt direct link() and fallback on EEXIST
Rather than always doing:

1) make temporary link
2) unlink() target
3) rename()

Just try making the link, and only do the second two if the file
already exists.  This reduces system call traffic a lot.
2012-05-24 20:14:51 -04:00
Colin Walters f7bbf41132 ostbuild: Add 'tag' concept to manifest, improve git mirroring
We should explicitly distinguish between the case where we have a git
branch we're following, versus an immutable tag.  In the latter case,
we can entirely avoid running 'git fetch' for it once we have it.
This is a noticeable speedup in our current scenario of pinning WebKit
to a tag.

The git mirroring code now has a --fetch-skip-secs=X option which
allows us to basically run it in a loop, without hitting remote git
repositories too often.
2012-05-24 19:54:36 -04:00
Colin Walters 0d1ba45c73 ostbuild: git-mirror: Also fetch patches git 2012-05-24 18:11:06 -04:00
Colin Walters 1a5ea54aff core: Make OstreeRepo struct private 2012-05-23 18:08:52 -04:00
Colin Walters 6c006815ce ostbuild: Fix --debug-shell option 2012-05-23 18:02:08 -04:00
Colin Walters 893774aab5 core: Make device/inode loose object cache work for parent repos too
Otherwise ostbuild suddenly becomes significantly slower when using a
shadow repo.
2012-05-23 07:48:16 -04:00
Colin Walters b45a0803fe ostbuild: Few more misc fixes 2012-05-22 08:26:17 -04:00
Colin Walters 95f66e1157 ostbuild: Fix typos in component lookup path 2012-05-21 18:41:59 -04:00
Colin Walters 9bd36f9bff ostbuild: Enhance source-diff with --log and --logp options 2012-05-18 20:25:02 -04:00
Colin Walters 6d59b4077c ostbuild: Add source-diff builtin
OMG OMG OMG
2012-05-18 20:12:35 -04:00
Colin Walters 58d28ad5a6 core: Rearrange code for clarity (doesn't actually fix leaks) 2012-05-18 20:12:17 -04:00
Colin Walters 790d2757f6 ostbuild: Drop dead branch-prefix and pull-components
And other various tweaks.
2012-05-18 16:30:45 -04:00
Colin Walters 32020e55c8 ostbuild: Various fixes, removal of dead code 2012-05-18 16:30:45 -04:00
Colin Walters ecfd9b2cf3 ostbuild: Remove /var from components
We expect them to create on demand.
2012-05-18 16:30:45 -04:00
Colin Walters a3246d590e ostbuild: Fix git-mirror 2012-05-18 16:30:45 -04:00
Colin Walters bcab6748a5 ostbuild: Some work on qemu deployment 2012-05-18 16:30:45 -04:00
Colin Walters 3a20f6a913 ostadmin: Update for new trees/ location of trees 2012-05-18 16:30:45 -04:00
Colin Walters 6e2efc6134 ostbuild: Add import-tree
This is the new workflow:

$ ostbuild import-tree wip-gnome-menus-3.6
$ $EDITOR ~/build/ostbuild/snapshots/wip-gnome-menus-3.6-2012.1-abcd.json
$ ostbuild build
2012-05-18 16:30:45 -04:00
Colin Walters f4aba2a339 ostbuild: Tighten build process significantly
First, "resolve" now just picks git commits.  We don't expand
config-opts and patches, nor do we generate tree contents.  This makes
the generated files *much* more human editable.

Next, fold "build-components" and "compose" into just "build".  One
never really wants to just build components.  This lets us eliminate
binary snapshots as a concept; instead we always have a combination of
source snapshot and component/ refs.
2012-05-18 16:30:45 -04:00
Colin Walters 92244c80cc ostbuild: More work on partial builds 2012-05-18 16:30:44 -04:00
Colin Walters eae69513a7 ostbuild: Make partial builds work
If we have component-revisions in our source+binary snapshot, then
we can skip them.
2012-05-18 16:30:44 -04:00
Colin Walters 5d0744ea29 ostbuild: Write out related objects on composes 2012-05-18 16:30:44 -04:00
Colin Walters 829a760b56 ostbuild: Minor fixes 2012-05-18 16:30:44 -04:00
Colin Walters 65165ff1df ostbuild: Make binary snapshots an extension of source
This significantly simplifies things; we no longer need to retrieve
individual components via 'pull-components', etc.
2012-05-18 16:30:44 -04:00
Colin Walters 4f95106cda core: Prefer packed metadata 2012-05-18 16:30:44 -04:00
Colin Walters f95090095e core: Map metadata from repository as trusted
ot_util_variant_map() assumed untrusted; add a boolean, and use it for
the repository internals.
2012-05-18 16:30:44 -04:00
Colin Walters cf53ed5cef core: Limit recursion during traversal
The related objects commit introduced OSTREE_MAX_RECURSION; use it.
2012-05-18 16:30:44 -04:00
Colin Walters cd38cb1489 core: Add write-refs builtin
This will be used by import-tree to pipe refs to write.
2012-05-14 21:58:22 -04:00
Colin Walters d7a15b381e core: Allow adding related objects to commits
This will be used to store the set of components.
2012-05-14 21:58:22 -04:00
Colin Walters 50cc2356f4 core: Really fix saving variants with REPLACE_DESTINATION 2012-05-14 20:49:00 -04:00
Colin Walters 6d9de91672 core: Make argument parsing more robust against "lt-ostree" name
When running uninstalled, we were parsing our argv[0] incorrectly.
2012-05-14 11:31:53 -04:00
Colin Walters 102180c5f2 core: Replace pack superindex via rename() rather than truncating
This helps allow cloning repositories via "cp -al".
2012-05-14 11:22:18 -04:00
Colin Walters 2fbf864251 core: Clarify error message 2012-05-14 11:22:18 -04:00
Matthias Clasen 5a1a300892 ostree-pull: Avoid an uninitialized variable warning 2012-05-12 10:51:01 -04:00
Matthias Clasen 225cebd5ef core: fix a typo
ostree config had two 'set' subcommands, but no 'get'.
2012-05-12 10:50:53 -04:00
Colin Walters 4fa14eb712 core: Don't look in packs if we found loose object
Unless the caller wants us to; which at present none do, but let's be
forward looking and add an option.
2012-05-12 10:46:25 -04:00
Colin Walters 6fbe15fc05 ostbuild: Add ostree-revision in buildroots, bin-to-src
First, for binary snapshots we need to include the exact revision of
the architecture buildroot.  To do that, introduce
"architecture-buildroots2".

Second, for bin-to-src, we'd like to allow "partial" builds.  So while
we do expand everything to source, *also* include the binary
ostree-revision.  This will allow building just one component, while
reusing the previously built binaries.
2012-05-10 14:29:23 -04:00
Colin Walters d1b23f0807 ostbuild: Fix pull-components
We need to pull the actual commits, not the refs.
2012-05-10 10:30:02 -04:00
Colin Walters 488ce33795 pull: Use API to stage files with length
Not doing so at the moment triggers a bug in the staging path, and
it's more efficient anyways.
2012-05-10 10:29:26 -04:00
Colin Walters c6df0b0ae0 pull: Add --prefer-loose option
This is a hack...
2012-05-10 09:54:56 -04:00
Colin Walters efc2810f02 core: unpack: Add --keep-packs option
Matches the pack --keep-all-loose.
2012-05-10 09:47:24 -04:00
Colin Walters a04ef7ba10 core: Fix ostree-pull to be able to look up remotes in parent repo
We should probably add a generalized inheritance mechanism.
2012-05-10 08:50:37 -04:00
Colin Walters f33a2f9a08 core: pack: Keep loose objects which are referenced externally
By default, don't delete loose objects which have hard links.  This
has the natural semantics that if you delete all the checkouts, you
probably want it packed.

Conversely, if it has a hard link, we do want further checkouts to
share storage, even if we pack in between them.
2012-05-09 23:20:36 -04:00
Colin Walters d8b97316d9 core: unpack: Actually delete no-longer-needed pack files 2012-05-09 23:19:54 -04:00
Colin Walters fdf05be216 ostbuild: resolve: Add --fetch-patches option
This is kind of lame, but...
2012-05-09 19:46:29 -04:00
Colin Walters 7149530976 ostbuild: Allow using dirty-git: for patches too 2012-05-09 19:40:24 -04:00
Colin Walters 92891e60ca ostbuild: Use .lastfetch file per branch
This way we don't try to update gtk+ twice, once for gtk master and
once for gtk-2-22.
2012-05-09 19:36:46 -04:00
Adrian Perez bd6bd0eed5 ostree-pull: Fix segfault by initializing pull_data earlier
In the case of not being able to check the repository or not being able
to parse command line arguments, attributes from "pull_data" would be used
with garbage in them. This patch makes initialization of the sctructure to
happen earlier so it is safe to use in those cases.
2012-05-09 14:10:23 -04:00
Colin Walters d9bc7e0acd ostbuild: build-components: Ensure specifying components forces rebuild 2012-05-09 12:46:04 -04:00
Colin Walters d2da92be07 Move gnomeos/ to "gnome-ostree" module
Now that we're hopefully going to be changing the format less.  The
layering here is now more clear, rather than having things entangled.
2012-05-09 09:29:27 -04:00
Colin Walters dfbf1f7ac6 ostadmin: Use /ostree for current working directory of checkouts
Otherwise we put them in the wrong place.
2012-05-08 10:21:38 -04:00
Colin Walters 9179d1b27a ostadmin: Make a /ostree/current symbolic link 2012-05-08 09:14:03 -04:00
Colin Walters 18b6f5fd0c ostadmin: Initial code 2012-05-07 20:43:03 -04:00
Carl-Anton Ingmarsson 1de0cc238b ostbuild: further fixes to pull-components
Call self.parse_config() so that all necessary directories are parsed.

Also don't call nonexistant self.parse_active_branch() and just use
self.active_branch since it's already have been initialized.
2012-05-07 17:54:04 -04:00
Colin Walters f487500e50 ostbuild: Default to (previous) --skip-built
For components specified on the command line, we now force a rebuild.
There's also a new option to skip if the git revision matches, but
metadata changed (useful for now to avoid cascading builds if you know
you don't need it).
2012-05-07 17:51:12 -04:00
Matthias Clasen 2ca6f04265 ostbuild: make pull-components work
This builtin did not work for me. It did not initialize self.repo,
it used the nonexisting parse_active_branch function unconditionally,
and it did not actually find the list of components in contents.json.

This commit fixes all three of these issues.
2012-05-06 14:09:28 -04:00
Matthias Clasen ae0b4ac628 Fix a typo 2012-05-06 13:57:09 -04:00
Matthias Clasen 07f67f3baf ostree: avoid a segfault
When running ostree --repo=/ostree/repo without further arguments,
we end up calling strcmp with one argument being NULL.
2012-05-06 13:56:57 -04:00
Matthias Clasen 4a03176489 checkout: Deal gracefully with bad input
I had a /ostree/gnomeos-3.4-i686-devel directory, and this caused
ostree --repo=repo checkout gnomeos-3.5-i686-devel
to segfault.
2012-05-06 09:23:49 -04:00
Colin Walters c0e73c9fa0 core: pack: Fix calculation of size of pack objects
In archive mode, due to the previous change, we're now only
looking at metadata size, which is clearly wrong.
2012-05-05 16:00:53 -04:00
Colin Walters a0ad28c16c core: pull: Fix regression from memory leak fixes 2012-05-05 14:59:14 -04:00
Colin Walters 38dd179017 core: Compile again on GLib 2.28 2012-05-05 11:45:19 -04:00
Colin Walters ba1c75c61b ostbuild: Drop use of link cache, it's gone now 2012-05-05 09:54:42 -04:00
Colin Walters 9aa9397e42 ostbuild: Create deploy-qemu subcommand 2012-05-04 16:16:16 -04:00
Colin Walters a2d937c2f0 triggers: Print name of each trigger we're running 2012-05-04 16:16:16 -04:00
Adrian Perez 5835bb72b4 ostbuild: Make --shell-on-failure flag to work
Fixes an issue which would cause ostbuild to fail to spawn the
debug shell and print a traceback instead.
2012-05-04 16:16:16 -04:00
Colin Walters 0597a3f71c ostbuild: More work on deploy commands 2012-05-04 16:16:16 -04:00
Colin Walters 3a365521a8 ostbuild: Use --from-file for buildroot compose for easier debugging 2012-05-04 16:16:16 -04:00
Colin Walters 8785fefda8 ostbuild: Rename shadow-repo-init -> init 2012-05-04 16:16:16 -04:00
Colin Walters 851a9c2ce9 ostbuild: Checksum full component metadata for --skip-built
If we're using --skip-built, we really do want to rebuild if anything
changed (like the build dependency, configure arguments etc.)
2012-05-04 16:16:16 -04:00
Colin Walters 29b230107e ostbuild: Break out git-mirror from resolve
Other bits
2012-05-04 16:16:16 -04:00
Colin Walters 986cd2172b ostbuild: Use expanduser 2012-05-04 16:16:16 -04:00
Colin Walters 938f4eaf44 ostbuild: Lots more 2012-05-04 16:16:16 -04:00
Colin Walters b845e0a2bb ostbuild: Resolve takes --manifest arg 2012-05-04 16:16:16 -04:00
Colin Walters a6a8e00edf ostbuild: Add tree-to-bin and bin-to-src 2012-05-04 16:16:16 -04:00
Adrian Perez 0e266d3f92 ostbuild: Fix DB saving with /tmp and builddir in different volumes
This fixes the case where /tmp resides in one volume, and the build
directory in a different one: by storing the temporary file in the
same directory as the target one, we avoid the case in which os.rename()
would cross file system boundaries.

Reviewed-by: Colin Walters <walters@verbum.org>
2012-05-04 16:16:16 -04:00
Colin Walters 717cec46c3 ostbuild: Major rework 2012-05-04 16:16:16 -04:00
Colin Walters 7280ce358d ostbuild: Show ostbuild log messages in warningfilter again 2012-05-04 16:16:16 -04:00
Colin Walters d040b61d19 core: checkout: Add --from-file option too
Easier for debugging if we don't have to redirect stdin.

Conflicts:

	src/ostree/ot-builtin-checkout.c
2012-05-04 16:15:20 -04:00
Colin Walters 0660d9e5cf core: Improve error message if we hit an unreadable file 2012-05-04 16:14:47 -04:00
Colin Walters 26c484faed core: Add a mutex to cache data structures in preparation for threading
Conflicts:

	src/libostree/ostree-repo.c
2012-05-04 16:14:28 -04:00
Colin Walters 6cdbedf4e6 core: pull-local: Be a bit more verbose, don't open objects we already have 2012-05-04 16:13:44 -04:00
Colin Walters ac38a7e1b1 core: Avoid checksumming hardlinks that point into repository
By default, when doing a commit, scan all of our loose objects and
build up a (device,inode) -> checksum hash.  Then when we're doing a
commit, if we see a file with that (device,inode) pair, we can avoid
checksumming it.
2012-05-04 16:10:30 -04:00
Colin Walters 0fc291b954 core: Drop --link-cache option, we do it by default now for archives 2012-05-04 16:10:30 -04:00
Colin Walters 27358a8de6 core: [INCOMPATIBLE CHANGE] Re-split archive content into .file and .filecontent
This will allow us to use hard links again for user-mode checkouts,
rather than the hackish link cache.  It was pretty silly anyways to
have file objects be stored with just a small metadata header
prepended, but uncompressed.

Either they should be hardlinkable, or compressed (in pack files).
2012-05-04 16:10:30 -04:00
Colin Walters 3321fa08d7 core: Handle zero-sized archives, improve fsck error message 2012-05-04 13:40:25 -04:00
Colin Walters 8d926c3e36 core: Add valgrind framework, plug various memory leaks 2012-05-04 10:04:32 -04:00
Colin Walters 7ce587da30 core: Optimize commits to raw repositories
Avoid creating a temporary intermediate file in the case where we have
the total object length available.
2012-05-04 06:15:47 -04:00
Colin Walters 67f61976f4 core: Clean up object storage API
Rather than passing xattr/file_info for all objects, change the API to
assume we're passing the defined object stream for each type.  Namely,
for OSTREE_OBJECT_TYPE_FILE, we're now giving the "archive file" data.

This significantly cleans up the code for committing to archive mode
repositories, at the cost of having to (at present) create an
intermediate temporary file when committing to raw repositories.
2012-05-03 19:59:13 -04:00
Colin Walters 99cb8a80fa daemon: Use g_thread_new() for GLib 2.32 2012-05-03 16:07:18 -04:00
Colin Walters ff3867c052 core: Increase type safety of some local alloc functions 2012-05-03 16:05:53 -04:00
Colin Walters 749bf56917 core: Fix gcc uninitialized-variable warning 2012-05-01 18:53:00 -04:00
Colin Walters d4321629f4 core: Rename local-clone to pull-local
Also change it to copy selective refs, rather than enumerating
all objects.
2012-05-01 17:44:29 -04:00
Colin Walters 8d6bdaedfe core: Fix 32/8 bit confusion in pack index listing 2012-05-01 17:44:14 -04:00
Colin Walters 233558d230 core: diff: Fast path unmodified directories 2012-04-29 12:15:12 -04:00
Colin Walters 9cb87ffc07 core: pack: Add --metadata-only argument
Useful for bare repositories.
2012-04-29 12:15:12 -04:00
Colin Walters da3b17be1e core: Fix uninitialized variable 2012-04-26 11:52:26 -04:00
Colin Walters bf3abd02cd core: local-clone: Delete leftover code assuming file objects are loose 2012-04-25 09:44:46 -04:00
Colin Walters 5947b5b145 core: Add ability for repositories to have a "parent"
This will be useful for ostbuild; a user can create their own archive
mode repository which transparently inherits objects from the
root-owned one in /ostree.
2012-04-18 23:12:34 -04:00
Adrian Perez 99142ef417 switchroot: Properly check for number of arguments
The ostree-switch-root tool expects three arguments (argc=4): new root, OS
tree target, and init(8) binary to launch inside it. Also, the error message
when not enough arguments are passed now tells about the second argument
being the target OS tree.

Reviewed-by: Colin Walters <walters@verbum.org>
2012-04-18 15:20:46 -04:00
Colin Walters 255b7d1309 core: Pull pack files individually 2012-04-16 18:17:11 -04:00
Colin Walters 3f02a1fd56 core: Cache pack indexes
This is a 10x speedup on heavy users of ostree_repo_find_object(),
such as ostree-pull.
2012-04-16 18:17:06 -04:00
Colin Walters 920cbbc242 triggers: Test for gconftool-2
This was done for the rest of the triggers.
2012-04-13 16:11:03 -04:00
Colin Walters 863384b90d ostbuild: Take advantage of link cache
This greatly speeds up construction of buildroots.
2012-04-13 16:10:40 -04:00
Colin Walters 262f426997 core: Add --link-cache option to checkout
This is a convenient way to have a lookaside directory of hard links,
which can greatly speed up checkouts.  In the future we probably want
to push this down into the repository.
2012-04-13 14:33:38 -04:00
Colin Walters 38ef75e6e0 core: Re-unify on one OSTREE_OBJECT_TYPE_FILE
Having the archived vs not distinction in the object system wasn't
useful in light of pack files.  In fact, we should probably move
towards generating a pack file per commit by default.
2012-04-11 22:27:59 -04:00
Colin Walters f15c184584 core: Clean up checksumming
Don't expose GChecksum in APIs.  Add a new stream class which allows
us to pass an input stream somewhere, but gather a checksum as it's
read.

Move some bits of the internals towards binary csums.
2012-04-11 22:04:06 -04:00
Colin Walters fa4cbc8b89 core: Drop wrapping of metadata variants 2012-04-11 22:04:05 -04:00
Colin Walters 5a82b141ae core: Split pack files into data/metadata
This will allow us to download metadata first (separately), and in the
future we can have an improved metadata pack format that compresses
heavily.
2012-04-11 22:04:05 -04:00
Colin Walters 11c0fbc738 core: Switch to 'ay' for checksums, drop versions/metadata 2012-04-11 22:04:00 -04:00
Colin Walters 188621f0b2 core: Drop 'compose' builtin
We'll just add this functionality to commit.
2012-04-11 19:54:55 -04:00
Colin Walters 0e8149eb83 core: Clean up checksum API
We want to move towards guchar * for binary checksums.
2012-04-11 19:54:55 -04:00
Colin Walters 6542b8f5c9 core: unpack: Regenerate pack index after unpacking 2012-04-11 19:54:30 -04:00
Colin Walters d63ec5c2ff core: Fix uninitialized variables 2012-04-11 19:54:30 -04:00
Colin Walters 394fe75471 core: Port builtins to local alloc macros 2012-04-09 15:57:46 -04:00
Colin Walters 8b6bf09d7a core: Port libostree to local alloc 2012-04-09 15:57:46 -04:00
Colin Walters 87f45052af core: Port libotutil to local-alloc 2012-04-09 15:57:46 -04:00
Colin Walters ca08ad6c5e core: Add macros for local allocation
This is GCC-specific, but it makes the code significantly
cleaner.
2012-04-09 15:56:28 -04:00
Colin Walters 72398ab62c core: Fix xattr API to conform to coding style 2012-04-09 15:56:27 -04:00
Colin Walters 3c39a5bfa7 core: Fix a minor memory leak 2012-04-09 14:18:00 -04:00
Colin Walters 74485bed35 core: pull: Add progress bar, allow pulling individual commits 2012-04-08 17:26:02 -04:00
Colin Walters a69e4452b4 core: checkout: Add --from-stdin option
This allows checking out many branches in one go, useful in
combination with the --union flag for ostbuild to combine a lot of
components.
2012-04-06 15:11:11 -04:00
Colin Walters 92ab820c0b ls: Add mode to print filenames as binary
This is useful to extract the file listing to another program.
2012-04-06 15:10:20 -04:00
Diego Escalante Urrelo b64cd799dc ostree-pull: GOptionEntry must be NULL terminated 2012-04-05 09:05:22 -04:00
Colin Walters bae584c64a core: Associate branches with remotes, move trigger runs into checkout
Also add --atomic-retarget option to checkout. This does the magical
symlink dance to do atomic swaps between trees.
2012-04-03 23:46:34 -04:00
Colin Walters 3f23ac156a core: Clean up stale packfiles 2012-04-03 23:46:34 -04:00