summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-sysroot-upgrader.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: Run clang-formatColin Walters2023-05-021-174/+122
| | | | | This is a one-time tree wide reformatting to ensure consistency going forward.
* lib/sysroot-upgrader: add some 'nullable' annotationsLuca BRUNO2023-02-081-3/+3
|
* lib: assert more invariantsLuca BRUNO2022-11-241-2/+2
| | | | | This converts a few more safety checks into either plain GErrors or hard assertions.
* lib: Stop using old `ostree_sysroot_get_repo()` APIColin Walters2022-07-061-3/+1
| | | | | | | | | | | | It's falliable, and in one place we were actually ignoring the error and leaving a `NULL` repo object which is just a trap for people coming along later since it's rarely nullable. Quite a while ago we switched to loading the repo at the same time as the sysroot; convert callers in the library to use this infallible accessor. Prep for another patch which will use the repo object.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* upgrade: Stabilize deployment stagingColin Walters2021-09-071-1/+3
| | | | | | | | | | We're waaay overdue for this, it's been the default in rpm-ostree for years, and solves several important bugs around not capturing `/etc` while things are running. Also, `ostree admin upgrade --stage` (should) become idempotent. Closes: https://github.com/ostreedev/ostree/issues/2389
* Drop use of `volatile`Jonathan Lebon2020-11-021-4/+4
| | | | | | | | | | | | | | As detailed in gitlab.gnome.org/GNOME/glib/-/issues/600#note_877282, volatile isn't actually needed in these contexts because the atomic operations already give us strong enough guarantees. In GCC 11, this triggers a diagnostic due to the volatile qualifier getting dropped anyway. There is a WIP to do the same in glib: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 This obsoletes this downstream patch: https://src.fedoraproject.org/rpms/ostree/c/b8c5a6fb
* lib/upgrader: Pull with `timestamp-check-from-rev`Jonathan Lebon2020-05-141-2/+2
| | | | | | | | | For the same reason as https://github.com/coreos/rpm-ostree/pull/2094. What we care most about is that the new commit we pull is newer than the one we're currently sitting on, not necessarily that it's newer than the branch itself, which it might not be if e.g. we're trying to deploy a commit older than the tip but still newer than the deployment (via `--override-commit`).
* lib/sysroot: Add OSTREE_EX_STAGE_DEPLOYMENTS environment variableColin Walters2018-05-111-14/+30
| | | | | | | | | | | | | | | | | | | I feel like I'm drowning in a pile of experimental-but-almost-stable features... Anyways, since we made the feature opt-in in rpm-ostree in https://github.com/projectatomic/rpm-ostree/pull/1352 let's mirror that a bit here with an environment variable so people can play with it more easily. The tests needed some tweaks; specifically we need to reload the status fact after making changes. I'm still a bit uncertain about the Ansible-as-tests. But we add an upgrade test that uses the new environment variable. Closes: #1583 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
* 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
* lib/pull: Add support for timestamp-check option, use in upgraderColin Walters2017-08-211-23/+22
| | | | | | | | | | | | For both flatpak and ostree-as-host, we really want to verify up front during pulls that we're not being downgraded. Currently both flatpak and `OstreeSysrootUpgrader` do this before deployments, but at that point we've already downloaded all the data, which is annoying. Closes: https://github.com/ostreedev/ostree/issues/687 Closes: #1055 Approved by: jlebon
* lib: Add #defines for current well-known metadata keysColin Walters2017-07-211-1/+1
| | | | | | | | | | This came up in https://github.com/projectatomic/rpm-ostree/issues/142 Let's add `#define`s for our metadata keys, with documentation so that, well, they're documented. Closes: #1024 Approved by: peterbaouoft
* Allow commits to mark refs as EOL, replaced by othersDaniel Drake2017-05-221-0/+46
| | | | | | | | | | | | | | | | | | | A commit can now include a "ostree.endoflife-rebase" metadata key pointing to a new ref. When updating, the sysroot upgrader will see this and proceed to pull and deploy the new ref instead. The origin file in the new deployment will point to the new ref. This functionality is planned to be used in Endless OS. We will create a lesser tested branch for brand new, cutting edge hardware support, and ship that on hardware platforms that require the latest drivers. However, once our slower-moving official release is later updated to support the new hardware, we will use this functionality to migrate those bleeding-edge users over to the official release. Closes: #874 Approved by: cgwalters
* lib/upgrader: Port to new code styleColin Walters2017-05-171-91/+41
| | | | | | | No surprises here. Prep for future work. Closes: #864 Approved by: jlebon
* libostree: Add missing checks for invalid timestampsPhilip Withnall2017-05-031-2/+9
| | | | | | | | | | | | | | | g_date_time_new_from_unix_utc() will not always return a valid GDateTime — if the input timestamp is too big, GDateTime cannot represent it, and the constructor returns NULL. Add some missing checks for these situations. We don’t ever expect timestamps to be this big, but they could be as a result of corruption or a malicious repository. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #825 Approved by: cgwalters
* lib: Squash most of the gtk-doc warnings for missing parametersColin Walters2017-03-131-0/+14
| | | | | | | This isn't all of them, just trying to make a dent. Closes: #734 Approved by: jlebon
* upgrade: Add support for --pull-only and --deploy-onlyColin Walters2017-02-271-1/+2
| | | | | | | | | | This makes it easier to script downloading updates in the background, and only do deployments just before rebooting. Partially addresses https://github.com/ostreedev/ostree/issues/640 Closes: #642 Approved by: jlebon
* repo: Add unconfigured-state to remote config optionsColin Walters2016-12-091-1/+3
| | | | | | | | | | | | | | | | This is a migration from the origin version. It's nicer to have it in the remote, since that's what one needs to change. Then tools don't need to mess with the origin file.o In fact in this scenario one can keep the "media source" like `file:///install/repo` or whatever, since conceptually that's where it came from. We're just providing a better error. Closes: https://github.com/ostreedev/ostree/issues/626 Closes: #627 Approved by: jlebon
* [ASAN] lib: Squash various leaks in library and commandlineColin Walters2016-11-211-0/+1
| | | | | | | | The pull one is the most likely to affect users. Otherwise mostly just cleaning up `-fsanitize=address`. Closes: #587 Approved by: jlebon
* ostree_sysroot_upgrader_finalize: free new_revisionSimon McVittie2016-10-301-0/+1
| | | | | | | | | Leak found with valgrind memcheck. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #556 Approved by: cgwalters
* tree-wide: Remove unused variables detected by CLangColin Walters2016-10-271-1/+0
| | | | | | | | | | CLang finds these, whereas GCC treats having `__attribute__((cleanup))` as a use. This obsoletes https://github.com/ostreedev/ostree/pull/411 Closes: #548 Approved by: jlebon
* docs: Get API docs working againMathnerd3142016-06-091-1/+1
| | | | | | | | | | | | | | This changes around a few things that didn't work for me: * Section names seem to be ostree-* instead of libostree-* * Also XML files are ostree-* (they didn't show up at all) - gtk-doc doesn't seem to parse const _OSTREE_PUBLIC correctly * pull documentation is now on the actual functions rather than stubs * Update gitignore with some more files And there some changes to make gtk-doc give fewer warnings (not finished) Closes: #327 Approved by: cgwalters
* upgrader: Allow overriding the commit to pullMatthew Barnes2015-10-131-5/+34
| | | | | | | Upgrader now looks for an "override-commit" key in the origin file with a commit checksum, which causes the upgrader to pull and deploy the specified commit rather than the latest available commit on the origin refspec.
* upgrader: Add ostree_sysroot_upgrader_dup_origin()Matthew Barnes2015-10-131-0/+27
| | | | | Convenience function returns a copy of the origin file, useful when modifying it.
* Remove unnecessary #include "libgsystem.h"Matthew Barnes2015-05-061-1/+0
|
* Use g_autoptr(GVariant) instead of gs_unref_variantMatthew Barnes2015-05-061-2/+2
|
* Use glnx_unref_object instead of gs_unref_objectMatthew Barnes2015-05-061-2/+2
| | | | | For non-GIO object types, at least until autocleanup support for GObject based types becomes more widespread.
* Use g_autofree instead of gs_freeMatthew Barnes2015-05-061-6/+6
|
* src: drop some dead assignmentsGiuseppe Scrivano2015-03-061-5/+0
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Add "unconfigured-state" concept to origin filesColin Walters2014-10-031-1/+67
| | | | | | | | | | | | | | | 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
* upgrader: Hold a ref to the originColin Walters2014-09-301-0/+1
| | | | | | | | 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 =/
* repo-pull: Allow pulling only one directoryAnne LoVerso2014-08-201-1/+22
| | | | | | | | | Changes the pull API to allow pulling only a single directory instead of the whole deployment. This option is utilized by the check-diff option in rpm-ostree. Add a new state directory to hold <checksum>.commitpartial files, so we know that we've only downloaded partial state.
* libostree: Add _finish() API to async progressColin Walters2014-04-291-0/+3
| | | | | Since OstreeAsyncProgress queues to the mainloop, we might "lose" the last message. Give callers a way to force a flush.
* upgrade: Support --allow-downgrade againColin Walters2014-03-311-1/+4
| | | | This was unintentially dropped with the OstreeSysrootUpgrader rebase.
* sysroot-upgrader: Check merge deployment, not ref for differencesColin Walters2014-03-311-4/+3
| | | | | | | | 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.
* libostree/upgrader: Don't pull if there is no remoteColin Walters2014-03-271-4/+7
| | | | In this case we're just reading the local repo.
* libostree/upgrader: Add an API to retrieve an origin descriptionColin Walters2014-03-251-0/+14
| | | | This will be used by "rpm-ostree upgrade".
* libostree/upgrader: Throw an error if osname is emptyColin Walters2014-03-251-0/+6
| | | | This shouldn't happen; I'm just adding the check to force a rebuild.
* Add an OstreeSysrootUpgrader APIColin Walters2014-03-241-0/+496
This moves some utility code from the ostree tool into the shared library, which will make it easier to consume by external tools.