summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-cmdprivate.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename ostree-cmdprivate to drop out of introspectionColin Walters2022-06-021-43/+0
| | | | | | I was looking at our `.gir` and noticed we had the cmdprivate bits because the pattern for excluding headers is `-private.h`, which didn't match `cmdprivate.h`.
* Add an `ostree-boot-complete.service` to propagate staging failuresColin Walters2022-04-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quite a while ago we added staged deployments, which solved a bunch of issues around the `/etc` merge. However...a persistent problem since then is that any failures in that process that happened in the *previous* boot are not very visible. We ship custom code in `rpm-ostree status` to query the previous journal. But that has a few problems - one is that on systems that have been up a while, that failure message may even get rotated out. And second, some systems may not even have a persistent journal at all. A general thing we do in e.g. Fedora CoreOS testing is to check for systemd unit failures. We do that both in our automated tests, and we even ship code that displays them on ssh logins. And beyond that obviously a lot of other projects do the same; it's easy via `systemctl --failed`. So to make failures more visible, change our `ostree-finalize-staged.service` to have an internal wrapper around the process that "catches" any errors, and copies the error message into a file in `/boot/ostree`. Then, a new `ostree-boot-complete.service` looks for this file on startup and re-emits the error message, and fails. It also deletes the file. The rationale is to avoid *continually* warning. For example we need to handle the case when an upgrade process creates a new staged deployment. Now, we could change the ostree core code to delete the warning file when that happens instead, but this is trying to be a conservative change. This should make failures here much more visible as is.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* Add concept of "staged" deploymentColin Walters2018-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add API to write a deployment state to `/run/ostree/staged-deployment`, along with a systemd service which runs at shutdown time. This is a big change to the ostree model for hosts, but it closes a longstanding set of bugs; many, many people have hit the "losing changes in /etc" problem. It also avoids the other problem of racing with programs that modify `/etc` such as LVM backups: https://bugzilla.redhat.com/show_bug.cgi?id=1365297 We need this in particular to go to a full-on model for automatically updated host systems where (like a dual-partition model) everything is fully prepared and the reboot can be taken asynchronously. Closes: https://github.com/ostreedev/ostree/issues/545 Closes: #1503 Approved by: jlebon
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* lib/pull: Split verify_bindings() out into a cmdprivate methodPhilip Withnall2017-12-141-0/+1
| | | | | | | | | | It will be used by the fsck utility in future. We could expose it publicly in future too, if needed. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1347 Approved by: cgwalters
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* Switch to using a systemd generator for /varColin Walters2017-05-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If one wants to set up a mount for `/var` in `/etc/fstab`, it won't be mounted since `ostree-prepare-root` set up a bind mount for `/var` to `/sysroot/ostree/$stateroot/var`, and systemd will take the already extant mount over what's in `/etc/fstab`. There are a few options to fix this, but what I settled on is parsing `/etc/fstab` in a generator (exactly like `systemd-fstab-generator` does), except here we look for an explicit mount for `/var`, and if one *isn't* found, synthesize the default ostree mount to the stateroot. Another nice property is that if an admin creates a `var.mount` unit in `/etc` for example, that will also override our mount. Note that today ostree doesn't hard depend on systemd, so this behavior only kicks in if we're built with systemd *and* libmount support (for parsing `/etc/fstab`). I didn't really test that case though. Initially I started writing this as a "pure libc" program, but at one point decided to use `libostree.so` to find the booted deployment. That didn't work out because `/boot` wasn't necessarily mounted and hence we couldn't find the bootloader config. A leftover artifact from this is that the generator code calls into libostree via the "cmd private" infrastructure. But it's an easy way to share code, and doesn't hurt. Closes: #859 Approved by: jlebon
* delta: Add --if-not-exists optionColin Walters2016-07-041-0/+1
| | | | | | | | | | I often want to have "idempotent" systems that iterate to a known state. If after generating a commit, the system is interrupted, I'd like the next run to still generate a delta. But we don't want to regenerate if one exists, hence this option. Closes: #375 Approved by: jlebon
* Add support for ostree static-delta deleteAlexander Larsson2016-04-081-0/+1
| | | | | Closes: #245 Approved by: giuseppe
* lib: Introduce versioned symbolsColin Walters2016-03-011-1/+2
| | | | | | | | | | | | | | | | | | | | As rpm-ostree evolves, it keeps driving API additions to libostree. This creates a relatively tight coupling. However, if delivering via e.g. RPM, unless one manually remembers to increment the `Requires:` in the spec file, it's possible for the two to become desynchronized. RPM handles versioned symbols and will ensure a dependency if the application starts using a newer version. To implement this, switch to `-fvisibility=hidden`, along with an annotation in the header, and finally add a `.sym` file. This matches what other projects like systemd and libvirt do. Although rather than attempting to retroactively version symbols, glom them all onto the current one.
* static-delta: Add `show` subcommandColin Walters2016-01-281-0/+1
| | | | | | | | | Right now though, almost all of the details of deltas are private, so we can't do the "honest thing" and have the command line just use the shared library. Eventually some of this should appear in the API, but for now add command line which is useful for debugging.
* syntax-check: Remove empty lines at the end of fileGiuseppe Scrivano2015-02-021-1/+0
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* make ostree_cmd__private__ ret value constGiuseppe Scrivano2014-10-211-1/+1
|
* libostree: Add initial GRUB2 supportColin Walters2014-10-161-0/+35
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.