2253 Commits

Author SHA1 Message Date
Colin Walters
6335dadb49 Release 2015.11 v2015.11 2015-12-04 09:53:03 -05:00
Colin Walters
ed9f5ce031 gpg-verifier: Fix compiler warning 2015-12-04 09:51:14 -05:00
Matthew Barnes
94bc9765d5 repo: Fix backwards timestamp in ostree_repo_write_commit()
ostree_repo_write_commit_with_time() converts the timestamp to
big-endian byte order.

ostree_repo_write_commit() was also doing this when calling
ostree_repo_write_commit_with_time(), resulting in a corrupted
commit object (timestamp bytes were backwards).

Recent regression in 14ffd7022a8c840f277c81e53864be4ea5fabacb
2015-12-03 12:43:52 -05:00
Matthew Barnes
a02174b0ba remote: Print full refspec in "ostree remote refs"
Just to make copy-and-paste a little easier, as I often use this command
immediately before rebasing.

 e.g.

 # ostree remote refs fedora-atomic
 fedora-atomic:fedora-atomic/f23/x86_64/docker-host
 fedora-atomic:fedora-atomic/f23/x86_64/testing/docker-host
 ^^^^^^^^^^^^^^ (this part is new)

 # rpm-ostree rebase fedora-atomic:fedora-atomic/f23/x86_64/testing/docker-host
2015-12-02 23:13:44 -05:00
Matthew Barnes
581b7d6183 fetcher: Remove "total_requests" counter
Incremented, but not used for anything.
2015-12-01 12:34:34 -05:00
Matthew Barnes
97efe12ac6 fetcher: Remove "sending_messages" hash table
Vestige of ostree_fetcher_query_state_text(), removed last year.
2015-12-01 12:34:28 -05:00
Matthew Barnes
70e121c159 glnx: Update from master
More autocleanup backports, this time GFileOutputStream.
2015-11-23 14:49:06 -05:00
Matthew Barnes
74d8e5f159 trivial-httpd: Avoid SoupBuffer when there's no content
This was supposed to be merged into the previous commit, but I
messed up.
2015-11-23 14:30:31 -05:00
Matthew Barnes
df75fc232a repo: Never delete .commitmeta files
Do not delete a .commitmeta file after removing the last metadata entry.
This way a client will pull the empty .commitmeta file and overwrite old
metadata as expected.

https://bugzilla.gnome.org/750459
2015-11-23 14:22:45 -05:00
Matthew Barnes
5307af5a7a repo: Validate checksums have correct length
ostree_checksum_bytes_peek() can return NULL if the checksum has an
incorrect length (most likely from disk corruption) but most callers
are not prepared to handle this and would likely crash.

Use ostree_checksum_bytes_peek_validate() instead, which sets a
GError on an invalid checksum.
2015-11-17 20:35:54 -05:00
Giuseppe Scrivano
45cee1bd70 tests: prefix invocation of ostree with where missing
And add a syntax rule to avoid this in future.

Fixed by:

