Commit Graph

1350 Commits

Author SHA1 Message Date
Colin Walters
79c922a00b core: Remove unused prototypes 2013-09-04 07:54:32 -04:00
Colin Walters
ee2b66ef00 core: Make a helper function private
Nothing was using this, so make it private.
2013-09-04 07:53:02 -04:00
Colin Walters
2534714501 core: Make ostree_write_variant_with_size() private
More work making the file formats and utilities private.
2013-09-04 07:49:41 -04:00
Colin Walters
0d72168961 libostree: Make the format of file objects private
It's now isolated almost entirely to ostree-core.c, except
ostree-repo.c needs to know how to create archive-z2 file headers.  So
give it a private API for that.
2013-09-03 18:43:42 -04:00
Colin Walters
356de33b49 repo: Drop ostree_repo_load_variant_c API
Originally we had this to avoid forcing callers to malloc() if they
had a csum, but nowadays we have in-place conversion APIs that are
fast enough.
2013-09-03 18:23:11 -04:00
Colin Walters
dd7d2f7b43 repo: Only apply setuid/xattrs after checksum validation
See the new comment in the source; basically if we're fetching content
over http, then someone with the capability to MITM the network could
create a transient setuid binary on disk with arbitrary content.  If
they also had a process running on the system (such as an application)
it could be escalated to root.

https://bugzilla.gnome.org/show_bug.cgi?id=707139
2013-09-02 15:31:55 -04:00
Colin Walters
597da6ca6b libostree: Change synchronous fetching API to return a stream
There's not a good reason to write small things such as repo/config to
the filesystem, only to read them back in again.  Change the
non-partial API to just return a stream, then read it into a memory
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=707157
2013-09-02 14:48:21 -04:00
Colin Walters
95a78542e9 fetcher: Only open files when we are ready to write to them
Otherwise we quickly run out of file descriptors when doing large
requests.

https://bugzilla.gnome.org/show_bug.cgi?id=707157
2013-09-02 14:48:21 -04:00
Colin Walters
8b5f684b68 fetcher: Clean up code to avoid intermediate files
I think originally we had the .part/.done separation because we were
trying to support partial downloads of files like repo/config and
repo/refs.

But now that the http server configuration won't give us partial
results, we don't need to support caching those files between runs.

And thus, there's no reason to have the .part/.done and do the dance
with renaming them.

When fetching objects/ and other things that use _with_async, we
continue to use _append_to(), and if the returned range tells us we
have all the bytes, then we hand the full file over to the caller.

Don't attempt to shortcut in the case where the last run told us we
already have the object; the object fetcher code will not make a
request.

While we're here, also clean up use of GError and consistently use the
cancellable from the pending.

https://bugzilla.gnome.org/show_bug.cgi?id=707157
2013-09-02 14:48:20 -04:00
Colin Walters
9e497a4ce7 prepare-root: Fix ostree= kernel argument at end
Extracting the code for parse_ostree_cmdline() and running it on some
test input (on RHEL6.4 glibc), I can reproduce the odd behavior from
getline() where it apparently returns the size of the default malloc
buffer in the size output, and some non-zero value.

This behavior would be OK except that it breaks the logic for
stripping off the trailing newline, which in turn breaks booting
because we return "ostree=foo\n".

This has worked so far in gnome-ostree because syslinux apparently
injects initrd=/path/to/initrd as a final kernel argment.

Anyways, we don't handle NUL characters here in /proc/cmdline, so
let's just call strlen () to be safe.

https://bugzilla.gnome.org/show_bug.cgi?id=707192
2013-09-02 13:27:41 -04:00
Jasper St. Pierre
52dd6b0b74 libostree: Make introspectable again
At some point, the variable name for the headers changed and the
introspection build line forgot to be updated.

