Commit Graph

4379 Commits

Author SHA1 Message Date
Philip Withnall 23d4beead1 lib/repo-pull: Factor out enqueue function for FetchStaticDeltaData
This introduces no functional changes, but will make upcoming support
for retrying downloads easier to add.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Philip Withnall dc1fde704d lib/repo-pull: Factor out enqueue function for FetchObjectData
This introduces no functional changes, but will make upcoming support
for retrying downloads easier to add.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Philip Withnall 8b8952ebee lib/repo-pull: Factor out enqueue function for ScanObjectQueueData
This introduces no functional changes, but will make upcoming support
for retrying downloads easier to add.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Philip Withnall 6d21f83813 lib/repo-pull: Rename a variable
Rename from `fdata` to `fetch_data` to clarify things and make it
consistent with other similar functionality in the file.

This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Philip Withnall fc10354404 lib/repo-pull: Factor out free function for FetchDeltaSuperData
This introduces no functional changes, but does make the code a little
cleaner.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Philip Withnall 66777b1b75 lib/repo-pull: Use GCC `?:` ternary shortcut where appropriate
This introduces no functional changes; just makes the code a bit shorter
in a few places.

https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Philip Withnall 8593357902 lib/repo-pull: Use values from struct in enqueue_one_object_request()
This introduces no functional changes, but will make some upcoming
refactoring a little easier.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1599
Approved by: jlebon
2018-05-25 13:12:33 +00:00
Alexander Larsson 5f82503a01 fsck: Add --all to print all corrupted object
Stopping on the first error is nice if you just want to know if everything is ok, but
if you want to figure out all that is wrong its nice to be able to continue and
print all corruptions.

Closes: #1591
Approved by: cgwalters
2018-05-24 21:00:52 +00:00
Alexander Larsson ef86abe228 fsck: Include the commits that contain the corruption in errors
This makes it easier to figure out what the corruption affects.

Closes: #1591
Approved by: cgwalters
2018-05-24 21:00:52 +00:00
Matthew Leeds 0d53e5d309 bash-completion: Don't add a space after files and directories
Currently if ostree is completing a file or directory for you it adds a
space to the end, but this is an inconvenience when it's an intermediate
directory in a tree. It's better to let the user add the space after the
final directory, so this commit changes the bash completion to avoid
adding a space when completing files or directories.

Closes: #1598
Approved by: jlebon
2018-05-24 12:59:49 +00:00
Colin Walters 9131d8a4cc lib/sysroot: Add wrapper API to prune system repository
The initial motivation for this is that the "staging" code currently
didn't rewrite the deployment refs, meaning that the staged commit
could be pruned.

Hence first, this new API ensures that deployments also
hold a strong ref to their commit, without relying on the magical
"deployment refs" that we inject.  That has always been a weird
artifact of the strict layering separation between OstreeSysroot
and OstreeRepo.

I also plan to change rpm-ostree to start using this API to
hold references to base layers for client-side layering; it also
today generates various refs.

That said, if we still want to support multiple processes
writing to a single repo (as happens on EndlessOS today) we
still need to write refs; perhaps later we could add a concept
of "generators" or something that create refs based on whatever
logic?

Another minor thing this fixes is that we had a printf inside
the library; this propagates the pruned data to the higher level
which can log however it likes.

Closes: #1566
Approved by: jlebon
2018-05-24 12:56:11 +00:00
Colin Walters 371081d123 lib: Add a public helper method for pruning to find all ref'd commits
Prep for reworking how we do sysroot cleanup.  We're going to
start doing more lowlevel pruning work there, and I wanted to avoid
duplicating the ref enumeration.

Closes: #1566
Approved by: jlebon
2018-05-24 12:56:11 +00:00
Andrea Galbusera ce2995e1dc u-boot: add support for devicetree
Likewise the corresponding support for syslinux introduced by commit
c5112c25e4, this one enables writing devicetree
filename into the uEnv.txt environment file for u-boot.

Since u-boot does not strictly defines variable names, here 'fdt_file' was
chosen as it appear to be one the most frequently adopted names in u-boot
default environments. Outer boot logic should of course comply with this choice
and use $fdt_file as the device tree file name to pass to boot commands.

This was tested on a custom board booting with u-boot.

Closes: #1590
Approved by: cgwalters
2018-05-23 12:25:38 +00:00
Arnaud Rebillout 4b330feed6 docs: var/local -> var/usrlocal
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>

Closes: #1588
Approved by: jlebon
2018-05-15 16:01:05 +00:00
Simon McVittie 1dcc31f8d7 2018.5-1 2018-05-15 11:30:10 +01:00
Simon McVittie 79dd1ee01e Update for new lib/systemd/system/ostree-finalize-staged.service
- d/ostree-boot.install: Add new systemd service
    lib/systemd/system/ostree-finalize-staged.service
  - d/rules: Remove lib/systemd/system/ostree-finalize-staged.service
    until we build ostree-boot
2018-05-15 11:30:01 +01:00
Simon McVittie b4b2ce459d d/p/Don-t-write-to-parent-repo.patch: Drop, applied upstream 2018-05-15 11:18:43 +01:00
Simon McVittie ece7b1c3e0 New upstream release
- d/copyright: Upstream clarified that only doc/ is CC-BY-SA-3.0 or
    GFDL-1.3-or-later, and doc/ isn't included in dist tarballs, so
    remove those licenses
  - d/libostree-1-1.symbols: Update (and sort)
