1730 Commits

Author SHA1 Message Date
Colin Walters
a4d82ab6b4 Release 2014.11 v2014.11 2014-10-30 14:16:03 -04:00
Giuseppe Scrivano
0a7c1851d9 diff: Use gs_unref_object not gs_free on a GFile
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-30 12:17:32 -04:00
Giuseppe Scrivano
cb053ae0f6 pull: Fix a used before initialization warning
src/libostree/ostree-repo-pull.c:1676:22: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-30 12:16:59 -04:00
Giuseppe Scrivano
65c0594011 ostree-repo-pull: Fix inverted assert condition for maxdepth
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-30 11:46:02 -04:00
Colin Walters
edc3b9a56e Release 2014.10 2014-10-29 14:05:59 -04:00
Colin Walters
bcf40b4902 pull: Add depth support
For mirroring in particular, we really want to be able to traverse
all history.

$ ostree --repo=repo pull --mirror --depth=-1

https://bugzilla.gnome.org/show_bug.cgi?id=739240
v2014.10
2014-10-28 11:16:55 -04:00
Colin Walters
64dec0add8 libostree: Add ostree_repo_pull_with_options()
We potentially need a lot of argument types for pull.  Rather than
have a C function with tons of arguments, let's use a GVariant a{sv}
as a handy extensible (and immutable) bag of properties.

This is prepratory work for adding an option to pull to traverse
history.

https://bugzilla.gnome.org/show_bug.cgi?id=737844
2014-10-28 11:16:51 -04:00
Colin Walters
fb3ad0037f grub2: Fix bad substitution in review followup
This caused GRUB2+EFI installations to fail.
2014-10-27 12:19:32 -04:00
Colin Walters
159c7537c9 Release 2014.9 v2014.9 2014-10-24 13:33:49 -04:00
Giuseppe Scrivano
7973a58607 checkout: permit checkout of a single file
fixes a coredump when using a command like:

$ ostree --repo=repo checkout -U --subpath=/usr/lib/passwd \
  fedora-atomic/rawhide/x86_64/docker-host usrlib-new

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-24 11:18:45 -04:00
Colin Walters
0c89abee6d Add (non-atomic) support for GRUB2 + UEFI
We need basic support for UEFI - many newer servers don't support
BIOS compatibility mode anymore.

However, this patch only implements non-atomic because UEFI is FAT, and
we can't do the previous design for OSTree of atomic swap of
/boot/loader.

The Fedora/RHEL UEFI layout has the kernels on a "real" /boot
partition, and /boot/efi/EFI/$vendor just holds the grub2 UEFI binary
and grub.cfg.

Following this, /boot/loader is still on the OS boot partition, and we
still atomically swap it.  This potentially paves the way to atomic
upgrades in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=724246
2014-10-23 21:42:30 -04:00
Colin Walters
b43ce2329e tests: Add some versioning metadata and test it appears in status output
Followup to previous commits.
2014-10-23 11:24:44 -04:00
James Antill
81a484459a admin status: Print the version 2014-10-23 11:24:29 -04:00
James Antill
aab6e7bdf2 dump: Print the version when dumping a commit, log/show/etc. 2014-10-23 10:21:17 -04:00
James Antill
52c0d89a8c admin: Add ot_admin_checksum_version to get a dup of the version for a commit 2014-10-23 10:21:17 -04:00
Giuseppe Scrivano
49de180191 corrupt-repo-ref.js: more aggressive file corruption
changing only a byte may not generate a corrupted file, so play very
safe and change 10 bytes.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-22 20:02:06 +02:00
Giuseppe Scrivano
0785c398b0 fsck: report the correct error when a present file cannot be loaded
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-22 18:06:29 +02:00
Giuseppe Scrivano
c4b7717076 tests: test-admin-deploy-switch doesn't use deprecated "current" symlink
commit dfeb27eca55d923c57735e491e438ae54f8cc201 removed it, so change
the test to not use it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-21 16:18:30 -04:00
Giuseppe Scrivano
22a82341b1 tests: fix --help test
Check for "Usage" only in the root command, builtins may not output
it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-21 16:18:30 -04:00
Giuseppe Scrivano
26bdfae5bc make ostree_cmd__private__ ret value const 2014-10-21 16:18:30 -04:00
Colin Walters
5fb8bb955e repo: When writing to a non-root owned repo, chown() objects to match
Some package systems need to be run as root, so the process linking to
libostree may also be root.  However, it's reasonable to have the
target repository be owned by a uid other than root.

This patch makes it Just Work by chowning the file content to match.