https://bugzilla.gnome.org/show_bug.cgi?id=707228
2013-09-01 11:19:15 -04:00
Colin Walters
b2625268aa tests: Drop kernel modules from checksums
We can actually share these across different kernels.  Thanks to
Tobias Hunger <tobias.hunger@gmail.com> for pointing this out.
2013-08-30 18:12:31 -04:00
Colin Walters
72a8f41ad4 admin: Error out if we see malformed or mismatched checksums for /boot
The kernel/initramfs both need to end in -SHA256 and match.
2013-08-30 18:10:35 -04:00
Colin Walters
23e2593b6d repo: Use non-deprecated API with sufficiently new libarchive
Based on a patch Tobias Hunger <tobias.hunger@gmail.com>
2013-08-30 14:34:32 -04:00
Tobias Hunger
2a14f2cd52 Fix warning about format string not being a string literal 2013-08-30 14:26:24 -04:00
Tobias Hunger
ed56908ccb Fix warnings about unused variables 2013-08-30 14:23:45 -04:00
Tobias Hunger
4cdd444dcf gitignore: Add ostree-prepare-root and ostree-remount binaries 2013-08-29 19:27:47 -04:00
Stef Walter
a4c3c4ae38 ostree: Support for using EDITOR to fill commit subject/body
Behave similar to git when 'ostree commit' is run without
a --subject or --body. Bring up an editor. The first line becomes
the subject and following lines become the --body after an optional
blank line.

Use similar logic to git in determining EDITOR

https://bugzilla.gnome.org/show_bug.cgi?id=707063
2013-08-29 21:08:32 +02:00
Stef Walter
1a708accf1 ostree: Fix bug printing out commit body
Body was printed out repeated and mangled due to bad printf format string.

https://bugzilla.gnome.org/show_bug.cgi?id=707067
2013-08-29 21:07:18 +02:00
Colin Walters
8fce2513e9 pull: Clean up synchronous fetching code
Fold in fetch_uri to fetch_uri_utf8(), and rename the latter to
include _sync as a suffix, since it's synchronous.

Improve the status line to show when we're fetching a synchronous URI;
previously we just showed "Scanning metadata".

https://bugzilla.gnome.org/show_bug.cgi?id=707023
2013-08-29 08:01:51 -04:00
Colin Walters
c9d7050d3d main: Support passing bare directory names to commit
It segfaulted before if you passed non-options, and a single directory
name is probably what people want.
2013-08-28 17:32:21 -04:00
Jeremy Whiting
499df2a90b pull: Add support for resuming downloads via range requests
Use a consistent temporary filename to download uri's.
Check for downloaded files before fetching from uri.
Download to hash.part file, then copy/move to hash.done when complete.
Add argument support to setup_fake_remote_repo1 function.
Add test for pull resume.
To implement this, pass --force-range-requests into the trivial-httpd,
which will only serve half of the objects to clients at a time.

https://bugzilla.gnome.org/show_bug.cgi?id=706344
2013-08-28 14:35:54 -04:00
Jeremy Whiting
902848cd71 test: Improve pull corruption test
To verify pull with a second repo works.
2013-08-27 20:35:45 -04:00
Colin Walters
bb8418ff01 build: Add a note that ostree only supports InstalledTests 2013-08-27 19:34:58 -04:00
Colin Walters
d92eedac4a repo: Clean up tmpdir also on transaction abort
Pull the cleanup code to a helper function, and ensure we delete
leftover temporary files also when aborting a transaction.  Mainly
this will happen if a local 'ostree commit' fails.

While we're here, also change it to use gs_shutil_rm_rf() which also
handles directories, should we start using those.

Reviewed-by: Jeremy Whiting <jpwhiting@kde.org>
2013-08-27 11:35:45 -04:00
Jeremy Whiting
d58a4c9f79 repo: Clean up temporaries after a transaction completes
Prevously, we were just leaving temporary files there forever if
a transaction was interrupted.

https://bugzilla.gnome.org/show_bug.cgi?id=706344
2013-08-27 11:35:36 -04:00
Colin Walters
dd3d522fa8 trivial-httpd: Add missing include for shutdown() on eglibc 2013-08-26 17:57:43 -04:00
Jeremy Whiting
e7f115d688 trivial-httpd: Close the socket when sending partial files
This will force the client to re-request them, which will be used to
test interrupted "ostree pull" requests.

