Commit Graph

914 Commits

Author SHA1 Message Date
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
c690416b72 build: Add dist-snapshot
Take the current git HEAD and make a tarball from it; should be useful
for putting snapshots into Poky.
2012-08-28 10:14:11 -04:00
Colin Walters
60368fae76 Use correct libgsystem
Accidentally pushed a local patch.
2012-08-28 09:58:07 -04:00
Colin Walters
2527f81abc Merge remote-tracking branch 'aperezdc/fixes' 2012-08-28 09:45:39 -04:00
Adrian Perez
b314b25e6a configure.ac: Fix checks for libarchive
When configuring without passing --enable-triggers-only, checks for
libarchive were not being done. Shuffling around the checks solves
the issue.
2012-08-28 16:36:07 +03: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
4b9faa421e Release 2012.9 2012-08-26 13:58:23 -04:00
Colin Walters
c63cca53d7 build: Add --enable-triggers-only
For bootstrapping gnome-ostree, we need to install the triggers early
on, before we actually build the real ostree binary.
2012-08-26 13:58:23 -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
419965e6e3 build: Make /etc/kernel scripts default to automatic
When not cross compiling, we can test for /etc/kernel.  This fixes the
build automatically on RHEL6 for example.
2012-08-23 15:19:41 -04:00
Colin Walters
344a7b3fd3 packages: Add files that should have been in previous commit
These were intended to be with the embedded-dependencies commit.
2012-08-23 08:52:23 -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
Colin Walters
a571c83d82 embedded-dependencies: Fix ACLOCAL_FLAGS, update for libgsystem
* Handle the libgsystem submodule
* ACLOCAL_FLAGS was broken
* Add srpm-embedded
2012-08-19 15:05:01 -04: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
Colin Walters
22aa38a7da configure: Fix libsoup detection
* The configure arg was named incorrectly; we don't rely on
libsoup-gnome, just libsoup.
* We need to use AS_IF
2012-08-14 13:11:45 -04:00
Colin Walters
05bf1fed99 autogen: Fetch submodules before running automake
Otherwise automake can't find src/libgsystem.
2012-08-14 12:52:46 -04: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
Stef Walter
31d129fab4 Automatically populate the git submodules in autogen.sh 2012-07-31 15:26:42 +02:00
Colin Walters
1804d944d2 TODO: update 2012-07-31 00:15:02 -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