Commit Graph

1516 Commits

Author SHA1 Message Date
Colin Walters 5bda4b4347 Release 2014.2 2014-03-01 13:55:55 -05:00
Colin Walters 79fa7ca692 Add /run/ostree-booted
The idea with this is that things like yum should be able to look for
it and determine whether or not they should assume that they can
change things on the system.

https://bugzilla.gnome.org/show_bug.cgi?id=725380
2014-02-28 03:49:25 -05:00
Colin Walters 4f04a55a5d upgrade/switch: Fix status line being overwritten with pull progress 2014-02-27 16:27:26 -05:00
Colin Walters d8852d099a checkout: Use fd-relative open of newly created directory
We were walking the full path again on our directories, no need to do
that.
2014-02-27 11:49:49 -05:00
Colin Walters b6704f8346 checkout: Only fchown/fchmod directories after we're done populating them
See https://mail.gnome.org/archives/ostree-list/2014-February/msg00020.html
2014-02-27 11:19:33 -05:00
Colin Walters 683a719b7e Update libgsystem, use it to set dirfd-relative xattrs on symlinks
This is a bit more efficient in that we're not walking full paths, and
it helps avoid security/reliability issues if an attacker (or just a
misbehaving process) has the ability to mutate paths in the middle.
2014-02-26 16:34:37 -05:00
Colin Walters 0eb8c37ecb upgrade: Properly set origin_refspec variable for resolve/printing
1) We were ignoring the remote, which is broken
2) We were printing NULL later on
2014-02-26 15:13:12 -05:00
Colin Walters c85682cb85 switch: Don't check whether revision matches
It's quite possible that say "buildmaster" and "smoketested" are the
same revision - but we should allow switching between them.
2014-02-26 15:12:08 -05:00
Colin Walters b762c2f8f1 pull: Remove explicit threading
Mixing async and threads has proved to be too much for my little mind.
It has race conditions that I've tried repeatedly to fix, but failed.

The threading here was scanning metadata objects - and there are
two parts to that:

1) Physically loading them from disk
2) Parsing them

Now #1 has been partially addressed by avoiding a storm of lstat() if
we're starting from a known working state.  If pull gets interrupted,
then we do need to rescan all objects.  Also, we can address this with
local metadata packfiles.

The other potentially slow bit is that we recurse across the metadata,
blocking the main thread.  We could ameliorate that in the future by
scheduling metadata parsing as idle "chunks".

Anyways, let's move the needle back to reliability, and readd speed
more carefully.

https://bugzilla.gnome.org/show_bug.cgi?id=706456
2014-02-21 15:04:23 -05:00
Colin Walters f2e0162846 upgrade: Refuse chronologically older commits unless --allow-downgrade
We don't want to allow MITM attackers to intercept upgrade requests
and provide clients with older OS versions vulnerable to security
flaws.

Only "ostree admin upgrade" gets this behavior for now - whether we
want to do it for "ostree admin switch" is another question.
2014-02-20 18:25:56 -05:00
Colin Walters 9fc9008af8 repo: Fix crash without SELinux policy enabled during commit 2014-02-20 14:19:49 -05:00
Colin Walters 071916196c build: Fix build without SELinux 2014-02-20 10:12:53 -05:00
Colin Walters 3337334be5 libostree: Split off SELinux OstreeSePolicy class
It's better if this is independent from the OstreeSysroot; for
example, a policy is active in a given deployment root at once, not
for a sysroot globally.

We can also collect SELinux-related API in one place.

Unfortunately at the moment there can be only one instance of this
class per process.
2014-02-19 08:43:45 -05:00
Colin Walters cc49096044 Add internal SELinux policy overrides
In the future, this will likely include an ostree_t domain.  For now,
this is just a few additional allow rules.
2014-02-19 08:40:19 -05:00
Colin Walters 53bd648dac manual-tests: New directory with custom test scripts
This is just a demo script.
2014-02-14 18:16:37 -05:00
Daniel Drake 8ccd603cba fetcher: set timeouts on HTTP connections
We're seeing some hangs while ostree is fetching updates.
I imagine the fact that SoupSessionAsync has no timeout by default
could be the cause of this.