https://bugzilla.gnome.org/show_bug.cgi?id=706344
2013-08-26 17:53:39 -04:00
Colin Walters
0590684e03 Release 2013.6 2013-08-25 23:34:51 -04:00
Colin Walters
bd5eb72e10 doc/adapting-existing: Describe /lib/passwd 2013-08-25 16:12:14 -04:00
Colin Walters
edfa76fad5 main: Code cleanup by passing OstreeRepo * directly to builtins
It turns out every builtin (with one special exception) that takes a
repo argument did the same thing; let's just centralize it.  The
special exception was "ostree init --repo=foo" where foo is expected
to *not* actually be a repo.  In that case, simply skip the
ostree_repo_check() invocation.

https://bugzilla.gnome.org/show_bug.cgi?id=706762
2013-08-25 15:28:23 -04:00
Colin Walters
6c61b19107 libostree: Improve commit filter API
Make the structure private, and document the flags.

https://bugzilla.gnome.org/show_bug.cgi?id=706214
2013-08-25 15:23:23 -04:00
Colin Walters
94ce562905 pull: Drop obsoleted "related objects" API
We removed support for writing "related objects" from ostree commits
in ostree git c9b61cbfee because it just
didn't work out as an idea.  This also removes the API and code from
"ostree pull".

Note there was no test suite coverage.

https://bugzilla.gnome.org/show_bug.cgi?id=706342
2013-08-25 15:20:13 -04:00
Colin Walters
b600ae5939 repo: Fix object storage size API to be 64 bit
This fixes a pointer size warning on 32-bit builds.

https://bugzilla.gnome.org/show_bug.cgi?id=706235
2013-08-25 15:19:54 -04:00
Colin Walters
3aa8f86b4a doc: Minor tweaks 2013-08-25 10:32:40 -04:00
Colin Walters
b06e10ebf9 doc/adapting-existing: Elaborate a bit more on FS layout and links 2013-08-25 10:23:19 -04:00
Colin Walters
1ab01a6b35 doc/adapting-existing: A bit more elaboration and a typo fix 2013-08-24 19:18:57 -04:00
Colin Walters
84f2cd249a doc: Add some docs about adapting existing package managers 2013-08-24 11:35:42 -04:00
Colin Walters
db4aecee44 pull: Update comment to better reflect current reality 2013-08-23 17:31:24 -04:00
Colin Walters
7751d3d9cd doc/repo: Describe object types 2013-08-23 17:21:31 -04:00
Colin Walters
0e60912155 doc/overview: Add a note about the GPL 2013-08-23 17:21:19 -04:00
Colin Walters
2b6d7d8d93 doc: Add a section about how atomic upgrades work
Migrating some content from
https://live.gnome.org/OSTree/DeploymentModel2
2013-08-23 13:18:07 -04:00
Vivek Dasmohapatra
14c9f88e9c trivial-httpd: Handle the autoexit case when the docroot is a symlink 2013-08-23 12:39:24 -04:00
Vivek Dasmohapatra
3dc6cedba5 trivial-httpd: Close stdout & stdin so $() can capture output when daemonized
Will be used by tests.
2013-08-23 12:28:37 -04:00
Vivek Dasmohapatra
4f127b2d7d trivial-httpd: Handle -p - as meaning write-port-to-stdout
This is convenient to use from tests.
2013-08-23 12:28:33 -04:00
Vivek Dasmohapatra
b6d77f6ad6 fetcher: Return NOT_FOUND when the HTTP code is 410 or 404
This will be used by the pull code to download optional data.
2013-08-23 12:15:49 -04:00
Colin Walters
fe5dd07772 main: Drop --archive option from init, now that the code is removed
Commit 1ec7c30408 removed archive mode,
so this bit needs to be removed too.

https://bugzilla.gnome.org/show_bug.cgi?id=706327
2013-08-23 09:55:09 -04:00
Colin Walters
032f1316ad doc: Split overview into chapters, expand a bit 2013-08-22 09:17:08 -04:00
Colin Walters
d58d6a6ef2 doc: Add a section on deployments 2013-08-22 09:09:05 -04:00
Javier Martinez Canillas
695621db05 admin: notify detected bootloader configuration
OSTree now supports multiple bootloader backends so
notify which bootloader configuration was detected.

https://bugzilla.gnome.org/show_bug.cgi?id=706548

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
2013-08-22 07:37:21 -04:00