summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lib/sysroot: Add OSTREE_EX_STAGE_DEPLOYMENTS environment variabletryColin Walters2018-05-096-27/+56
| | | | | | | | | | | | | | | | | | | 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: <try>
* tests/installed: Disable all rpmmd reposColin Walters2018-05-092-0/+6
| | | | | | | | For the same reason we do in the rpm-ostree tests. This also made sure the test run worked when I was offline on a plane. Closes: #1583 Approved by: <try>
* libglnx: Bump to fix F28 compilationJonathan Lebon2018-05-081-0/+0
| | | | | | | | | | Pull in https://github.com/GNOME/libglnx/pull/104 to fix compiling on F28. Update submodule: libglnx Closes: #1580 Approved by: cgwalters
* docs: Add "Hello World" exampleJonathan Lebon2018-05-082-7/+70
| | | | | | | | | | | Let's get practical faster in the manual and have a simple "Hello World" example right off the bat to hopefully make it easier to grok how OSTree works. Also some minor tweaks on wording around comparisons to git. Closes: #1581 Approved by: cgwalters
* ci: Drop str hotpatchColin Walters2018-05-081-4/+0
| | | | | | | | | | | | The change we want is in the current Fedora repos, and git master is broken: > qemu-system-x86_64: -vnc :1: Failed to start VNC server: Failed to bind socket: Address already in use https://pagure.io/standard-test-roles/pull-request/186#comment-52440 Closes: #1582 Approved by: jlebon
* repo: handle GPG_ERR_AMBIGUOUS_NAME in sign_dataTobias Mueller2018-05-061-0/+4
| | | | | | | | | | | | | | | | | | | | | This should give a more insightful error message if the user provides a UID which is present on multiple keys. This happens if you have an old key in your keyring which you are not actively using any more, e.g. because it is too old. You still have your old keys in your keyring, because you want to read old email encrypted for that key, though. The gpgme function used by ostree right now complains if a UID is found on multiple keys: https://www.gnupg.org/documentation/manuals/gpgme/Listing-Keys.html#index-gpgme_005fget_005fkey The used API is too simple for that use case. Note that it would be nicer if ostree picked the only valid signing key out of the available keys rather than using the simplistic gpgme_get_key function. It be nicer, of course, if there was such a gpgme function. Closes: #1579 Approved by: cgwalters
* tests: Fix installed tests moreColin Walters2018-05-045-8/+48
| | | | | | | | | | | | | | | | | OK so I noticed that something was failing and we were missing `set -xeuo pipefail` in our shells. That of course revealed the ansible tests didn't actually work - my only defense here is spending so much time fighting to get it through CI and trying something new. Anyways, to make the staged-deploy tests work we need a task that actually uses `rpm-ostree override` rather than `usroverlay`. Let's make this a bit saner and have a clean split between tests that are "shell-script+usroverlay" and "ansible+override". Closes: #1577 Approved by: jlebon
* lib/commit: Fix function name typo in docstringJonathan Lebon2018-05-041-1/+1
| | | | | Closes: #1575 Approved by: cgwalters
* lib/deploy: Add semi-colon in post-deployment msgJonathan Lebon2018-05-041-1/+1
| | | | | | | | | Let's add a semi-colon between the "bootconfig swap" part and the "deployment count change" to make it more clear they're separate statements. Closes: #1575 Approved by: cgwalters
* tests: Tweak staged-deploy test to be fasterColin Walters2018-05-041-2/+5
| | | | | | | Work around https://github.com/ostreedev/ostree/issues/1569 Closes: #1573 Approved by: jlebon
* README: Tweak licensing descriptionColin Walters2018-05-041-2/+6
| | | | | | | | | | Basically it wasn't clear that the man pages and API doc remain LGPLv2. Closes: https://github.com/ostreedev/ostree/issues/1456 Closes: #1574 Approved by: smcv
* deploy: Use fdatasync() for new kernel/initramfs by defaultColin Walters2018-05-021-1/+1
| | | | | | | | | | | | | | | | | While we do a `syncfs()` plus `FIFREEZE/THAW` for `/boot`, that only comes during deployment finalization. The code here today generally assumes that if the file exists it's been fully written. So let's do a `fdatasync()` before we do the `rename()`. This just came out of looking through the code while working on deployment staging. In that scenario there's a much larger window between when we copy the kernel/initramfs and when we sync `/boot`. Closes: #1571 Approved by: jlebon
* lib: Use `Locking:` term in docsColin Walters2018-05-022-5/+5
| | | | | | | | | This is easier to `git grep` etc. versus ad-hoc English. Although we still have some English for the prepare_transaction/commit which acquire/release in separate phases. Closes: #1572 Approved by: jlebon
* lib/deploy: Do post-ops when removing staged commitColin Walters2018-05-022-9/+53
| | | | | | | | | | | | | | | | These are further fixes based on running more of the rpm-ostree test suite. When dropping the staged deployment, we do need to do the "post operations" such as bumping the sysroot mtime, so that clients know something changed. We also need to regenerate the deployment refs. And of course do a sysroot reload. Also, add a "base cleanup" after creating a staged deployment which also regenerates the refs. Closes: #1570 Approved by: jlebon
* lib/deploy: Throw an error if trying to stage when not ostree-bootedColin Walters2018-05-022-1/+11
| | | | | | | | | | | | There's no reason to do this. I didn't actually hit this problem, but it's a corner case that just occurred to me while working on the code. I think callers should be adapted to skip trying to use staging if there's no booted deployment. Closes: #1568 Approved by: jlebon
* lib/sysroot: Maintain one variable for "root is ostree booted"Colin Walters2018-05-022-13/+8
| | | | | | | | | This was pointed out in a previous PR review; we don't have a need for the separate variables. Prep for adding an API for this. Closes: #1568 Approved by: jlebon
* repo: Add checksum to error message opening unreadable objectColin Walters2018-05-012-1/+22
| | | | | | | | | This would have debugged trying to do a pull as non-root from a sysroot repository. See for example: https://github.com/ostreedev/ostree/issues/1562 Closes: #1564 Approved by: jlebon
* deploy: Don't prune repo at finalization time by defaultColin Walters2018-05-011-2/+12
| | | | | | | | | | | | Doing so can break rpm-ostree, which wants to own the cleanup process to ensure its baselayer refs are generated. Further, doing the cleanup at shutdown time adds latency. It's also going to be generally unnecessary as we expect repo pruning to have been done when writing the refs. Closes: #1567 Approved by: jlebon
* bin/admin-cleanup: Port to decl-and-initialize styleColin Walters2018-05-011-10/+5
| | | | | | | No functional changes. Closes: #1567 Approved by: jlebon
* build: Don't distribute Bison-generated parser in dist tarballsSimon McVittie2018-04-301-0/+3
| | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #1563 Approved by: cgwalters
* man/ostree-init: Briefly describe various modesJonathan Lebon2018-04-302-8/+19
| | | | | | | Closes: #1561 Closes: #1560 Approved by: cgwalters
* man/ostree: Document --repo option a bit moreJonathan Lebon2018-04-302-9/+9
| | | | | | | | | This new information is already mostly part of `ostree.repo(5)`, though let's put it in `ostree(1)` as well since that's where the switch is officially documented. Closes: #1560 Approved by: cgwalters
* lib/repo: Enable locking by default, but drop external APIColin Walters2018-04-309-108/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code has been sitting around for a while but since I disabled it by default, I doubt anyone is really using it or relying on it. This patch and turns on locking by default, and also drops the API which was only public in the experimental API builds. Conceptually these are two distinct things, and we may actually want to split up the patches. I don't think this will break anyone, but it's hard to say for sure. It's also going to be hard to find out until we actually release I suspect... But anyone who is broken should be able to add `locking=false` into their repo config. On the flip side Endless has been shipping with this enabled and it is reported to help. The reason to drop the APIs: I'm a bit concerned about the interactions over time between libostree's use of the API and any apps that start using it. For example, if an app specifies a SHARED lock in their code, then later internally we decide to temporarily grab an `EXCLUSIVE`, but the app had a second thread/process that was `EXCLUSIVE` already, and that process was waiting on the first bit of code, then we could deadlock. I can't think of a real world situation where this would happen yet though. We are likely to in the future have say `fsck` take an external lock, `checkout` grab a shared one, etc. Closes: #1555 Approved by: jlebon
* README.md: Fix docs link to COPYINGColin Walters2018-04-301-1/+4
| | | | | | | | | | Because `README.md` also gets rendered into the docs, we need to link directly to github. Closes: https://github.com/ostreedev/ostree/issues/1534 Closes: #1554 Approved by: jlebon
* deploy: Return staged deploymentColin Walters2018-04-272-0/+3
| | | | | | | | | | | | | | | Today rpm-ostree has some code to run a "sanitycheck" on a deployment. I had initially deleted that when adapting it to use the staging code, but I realized it should work fine; we just won't see the merged config, but that's OK. When I readded that code it started crashing because we didn't actually return the new deployment object. We'll gain some coverage here as I'll land the code to have rpm-ostree use staging, then bump the rpm-ostree tests here. Closes: #1559 Approved by: jlebon
* bin/deploy: Avoid loading merge deployment kargs unless necessaryColin Walters2018-04-272-19/+24
| | | | | | | | | | | | | | The fact that `ostree admin deploy` always itself loaded the merge kargs masked a bug in the core. Let's change our tests to not pass any kernel arguments to ensure we cover this. The new logic in the CLI is a bit subtle, but if you read carefully is a lot clearer I believe. Basically we have one of a few "starting points" in the first section, which can then be further augmented. Closes: #1558 Approved by: jlebon
* lib/deploy: Fix staged deployments with no kargsColin Walters2018-04-271-2/+16
| | | | | | | | | | | | | | | | | | | | | | Testing out the staged API with rpm-ostree, ostree-prepare-root.service in the initramfs was failing. Turned out that was because we didn't have a `root=` kernel argument. Which was because we didn't have any kernel arguments at all except `ostree=`. That in turn was because we weren't loading the bootloader config from the merge deployment. The serialized deployment data holds the unique identity of (osname, checksum, deployserial) - look for the real merge deployment in our deployment list which has the bootloader arguments we need. This issue was entirely masked by the `ostree admin deploy` command which itself explicitly loads the merge deployment's kernel arguments in every case - it never passes the `NULL` default down. A followup patch will fix that. Closes: #1558 Approved by: jlebon
* lib/deploy: Also compare deployment csum versionsJonathan Lebon2018-04-243-4/+41
| | | | | | | | | | | | | When comparing deployments to determine whether we need a new bootversion, we should also check whether the commit "version" metadata is the same. Otherwise, we may end up with the a bootconfig whose `title` includes a version that doesn't match the one from the deployment checksum. Closes: https://github.com/projectatomic/rpm-ostree/issues/1343 Closes: #1556 Approved by: cgwalters
* lib/deploy: Factor out function to get deployment kargsJonathan Lebon2018-04-241-17/+17
| | | | | | | No functional change. Prep for next commit. Closes: #1556 Approved by: cgwalters
* ci: drop BDB1539 workaroundJonathan Lebon2018-04-241-12/+1
| | | | | | | This shouldn't be an issue anymore. Closes: #1553 Approved by: cgwalters
* tests: Port the last python2 script to python3Jonathan Lebon2018-04-231-4/+5
| | | | | | | | | This is not used by any test, nor is it packaged. Though let's just port it over to py3 to certify our codebase completely py2-free. I've manually checked that the script is still functional. Closes: #1546 Approved by: cgwalters
* tests/installed: Prefer python3 over python2Jonathan Lebon2018-04-231-15/+15
| | | | | | | | In a world progressively unapproving of python2, let's be a bit smarter and support testing on platforms that only have python3 installed. Closes: #1546 Approved by: cgwalters
* ci: Temporary libgcrypt workaround for older kernelsJonathan Lebon2018-04-231-0/+4
| | | | | | | | | | | | | | | I'm trying to get ostree tests to pass in OpenShift as part of our CI move but I've been seeing lots of failures related to GPG tests. It finally turned out to be because libgcrypt doesn't behave well on older kernels that don't have `getrandom()` (the cluster is running on RHEL7). Thankfully, there's a new build with a fix for this. Pull that in manually until it gets into stable. For more information, see: https://bugzilla.redhat.com/show_bug.cgi?id=1542453 Closes: #1547 Approved by: cgwalters
* ci: mark some ci testsuites as required againJonathan Lebon2018-04-231-0/+1
| | | | | | | | Follow up to #1536; we are now running all the testsuites on merges, but we weren't actually blocking on their success! Closes: #1552 Approved by: cgwalters
* tests: Disable itest-pull.sh since it is too slowColin Walters2018-04-231-1/+6
| | | | | | | Hopefully we'll fix this soon. Closes: #1548 Approved by: cgwalters
* tests: Lower retry timeout to 5sColin Walters2018-04-231-0/+1
| | | | | | | | No need to poll every second, there's going to be some latency here and we want to avoid the overhead of polling. Closes: #1548 Approved by: cgwalters
* fsck: Only print "marking commit partial" onceColin Walters2018-04-233-6/+14
| | | | | | | | Let's only print if the commit isn't already partial; this addresses a spam of "marking commit partial" from fsck. Closes: #1548 Approved by: cgwalters
* tests/installed: increase async retries to 500Jonathan Lebon2018-04-231-1/+1
| | | | | | | | | It seems like 240 retries is just not long enough for all the non-destructive tests running in parallel to finish. Let's crank that up to 500 retries. Closes: #1548 Approved by: cgwalters
* tests/installed: Make reboot task less racyColin Walters2018-04-232-18/+21
| | | | | | | | | | | | | This took a whole lot of experimentation. I hit upon the idea of doing a `systemctl stop sshd` to avoid the situation where we might ssh back into the system while it's in the process of shutting down. Ultimately the other fix is disabling `ControlMaster`; see for example: https://github.com/ansible/ansible/issues/17935 Closes: #1548 Approved by: cgwalters
* man: Add man page for create-usbMatthew Leeds2018-04-196-3/+145
| | | | | Closes: #1543 Approved by: cgwalters
* create-usb: Update summary in destination repoMatthew Leeds2018-04-192-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently the create-usb command only generates a summary file in the destination repo if one doesn't already exist, which means if one does exist it becomes out of date after the new refs are pulled. This commit makes ostree regenerate the summary regardless of whether it exists, so that consumers such as ostree_repo_find_remotes_async() (and at a higher level, GNOME Software) get an accurate picture of the refs available on the mount. This commit also updates one of the unit tests to check that the summary is accurate after a second pull into the same repo. Since any user of the create-usb command is using collection IDs they are new enough to be using the unsigned summary support. While it would technically be possible to use summary signatures on a repo and use the create-usb command on it (a scenario broken by this commit), the create-usb command is designed for P2P distribution of refs, which requires use of unsigned summary support. So this is a legitimate narrowing of the tool. Fixes https://github.com/ostreedev/ostree/issues/1465 Closes: #1543 Approved by: cgwalters
* tests: Fix typo in unit testMatthew Leeds2018-04-191-1/+1
| | | | | Closes: #1543 Approved by: cgwalters
* avahi: Don't complain with g_warning if the daemon wasn't runningSam Spilsbury2018-04-182-4/+23
| | | | | | | | | | | | This is a normal case when running unit tests in client code on continuous integration infrastructure. When those tests are running they will set G_DEBUG=fatal-warnings which will cause the program to abort if a warning is emitted. Instead, emit a debug message if the problem was that we couldn't connect to the daemon. Closes: #1542 Approved by: jlebon
* lib/sysroot: Move staged into deployment list, rework handlingColin Walters2018-04-185-32/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to: https://github.com/ostreedev/ostree/pull/1503 After starting some more work on on this in rpm-ostree, it is actually simpler if the staged deployment just shows up in the list. It's effectively opt-in today; down the line we may make it the default, but I worry about breaking things that e.g. assume they can mutate the deployment before rebooting and have `/etc` already merged. There's not that many things in libostree that iterate over the deployment list. The biggest change here is around the `ostree_sysroot_write_deployments_with_options` API. I initially tried hard to support a use case like "push a rollback" while retaining the staged deployment, but everything gets very messy because that function truly is operating on the bootloader list. For now what I settled on is to just discard the staged deployment; down the line we can enhance things. Where we then have some new gymnastics is around implementing the finalization; we need to go to some effort to pull the staged deployment out of the list and mark it as unstaged, and then pass it down to `write_deployments()`. Closes: #1539 Approved by: jlebon
* ci: use gpgme scratch build to workaround issuesJonathan Lebon2018-04-171-0/+6
| | | | | | | | | | | Temporarily work around gpgme issues until the package gets into stable. For more information, see: https://src.fedoraproject.org/rpms/gpgme/pull-request/3 https://github.com/ostreedev/ostree/pull/1539 Closes: #1540 Approved by: cgwalters
* fsck: Mark commits with missing or deleted object partialAlexander Larsson2018-04-143-8/+89
| | | | | | | | | | This means we can later use various operations to heal the repository because ostree does not assume all objects are there. This the begining of a fix for https://github.com/ostreedev/ostree/pull/345 Closes: #1533 Approved by: cgwalters
* lib/repo: Add ostree_repo_traverse_commit_union_with_parentsAlexander Larsson2018-04-144-14/+195
| | | | | | | | | | This is a version of ostree_repo_traverse_commit_union that also remembers where the objects came from, by recording the parent relationships in a hashtable. This can be used to later find which commits each object was from, which we want to use in fsck. Closes: #1533 Approved by: cgwalters
* commit, payload-reflink: do not write to the parent repoGiuseppe Scrivano2018-04-132-36/+98
| | | | | | | | | | | | | | | | | | reintroduce the feature that was reverted with commit: 28c7bc6d0e153a0b07bdb82d25473a490765067f Differently than the original implementation, now we don't attempt any test for reflinks support on the parent repository, since the test requires write access to the repository. Additionally, also check that the two repositories are on the same device before attempting any reflink. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1525 Approved by: cgwalters
* switchroot: Don't log if running as pid1, minor code style cleanupsColin Walters2018-04-131-12/+24
| | | | | | | | | | | | | If we're running as pid1, avoid printing anything in the normal success paths as we don't want to affect the physical console by default; the device may be using a splash screen, etc. Also cleanup the code a bit to use a single variable `running_as_pid1`, declare-and-initialize, use the `bool` type, etc. Closes: #1531 Approved by: jlebon
* sysroot: Clean up origin loading functionColin Walters2018-04-131-24/+18
| | | | | | | | | | | | In prep for staging work, where we'll need to load the origin for the staged deployment too. The function was previously trying to avoid operating on an instantiated deployment, but the data we need is in the deployment object at that point. Closes: #1538 Approved by: jlebon