Set timeout values to 60 seconds, which is the default for the new
SoupSession API which we may switch to later.

https://bugzilla.gnome.org/show_bug.cgi?id=724310
2014-02-13 11:21:26 -06:00
Colin Walters 371cebf258 build: make "sudo make install" over existing install work 2014-02-13 10:57:51 -05:00
Cosimo Cecchi d4f86fdef2 os-init: also create a symlink for /var/lock
After creating one for /var/run. This is needed at least on Debian
systems.
2014-02-12 14:05:13 -08:00
Colin Walters ad08799ef1 deploy: Remove now-unimplemented --no-bootloader argument 2014-02-12 16:47:39 -05:00
Daniel Drake c8b16d9313 boot/ostree-remount.service: run before tmpfiles.d
tmpfiles.d configurations generally require write access to some places
that are read-only until ostree-remount runs.

Make sure ostree-remount has run first.

Thanks to Cosimo Cecchi for finding and diagnosing this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=724183
2014-02-11 17:27:38 -05:00
Colin Walters 3ffdef07a4 repo: Split generic GPG commit verification out into helper
This will be used for a future commit which GPG verifies static
deltas.
2014-02-10 09:40:35 -05:00
Colin Walters 60c4d467aa deltas: Add a timestamp to delta metadata 2014-02-10 09:40:35 -05:00
Colin Walters f526fd4e3c pull: Remove a duplicate hash table
Not sure why we had two...perhaps the code originally had them
separate.
2014-02-10 09:40:35 -05:00
Colin Walters 26d5db696b tests: Fix up GPG tests for more strict EL7 GPG
These GPG tests were failing for me on EL7 - it appears to be because
we had only one directory for both private and public keys, and we
were giving that to ostree for verification, which passed them onto
gpgv.

In EL7 beta at least, gpgv now barfs if it finds a private key where
it is just expecting to find public keys.

Fix this by splitting out the public trusted directory from the
private key directory.  Except now for signing, we still need the
public key there, so symlink it.  Whee!
2014-02-10 09:40:35 -05:00
Colin Walters 2ee2751fd1 repo: Don't set GPG engine executable path
The instructions one finds on the internets are apparently wrong, we
really need to keep the default here, since gpgme uses it to actually
find the helper binary it runs.

This fixes the GPG tests for me on EL7 at least.
2014-02-10 09:12:00 -05:00
Colin Walters 8dd7b5575e Drop refs/summary
I'm not aware of anyone using this, and it's not efficient to write a
whole file every time a ref changes, plus it's not atomic.
2014-02-09 14:01:27 -05:00
Colin Walters a30fcba273 sysroot: Add a log with MESSAGE_ID when deployment is complete 2014-02-09 13:17:24 -05:00
Colin Walters d744436a50 pull: Don't crash if the URL is not found 2014-02-06 03:46:14 -05:00
Colin Walters 2d6374822b Initial basic static delta code drop
This has a very basic level of functionality (deltas can be generated,
and applied offline).  There is only some stubbed out pull code to
fetch them via HTTP.

But, better to commit this now and improve it from a known starting
point, rather than have it languish in a branch.
2014-02-04 10:31:44 -05:00
Colin Walters 844c5ea652 core: Import bup's "rollsum" code, add a test case
For static deltas, one strategy that will be employed is to split each
object into chunks, and only include changed chunks in the deltas.
2014-02-04 10:12:56 -05:00
Colin Walters 8c2a3efadb build: Drop SELinux required version a bit earlier
Apparently EPEL7 only has 2.1.13, but we should be fine with that.
2014-02-02 11:53:22 -05:00
Colin Walters 3007aeb160 build: Fix --without-selinux case 2014-02-02 11:49:43 -05:00
Colin Walters e580a88f4e SELinux: Ensure we label /var, and fix /etc merge wrt xattrs
First, /var needs to be labeled at least once.  We should probably
rearrange things so that /var is only created (and labeled) on the
first deployment, but this patch adds a /var/.ostree-selabeled file
instead.