sed -i -e 's|^ostree |${CMD_PREFIX} ostree |g' tests/*.sh

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:55 +01:00
Giuseppe Scrivano
11bc9e58c1 tests: add tests for prune --keep-younger-than=DATE
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:55 +01:00
Giuseppe Scrivano
68f70d8e74 commit: add --timestamp=TIMESTAMP
It allows to override the timestamp of the commit.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:55 +01:00
Giuseppe Scrivano
14ffd7022a libostree: add new API ostree_repo_write_commit_with_time
It extends ostree_repo_write_commit as it permits to override the
commit timestamp.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:55 +01:00
Giuseppe Scrivano
b393e5a2e9 ostree: do not print the usage on each G_IO_ERROR_NOT_SUPPORTED
It may have a different meaning, and the usage screen is not helpful.

Print the usage screen only when the command is not found.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:55 +01:00
Giuseppe Scrivano
f506644830 pull: make slightly clearer when failing for missing xattrs support
It is not clear why pull fails on tmpfs.  The additional message might
be helpful.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:55 +01:00
Giuseppe Scrivano
f56688da71 prune: add --keep-younger-than=DATE
The format used for DATE is "%Y-%m-%d %H:%M:%S %z"

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 11:07:38 +01:00
Giuseppe Scrivano
daa6f150c4 tests: add test for ostree prune --delete-commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 10:57:33 +01:00
Giuseppe Scrivano
0dee70bcd6 fsck: create a tombstone when the parent is missing
Change the previous logic that a tombstone commit was created when
a partialcommit is found.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 10:57:33 +01:00
Giuseppe Scrivano
0aa836c205 prune: add --delete-commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-16 10:57:33 +01:00
Matthew Barnes
a19a112d9d libostree: Fix a couple compiler warnings 2015-11-12 14:32:07 -05:00
Alexander Larsson
1c056eb282 deltas: Support including detached metadata in static deltas
This is very useful for the inline-parts case, as you can then include
detached signatures in a single file representing the commit.

It is not as important for the generic pull case, as the detached
metadata is only a single small file. Additionally the detached
metadata is not content referenced and may change after the static
delta file was created, so we need to pull the latest version anyway.
2015-11-10 08:56:16 +01:00
Alexander Larsson
598afd5030 pull: Verify checksums from static deltas unless gpg signed summary
Otherwise untrusted repos can lie about the commit ids.
2015-11-10 08:56:15 +01:00
Alexander Larsson
ec56fea821 deltas: Support passing filename to ostree_repo_static_delta_execute_offline
If you pass a diriectory it will look for the "superblock" child, otherwise
it will use the file as the superblock. I need this in xdg-app to be able
to install any filename as a bundle.
2015-11-10 08:56:15 +01:00
Alexander Larsson
dac57b6410 deltas: Support passing filename to delta generator 2015-11-10 08:56:15 +01:00
Alexander Larsson
b22b859dc5 deltas: Make min-fallback-size 0 actually disable fallbacks
This is what the docs specify.
2015-11-10 08:56:14 +01:00
Alexander Larsson
78f14555c8 deltas: Verify checksums in apply-offline unless skip_validate is TRUE 2015-11-10 08:56:14 +01:00
Alexander Larsson
7a4fb1b2f1 Add _ostree_repo_open|commit_untrusted_content_bare
Also renames OstreeRepoTrustedContentBareCommit to
OstreeRepoContentBareCommit so that it can be used by both.

This will be needed when we introduce checksum verification of objects
in static deltas.
2015-11-10 08:56:14 +01:00
Alexander Larsson
3fa3e12e02 static-delta apply-offline: Don't skip validation
This makes no sense, at least by default.
2015-11-10 08:56:13 +01:00
Alexander Larsson
e418acb31b delta: Ensure the from commit exists when applying static delta 2015-11-10 08:56:13 +01:00
Alexander Larsson
eaa678eaa4 deltas: Make apply-offline only read the parts once
No need to read() the file for the checksum if we then directly mmap it.
Instead we just mmap it initially and checksum from that.
2015-11-10 08:56:13 +01:00
Alexander Larsson
ee70ffbbcb Add tests for inline static deltas 2015-11-10 08:56:13 +01:00
Alexander Larsson
ccb77d3bd8 static-deltas generate: Add --inline option to CLI tool 2015-11-10 08:56:12 +01:00
Alexander Larsson
11a79220e2 static deltas: Add support for inline-parts
In this mode the parts are stored in the metadata of the main delta
superblock file.  This can be useful if you want a single-file delta
for easy transport, or for http in the case the delta is very small.
2015-11-10 08:56:12 +01:00
Alexander Larsson
30768a979f generate-static-delta: Support min-fallback-size 0 to disable fallbacks 2015-11-10 08:56:12 +01:00
Colin Walters
efdb4d8f44 docs: Note not to put private keys in /usr/share/ostree
https://bugzilla.gnome.org/show_bug.cgi?id=757524
2015-11-07 21:15:20 -05:00
Giuseppe Scrivano
438e21e858 tests: add tests for prune and tombstones commits
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Giuseppe Scrivano
29c425e742 fsck: add argument --add-tombstones
It is used to create tombstones for missing commits

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Giuseppe Scrivano
646fe139e6 repo: create a tombstone commit when deleting a commit
When a commit is deleted and the repo is configured to use tombstone
commits, create one.  Delete the tombstone file only if the commit is
pulled again.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Giuseppe Scrivano
76c5cc07db pull: add support for tombstone commits
Add a new object type: OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT that is
used when a commit was intentionally removed.

If the remote repository doesn't use tombstone commits, do not fail on
a missing commit (change 0b795785dd81cd1e8c2c5960f0959740bce72a51).

When the remote repository uses tombstones, if a commit cannot be
found, check if the tombstone file is present and fail if it is not
present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Giuseppe Scrivano
048c27588a core: use OSTREE_OBJECT_TYPE_LAST instead of OSTREE_OBJECT_TYPE_COMMIT
OSTREE_OBJECT_TYPE_LAST holds the value of the last element in the enum.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-03 09:53:38 +01:00
Colin Walters
7bf138b036 init-fs: Explicitly set /tmp to 01777
I think most people were using tmpfs-on-tmp and so didn't hit this.

See https://bugzilla.redhat.com/show_bug.cgi?id=1276775
2015-10-30 17:11:09 -04:00
Colin Walters
723705b803 sysroot: Write symlinks before calling fsync(), then rename after
There might be a race here in that we create new symlink files *after*
calling `syncfs`, and they are not guaranteed to end up on disk.

Rework the code so that we create symlinks before, and then only
rename them after (and `fsync()` the directory for good measure).

Additional-fixes-by: Giuseppe Scrivano <gscrivan@redhat.com>
Tested-by: Giuseppe Scrivano <gscrivan@redhat.com>

This still needs verification that we're fixing a real bug; but I'm
fairly confident this won't make the fsync situation worse.

https://bugzilla.gnome.org/show_bug.cgi?id=755595
2015-10-25 11:46:41 -04:00
John Hiesey
70c07a6338 static-delta: Fix annotation on ostree_repo_list_static_delta_names
out_deltas should be (transfer-container)
2015-10-21 21:09:23 -04:00
Daniel Drake
598530daf4 prepare-root: set up /boot bind-mount for single partition systems
When booting from a system with /boot on the main partition, set up
an appropriate bind mount during boot. The ostree runtime binary
expects to be able to access the bootloader configs at /boot.

See: https://mail.gnome.org/archives/ostree-list/2015-July/msg00015.html

https://bugzilla.gnome.org/show_bug.cgi?id=756267
2015-10-15 21:36:21 -04:00
Matthew Barnes
2210a79bfa upgrade: Add --override-commit=CHECKSUM option
Adds an entry to the origin file to force the OstreeSysrootUpgrader to
pull and deploy the given checksum.

  [origin]
  override-commit=CHECKSUM

If the option is not given, any such entry is explicitly removed from
the origin file to ensure we upgrade to the latest available commit.
2015-10-13 12:34:57 -04:00
Matthew Barnes
39b732ffaa upgrader: Allow overriding the commit to pull
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.
2015-10-13 12:34:56 -04:00
Matthew Barnes
41ab26356c upgrader: Add ostree_sysroot_upgrader_dup_origin()
Convenience function returns a copy of the origin file, useful when
modifying it.
2015-10-13 12:34:56 -04:00
Giuseppe Scrivano
442dcec43b tests: fix LZMA test to really compress/decompress
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-13 15:24:09 +02:00
Gatis Paeglis
b69a88b111 Don't require /boot/uEnv.txt for u-boot support
The current code checks if /boot/uEnv.txt is a symlink to
decice if sysroot requires u-boot support. Why this is bad:

There are 2 ways to provide a custom env to u-boot from user space:

1) A compiled binary that is sourced from u-boot.
2) A text file (usually /uEnv.txt) that is imported into env from u-boot.

The current OSTree u-boot integration code was designed with the 1st
case in mind.

Many bootscripts provided by an embedded device vendors expect
to find uEnv.txt in the top level directory, it is often hardcoded
when building u-boot and is difficult to change later on. Or in other
cases it is stored in read-only memory so changing it would require
re-flushing boot loader with a new env. So the issue here is that
OSTree's and vendor uEnv.txt want to exist and the same path and OSTree
would throw away any changes added to /uEnv.txt by user on the next
upgrade/deploy.

This patch "hides" away the OSTree's env file loader/uEnv.txt from users
who are used to edditing uEnv.txt at the top level directory. Now to add
OSTree support on such boards you can simply add a custom logic in uEnv.txt
that loads ostree env from /loader/uEnv.txt

This change is backward compatible with the previous ostree releases and
solves the issue described in:

https://bugzilla.gnome.org/show_bug.cgi?id=755787
2015-10-12 10:22:12 -04:00