Note this only operates on archive-z2 repositories, because you can't
usefully serve bare repositories via HTTP.

https://bugzilla.gnome.org/show_bug.cgi?id=738954
2014-10-21 15:43:43 -04:00
Matthew Barnes
a4d904ee38 build: Include SELinux cflags with libostree build too
This is likely another issue with newer automake.

https://bugzilla.gnome.org/738875
2014-10-20 15:23:55 -04:00
Colin Walters
cdfcf09316 Add "ostree remote delete" and corresponding API
For Anaconda, we have an ugly bootstrapping problem where we need to
add the remote to the repository's config, then do a pull+deploy, then
remove and re-add the config, because /etc/ostree/remotes.d doesn't
exist yet in the target system.

https://bugzilla.gnome.org/show_bug.cgi?id=738698
2014-10-17 19:09:42 -04:00
Colin Walters
49540f076f Release 2014.8 v2014.8 2014-10-16 16:54:55 -04:00
Colin Walters
884a9b27e9 repo: Disable uncompressed object cache on non-writable repos
While we did support disabling the uncompressed-objects-cache
per-repository:

1) We didn't actually respect that operation when doing
   CHECKOUT_MODE_USER on archive-z2 repositories
2) It'd be better to automatically detect we can't write to the
   repo and disable the uncompressed cache then.
2014-10-16 14:54:34 -04:00
Colin Walters
d546abfa2a libostree: Add initial GRUB2 support
In this approach, we drop a /etc/grub.d/15_ostree file which is a
hybrid of shell/C that picks up bits from the GRUB2 library (e.g. the
block device script generation), and then calls into libostree's
GRUB2 code which knows about the BLS entries.

This is admittedly ugly.  There exists another approach for GRUB2 to
learn the BLS specification.  However, the spec has a few issues:

https://www.redhat.com/archives/anaconda-devel-list/2014-July/msg00002.html

This approach also gives a bit more control to the admin via the
naming of the 15_ostree symlink; they can easily disable it:

Or reorder the ostree entries ahead of 10_linux:

Also, this approach doesn't require patches for grub2, which is an
issue with the pressure to backport (rpm-)OSTree to EL7.
2014-10-16 14:15:00 -04:00
Giuseppe Scrivano
92c5a9f992 http: set the HTTP status on directory listing
Fix a HTTP response header like the following:

HTTP/1.1 0 (null)
Server: ostree-httpd libsoup/2.48.0
Date: Tue, 07 Oct 2014 11:19:22 GMT
Content-Type: text/html
Content-Length: 12533

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-07 13:19:36 +02:00
Giuseppe Scrivano
7b0e70b72f tests: do not leave running httpd after tests exit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-07 12:05:59 +02:00
Colin Walters
5dba2442a1 trivial-httpd: Another followup fix - need to listen on all interfaces
This was the intended design, but it regressed when updating.
2014-10-06 17:43:02 -04:00
Giuseppe Scrivano
68b37dc001 libostree: fix a gobject-introspection warning
src/libostree/ostree-repo.c:1759: Warning: OSTree:
  ostree_repo_import_object_from: unknown parameter 'checksum' in
  documentation comment, should be 'sha256'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-06 19:03:34 +02:00
Colin Walters
5451a4e309 Release 2014.7 v2014.7 2014-10-03 19:10:13 -04:00
Colin Walters
1dceb99056 Add missing file from previous commit 2014-10-03 14:38:30 -04:00
Colin Walters
b3ad113f78 Add "unconfigured-state" concept to origin files
Some operating systems may come with external tools for subscription
management that drive access to the content.  In that case, the origin
file may not be useful (for example, it could refer to an installer
ISO).

This patch will allow OS installers to inject that state, with a
useful error message, directing the system administrator to an
external tool.

See: https://github.com/projectatomic/rpm-ostree/issues/31

https://bugzilla.gnome.org/show_bug.cgi?id=737686
2014-10-03 14:03:55 -04:00
Colin Walters
63abc1b513 pull: Support full recursive mirrors of repositories with summary file
Now that we have a summary file, we can use it to allow a simple:

ostree pull --mirror

To download the latest commit on every branch.  Also, for a case I'm
dealing with there's only one branch, but I don't want mirror users to
have to hardcode it.

https://bugzilla.gnome.org/show_bug.cgi?id=737807
2014-10-03 13:56:40 -04:00
Colin Walters
7ab1fb2369 Add API to directly link() objects between repositories
And use it in pull-local.  As one might expect, this is blazingly fast
if they're on the same filesystem.