2018-05-15 11:18:01 +01:00
Simon McVittie d1427bd3fc Update upstream source from tag 'upstream/2018.5'
Update to upstream version '2018.5'
with Debian dir 743711762b
2018-05-15 11:05:15 +01:00
Simon McVittie 144d8ab093 New upstream version 2018.5 2018-05-15 11:05:08 +01:00
Jonathan Lebon 7a1ac8ef15 ci: Add .papr-ex.yaml
I'd like to start working towards migrating the OSTree CI towards the
new PAPR model running in PACI. In order to take it for a test drive
(pun intended) without yet replacing our current CI, the new PAPR now
knows to look for a `.papr-ex.yaml` file. So as to not conflict with the
current PAPR, no GitHub statuses will be output other than a
`required-ex` label, which plays the same role as `required`. For more
information, see:

85b1d0a91e

The `.papr-ex.yaml` version is essentially the same except for:

1. the `FAH27-insttests` suite runs directly in the scheduled container
   (notice the new `kvm: true` key)
2. the `host:` based contexts (rpm-ostree and flatpak) are missing since
   we don't support provisioning a host just yet

Keeping them in sync could get annoying, though building confidence in
the new approach will allow us to migrate faster.

Closes: #1587
Approved by: cgwalters
2018-05-11 20:26:09 +00:00
Colin Walters 79c2d76e9f Post-release version bump
Closes: #1586
Approved by: jlebon
2018-05-11 15:52:05 +00:00
Colin Walters 986f176e7c Release 2018.5
Lots of stuff queued up.

Closes: #1585
Approved by: jlebon
2018-05-11 13:06:19 +00:00
Colin Walters 6873650cae lib/sysroot: Add OSTREE_EX_STAGE_DEPLOYMENTS environment variable
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
2018-05-11 12:39:17 +00:00
Colin Walters 605d313206 tests/installed: Disable all rpmmd repos
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: jlebon
2018-05-11 12:39:17 +00:00
Colin Walters ba628da9ad ci: Switch libgcrypt URL
Since the previous one wasn't made into an update, it got GC'd.

Closes: #1584
Approved by: jlebon
2018-05-10 14:15:32 +00:00
Jonathan Lebon 44706430f4 libglnx: Bump to fix F28 compilation
Pull in https://github.com/GNOME/libglnx/pull/104 to fix compiling on
F28.

Update submodule: libglnx

Closes: #1580
Approved by: cgwalters
2018-05-08 21:30:15 +00:00
Jonathan Lebon 053efeb23a docs: Add "Hello World" example
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
2018-05-08 14:49:59 +00:00
Colin Walters a3295ee584 ci: Drop str hotpatch
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
2018-05-08 12:57:35 +00:00
Tobias Mueller 5ee78ea42a repo: handle GPG_ERR_AMBIGUOUS_NAME in sign_data
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
2018-05-06 10:46:07 +00:00
Colin Walters 579faf92fd tests: Fix installed tests more
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
2018-05-04 19:25:32 +00:00
Jonathan Lebon 589e97dc60 lib/commit: Fix function name typo in docstring
Closes: #1575
Approved by: cgwalters
2018-05-04 14:51:07 +00:00
Jonathan Lebon bd904b26e1 lib/deploy: Add semi-colon in post-deployment msg
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
2018-05-04 14:51:07 +00:00
Colin Walters 956618a188 tests: Tweak staged-deploy test to be faster
Work around https://github.com/ostreedev/ostree/issues/1569

Closes: #1573
Approved by: jlebon
2018-05-04 13:06:37 +00:00
Colin Walters 490cfbe226 README: Tweak licensing description
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
2018-05-04 11:29:44 +00:00
Colin Walters d0a1832347 deploy: Use fdatasync() for new kernel/initramfs by default
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
2018-05-02 19:37:52 +00:00
Colin Walters 9f8e2b8862 lib: Use `Locking:` term in docs
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
2018-05-02 17:28:29 +00:00
Colin Walters 5337ba51b2 lib/deploy: Do post-ops when removing staged commit
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
2018-05-02 16:22:34 +00:00
Colin Walters 25ba8db987 lib/deploy: Throw an error if trying to stage when not ostree-booted
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
2018-05-02 13:27:01 +00:00
Colin Walters f5f8e2c540 lib/sysroot: Maintain one variable for "root is ostree booted"
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
2018-05-02 13:27:01 +00:00
Colin Walters 36ac768fb7 repo: Add checksum to error message opening unreadable object
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
2018-05-01 19:22:10 +00:00
Colin Walters 11c12cc19a deploy: Don't prune repo at finalization time by default
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
2018-05-01 13:59:07 +00:00
Colin Walters 33d5b6f514 bin/admin-cleanup: Port to decl-and-initialize style
No functional changes.

Closes: #1567
Approved by: jlebon
2018-05-01 13:59:07 +00:00
Simon McVittie f0708b3441 build: Don't distribute Bison-generated parser in dist tarballs
Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1563
Approved by: cgwalters
2018-04-30 18:31:24 +00:00
Jonathan Lebon a85f06952d man/ostree-init: Briefly describe various modes
Closes: #1561

Closes: #1560
Approved by: cgwalters
2018-04-30 17:58:38 +00:00
Jonathan Lebon 54c5ab76a9 man/ostree: Document --repo option a bit more
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
2018-04-30 17:58:38 +00:00
Colin Walters 8c1542134c lib/repo: Enable locking by default, but drop external API
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
2018-04-30 17:24:51 +00:00
Colin Walters 776ce5cc6a README.md: Fix docs link to COPYING
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
2018-04-30 14:33:37 +00:00
Colin Walters cd17e364ae deploy: Return staged deployment
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
2018-04-27 19:41:19 +00:00
Colin Walters 06d39efcb5 bin/deploy: Avoid loading merge deployment kargs unless necessary
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
2018-04-27 17:48:21 +00:00