Commit Graph

1105 Commits

Author SHA1 Message Date
Colin Walters 19abd8277f selinux-ensure-labeled: Support no arguments to just traverse deployment root
This makes it easy to use for the case where rpm-ostree-toolbox is
injecting systemd services into the deployment root, and we don't
actually need to traverse the whole FS.
2014-05-22 22:51:21 -04:00
Colin Walters a864190a04 admin switch: Allow switching just remote names
This is a followup to the previous commit; for the installation media
case we want to keep the current origin ref, and only switch remotes.
2014-05-15 08:58:44 -04:00
Colin Walters 24e1bf2552 admin switch: Support switching remotes as well
Say I have an installation from CDROM; the remote name may be
"installmedia" or something like that.  We want to allow also
switching remotes.
2014-05-12 17:31:34 -04:00
Colin Walters f47a20fb81 Support /etc/ostree/remotes.d
For many OS install scenarios, one runs through an installer which may
come with embedded data, and then the OS is configured post-install to
receive updates.

In this model, it'd be nice to avoid the post-install having to rewrite
the /ostree/repo/config file.

Additionally, it feels weird for admins to interact with "/ostree" -
let's make the system feel more like Unix and have our important
configuration in /etc.

https://bugzilla.gnome.org/show_bug.cgi?id=729343
2014-05-08 18:59:24 -04:00
Owen W. Taylor 466671407d trivial-httpd: flush after writing the port to stdout
The option --port-file=- is most useful when the stdout of the daemon
is programatically redirected and not going to a terminal. The
flush-after-a-line behavior of stdout is specific to terminals, so
we need an explicit flush.

https://bugzilla.gnome.org/show_bug.cgi?id=729609
2014-05-05 19:02:59 -04:00
Colin Walters 25ad4a9f65 pull: Add tls-client-cert-{path,key} (if we have new enough libsoup)
This is an actually working version of client-side certificates.
Depends on:
See: https://bugzilla.gnome.org/show_bug.cgi?id=334021

We detect whether libsoup is new enough for this.

https://bugzilla.gnome.org/show_bug.cgi?id=729356
2014-05-01 17:13:13 -04:00
Colin Walters 64b4ec6ef0 Revert "pull: Add tls-client-cert-{path,key}"
This reverts commit 94f9ee7bce.
Doesn't actually work, see
https://bugzilla.gnome.org/show_bug.cgi?id=334021
2014-05-01 10:23:11 -04:00
Colin Walters 94f9ee7bce pull: Add tls-client-cert-{path,key}
These can be used to present a client certificate when making requests
to a repository.
2014-05-01 07:57:06 -04:00
Colin Walters 7cc4a20f3b pull: Correctly handle error state when fetching optional data
For the static deltas work, we're using the already-extant internal
API to perform a HTTP fetch for optional data - static deltas are
optional.

Except that we didn't correctly unset the error if we were doing an
optional fetch and the data wasn't found.
2014-04-29 10:59:57 -04:00
Colin Walters 626fc8519b pull: Stay in mainloop if we're synchronously fetching URI
The static deltas work will be doing some synchronous fetching even
after refs are downloaded.
2014-04-29 10:59:57 -04:00
Colin Walters 006e8f0073 deltas: Link to liblzma, add internal API to use it
For future static deltas work, we'll be linking to liblzma.  Since
it's fairly widespread, let's just make it a hard dependency.
2014-04-29 10:59:57 -04:00
Colin Walters f040c02048 libostree: Add _finish() API to async progress
Since OstreeAsyncProgress queues to the mainloop, we might "lose" the
last message.  Give callers a way to force a flush.
2014-04-29 10:59:57 -04:00
Colin Walters 349083194d otutil: Correctly add ref to bytes when creating GVariant
This one went undiscovered for a while because it turned out we
weren't using it...
2014-04-29 08:53:28 -04:00
Colin Walters 959db9f0de core: Add _STRING variants of GVariant object formats
For the static deltas work, we're going to embed a commit in the delta
superblock, so we need a format string without the G_VARIANT_TYPE().
2014-04-29 08:51:00 -04:00
Colin Walters 021c4ee9d3 show: Fix segfault if we can't find an object
We need to use the original rev here.
2014-04-29 07:42:30 -04:00
Colin Walters 5346e0615b libotutil: Fix two bugs in usage of posix_fallocate()
* It's invalid to call it with a size of 0, so don't do that.