I'll be using this to "promote" builds between different repositories.
2014-10-01 23:20:35 -04:00
Colin Walters
1b8759a67e upgrader: Hold a ref to the origin
We unref it in _finalize, so we need to hold a ref.  I *thought*
this was the source of
https://github.com/projectatomic/rpm-ostree/issues/30

But apparently not =/
2014-09-30 11:02:14 -04:00
Owen W. Taylor
cc180f5d38 Test 'ostree admin --print-current-dir'
Add a test for the --print-current-dir option

https://bugzilla.gnome.org/show_bug.cgi?id=731051
2014-09-26 11:55:11 -04:00
Owen W. Taylor
c3f8019c19 Add test case for 'admin instutil set-kargs'
Test out the newly added options to 'instutil set-kargs' along with
the existing functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=731051
2014-09-26 11:55:11 -04:00
Owen W. Taylor
d64d003af0 ostree admin: Add a --print-current-dir option
Add an option --print-current-dir that prints the current deployment
directory to stdout and exits.

https://bugzilla.gnome.org/show_bug.cgi?id=731051
2014-09-26 10:40:38 -04:00
Owen W. Taylor
262cba09c0 ostree admin instutil set-kargs: make more flexible
Add command line arguments:
 --import-proc-cmdline: import values from /proc/cmdline
 --merge: import current values
 --replace=ARG=VALUE: replace value
 --append=ARG=VALUE: append a new argument

Extra command line arguments are treated like --append=, which
gives backwards compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=731051
2014-09-26 10:40:37 -04:00
Colin Walters
edf9cf5a7f trivial-httpd: Further fixes for previous commit 2014-09-25 16:03:06 -04:00
Colin Walters
1b19a989fb Followup to SoupServer port deprecation
My patch didn't actually work with newer libsoup.
2014-09-25 15:57:58 -04:00
Owen W. Taylor
7fce7e0338 Add test for the behavior of --help
Recursive over ostree and all subcommands, and check that --help
is supported, properly outputs to standard out, and exits
with a 0 exit status. Check that for commands with subcommands,
they produce the help output to standard error when run with no arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=737194
2014-09-25 14:28:58 -04:00
Owen W. Taylor
3400f2d2ae --help should always go to stdout
The standard convention is that the  output of --help should go to standard
output (so that it can be piped to a pager and searched.) See, e.g., the
GNU coding standards.

https://bugzilla.gnome.org/show_bug.cgi?id=737194
2014-09-25 14:28:58 -04:00
Owen W. Taylor
c9018c785c ostree admin instutil: make --help work for subcommands
Even though the subcommands don't take arguments, use a GOptionContext
so that --help works as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=737194
2014-09-25 03:08:06 -04:00
Owen W. Taylor
9d72ff2d8e Fix help output for nested subcommands
Only 'ostree admin' was appearing in the help message for commands
nested within ostree admin.

https://bugzilla.gnome.org/show_bug.cgi?id=737194
2014-09-25 03:08:06 -04:00
Owen W. Taylor
1dca556691 Pass --help to the most nested subcommand
'ostree admin <x> --help' and 'ostree admin instutil <x> --help' should
give help on the deepest subcommand, not on 'ostree admin'.

https://bugzilla.gnome.org/show_bug.cgi?id=737194
2014-09-25 03:08:06 -04:00
Owen W. Taylor
40f490ed11 ostree admin: Fix return value from 'ostree admin [instutil]'
'ostree admin' and 'ostree admin instuil' with no arguments were meant to fail,
but the logic was wrong; add an assertion on the return value from all ostree
commands to catch similar problems in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=737194
2014-09-25 03:08:06 -04:00
Colin Walters
8f4ffa6950 deploy: Copy parent directories for modified config files
Previously, in the case where a parent directory of a modified config
file was removed, we would throw an exception.  This happens when
switching from a tree that has some software (e.g. firewalld), to one
that does not.

While it's nice to have this warning that your config file probably no
longer applies, there's no need to make it so...fatal.

It's particularly problematic that the only easy workaround is to
remove the config files from your current tree - which breaks
rollback.

The solution then is for for us to take ownership of the parent
directories too into the new /etc.  Admins can clean up these files
afterwards at any time.

https://bugzilla.gnome.org/show_bug.cgi?id=734293
2014-09-16 12:06:10 -04:00
Colin Walters
b756a13a65 Extract opendirat() helper function into libotutil
We were duplicating the code to do an opendirat() in a few places.
2014-09-16 11:34:39 -04:00