Second, when doing the /etc merge, we compare the xattrs of the old
/usr/etc versus the current /etc.  The problem with that is that the
policy has different labels for /usr/etc on disk than the real /etc.

The correct fix for this is a bit invasive - we have to take the
physical content of the old /usr/etc, but compare the labels as if
they were really in /etc.

Instead for now, just ignore changes to xattrs.  If the file
content/mode changes, then we take the new file (including any changed
xattrs).

Bottom line: just doing chcon -t blah_t /etc/foo.conf may be lost on
upgrade (for now).
2014-02-02 11:32:52 -05:00
Colin Walters f86a132eb0 libostree: Also use xattr callback for directories
They need labels too, obviously.
2014-02-01 11:30:10 -05:00
Colin Walters 234ae70b4c Add --disable-fsync option to pull-local, and API to repo
This will be used by guestmount - it's WAY faster.  We only take disks
as a unit, so it's safe.  If the process fails halfway through, we
just start over from scratch the next time anyways.
2014-01-31 22:18:13 -05:00
Colin Walters 2313bdcb62 Add SELinux support
The trees as shipped come with /usr/etc, which should just be labeled
as usr_t.  When we do a deployment, we need to relabel the copies of
the files we're making in /etc.

SELinux support is compile and runtime optional.
2014-01-31 08:10:55 -05:00
Colin Walters be1acfafa0 repo: Add API to provide xattrs
This will be used by rpm-ostree to provide SELinux security contexts,
without requiring us to actually label the disk.
2014-01-30 20:37:27 -05:00
Colin Walters c7bcfc1c61 build: Look for /usr/bin/gpgv2 vs /usr/bin/gpgv
For some reason, RHEL has gpgv, but Fedora doesn't.  We need to detect
which to use, since presumably Debian only has gpgv.
2014-01-30 19:32:59 -05:00
Colin Walters f36cc6a44c repo: Improve GPG error messages
The signing test is failing here on EL7 beta for me - it seems like
gnupg isn't honoring the homedir.
2014-01-30 17:17:36 -05:00
Colin Walters ffb19aef9a libostree: Actually trusted.gpg.d/*.gpg for GPG verification
The intent of this code I'm fairly certain was to use *.gpg from the
trusted.gpg.d, directory.  But right now, we're only using
"pubring.gpg" from that directory, which is odd.

Let's fix this to use all keys ending in .gpg, which will also
include pubring.gpg.
2014-01-30 15:40:46 -05:00
Colin Walters ebe6207847 build: Install README-gpg in /usr/share/ostree/trusted.gpg.d
Since this is what the current code actually reads.
2014-01-30 15:28:13 -05:00
Colin Walters bffd30ff27 ostree-prepare-root.service: Also order before plymouth-switch-root.service
In the OSTree model, /sysroot gets set up twice.  We need to ensure
that the /sysroot plymouth sees is only after OSTree has set it up.
2014-01-27 13:57:18 -05:00
Colin Walters daaddcf536 boot/ostree-remount.service: Run before plymouth-read-write.service
The plymouth service needs a writable /var, so ensure that we run
before it does.
2014-01-27 11:57:35 -05:00
Colin Walters b3bfcb343a doc: Update manpage a bit
I know, I know, it's about time...
2014-01-27 09:10:42 -05:00
Colin Walters a5ff7eaf37 Release 2014.1 2014-01-24 04:26:43 +00:00
Colin Walters d64d2b6636 pull: Be less chatty with G_MESSAGES_DEBUG=all
Only note state *transitions*, don't spam on simple checks.
2014-01-22 15:02:01 +00:00
Colin Walters 26795ffc0f TODO: Update 2014-01-22 11:11:50 +00:00
Colin Walters 9c701b6ae5 tests: Only install test-corruption if gjs is found
It now uses a gjs-based helper.
2014-01-21 19:53:06 +00:00
Colin Walters 390b781d3a pull: Add remotename:ref syntax
This is really the common case.
2014-01-21 08:57:34 +00:00
Colin Walters 35c1fe324f README: Just link to wiki, move most of it to README-historical.md 2014-01-20 18:00:09 -05:00