* posix_* apparently don't set errno.  So capture the return value and
  use that.
2014-04-29 07:40:25 -04:00
Colin Walters 22ab7b3e79 core: Use posix_fallocate() when writing objects
This helps ensure the filesystem allocates space efficiently.
2014-04-28 19:42:12 -04:00
Cosimo Cecchi 4903fba08c os-init: don't create /var/log/journal on deploy
Leave the policy of whether to persistently store journal logs to the
system integrator when the default journald configuration is in use.

https://bugzilla.gnome.org/show_bug.cgi?id=728762
2014-04-25 16:47:02 -04:00
Colin Walters 2c5d726076 deploy: fsync() copy of /etc
This unfortunately requires reimplementing gs_shutil_cp_a(), except
while we're here, we also use the *at calls.
2014-04-11 18:43:58 -04:00
Colin Walters b423d9e9cf deploy: fsync() kernel/initramfs and bootloader config parent directories
Ensure they've hit disk.
2014-04-11 18:43:27 -04:00
Colin Walters 646c8be8dc deploy: fdatasync() bootloader configuration files
Yet more data we're writing out that needs to be sync'd.
2014-04-11 18:43:27 -04:00
Colin Walters 18aaa49724 libotutil: Make use of dirfd-relative API in ot_gfile_replace_contents_fsync()
It's just more efficient.
2014-04-11 18:43:27 -04:00
Colin Walters 053dd72649 deploy: Ensure .origin file is fsync()ed on disk
Along with its parent directory.
2014-04-11 18:43:27 -04:00
Colin Walters 0b8495f09a deploy: Also fsync parent directory of modified config files 2014-04-11 18:43:13 -04:00
Colin Walters 38feca0e4d deploy: Ensure that any modified config files are fsync()d
It really wouldn't do for one to be missing one's ssh keys for
example...
2014-04-11 18:43:13 -04:00
Colin Walters 1b16553600 checkout: fsync() directory on checkouts
We want to be really sure that our deployment roots have hit the disk.
2014-04-11 18:43:13 -04:00
Colin Walters 7acad0a2e5 deploy: Ensure that all directories we create are fsync()d
There's two halves to this; first, when we create an hierarchy, we
need to call fsync().  Second, we need to fsync again anytime after
we've modified a directory.
2014-04-11 18:43:13 -04:00
Colin Walters b19aea441a libotutil: Add API to create directory hierarchy recursively *and* fsync
To be really sure that any directory entries have hit disk we need to
call fsync() on the directory fd.  This API allows us to conveniently
create a directory hierarchy, fsyncing all of it along the way.
2014-04-11 18:43:13 -04:00
Colin Walters d27c78eab5 pull: Display download progress of individual objects as we get it
It was kind of annoying at least for rpm-ostree upgrades since /boot
happens to be first and we eat a 21MB initramfs with no download
progress.

https://bugzilla.gnome.org/show_bug.cgi?id=726348
2014-04-11 01:31:14 -04:00
Colin Walters d4d4ef552d libotutil: Fix mistaken return of TRUE in error path
Gah, must have been a refactoring bug.
2014-04-09 01:51:43 -04:00
Colin Walters 1bdabda5f3 Use external libgsystem 2014.2
It's been split off for a while, let's kill the code duplication.

Among other things, this fixes the systemd detection for the journal
logging.
2014-04-04 16:52:37 -04:00
Colin Walters 4bd8b5c850 switch: Always allow chronological downgrades
Ideally we'd have something a bit more strict, but...without
downloading the parentage, this is all we can do at the moment.
2014-04-04 16:51:37 -04:00
Colin Walters 76a976817f deploy: Call fsync() on parent directory before/after symlink swap
Let's be conservative here and try hard to ensure the symlink has the
correct content on disk.
2014-04-03 22:39:41 -04:00
Colin Walters 829e0382ab bootloader: fdatasync() bootloader configuration
Let's be a bit more conservative here and actually fdatasync() the
configurations we're generating.

I'm seeing an issue at the moment where syslinux isn't finding the
config sometimes, and while I don't think this is the issue, let's try
it.
2014-04-03 22:32:30 -04:00
Colin Walters cc8bacf8b4 bootloaders: Always write out bootloader config file
There was an attempted optimization to only write if changed, but this
is broken - we always write the bootloader config into a new
directory.

In theory we should only be writing if it changed, but let's not do a
broken optimization.
2014-04-03 21:08:03 -04:00
Colin Walters ac40de5773 deploy: Add a debug message for which bootloader is used
Debugging something...
2014-04-03 19:39:08 -04:00
Colin Walters 890d685c79 deploy: Add an assertion that deployment directory exists
I may be seeing something going wrong in rpm-ostree, just adding this
assertion for my own sanity.
2014-04-03 18:29:07 -04:00
Colin Walters 49d736c265 tool: End status line after pull
Otherwise we potentially get overlapped output.
2014-04-03 08:04:32 -04:00
Colin Walters edc8665206 fetcher: Honor http_proxy environment variable
https://bugzilla.gnome.org/show_bug.cgi?id=706809
2014-04-01 19:12:40 -04:00
Colin Walters 7bd00e3005 checkout: Always do chmod even in _MODE_USER
The previous commit here changed things so that we do mkdir(x, 0700),
then fchmod later only if we created the directory.

However the logic was incorrect; we still need to chmod even in
MODE_USER if we created the directory.
2014-04-01 13:07:17 -04:00
Colin Walters 956b18ace7 tools: Fix unintialized variables 2014-04-01 10:00:18 -04:00
Colin Walters 5bca569506 upgrade: Support --allow-downgrade again
This was unintentially dropped with the OstreeSysrootUpgrader rebase.
2014-03-31 22:27:56 -04:00
Colin Walters 913337c557 sysroot-upgrader: Check merge deployment, not ref for differences
Otherwise this broke atomicity; we could fetch/store the ref, then
crash, and then not upgrade the next time we tried upgrading.

The correct model is: the tree has changed if the new ref is different
from the merge deployment.
2014-03-31 14:41:13 -04:00
Colin Walters 8d13e5bb74 sysroot: Be more conservative with bootlink optimization
Trying to implement "rpm-ostree rollback", in the case where we have 2
deployments with the same bootconfig that we're reordering, we need to
write bootconfig, not just swap the bootlinks.
2014-03-28 21:06:23 -04:00
Colin Walters ad46467f2b tool: End status line in switch/upgrade too 2014-03-27 07:45:13 -04:00
Colin Walters 11ecf9267e libostree/upgrader: Don't pull if there is no remote
In this case we're just reading the local repo.
2014-03-27 07:36:50 -04:00
Colin Walters 9389b7961c libostree/upgrader: Add an API to retrieve an origin description
This will be used by "rpm-ostree upgrade".
2014-03-25 16:46:39 -04:00
Colin Walters 90883674a9 libostree/upgrader: Throw an error if osname is empty
This shouldn't happen; I'm just adding the check to force a rebuild.
2014-03-25 15:47:20 -04:00
Colin Walters 7baa600e23 Add an OstreeSysrootUpgrader API
This moves some utility code from the ostree tool into the shared
library, which will make it easier to consume by external tools.
2014-03-24 18:08:22 -04:00
Colin Walters ffb9d34671 Move basic commit API into ostree_sysroot_simple_write_deployment()
The admin commands had this shared in tool common, but we want to
encourage external programs to do this as well.
2014-03-23 11:36:09 -04:00