Commit Graph

1289 Commits

Author SHA1 Message Date
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
Colin Walters 000dd5add3 admin: Add API to OtBootloader to get name
https://bugzilla.gnome.org/show_bug.cgi?id=706548
2013-08-22 07:37:21 -04:00
Javier Martinez Canillas 6f6c87877e admin: Don't fail to deploy if there isn't a bootloader config
Currently, when deploying an OSTree that does not contain a
bootloader configuration it fails with the following message:

"No known bootloader configuration detected"

A bootloader configuration is not strictly necessary if the
bootloader used is able to parse /boot/loader/entries on boot.

So, failing to deploy seems to be a little harsh. It is better
to just not write the bootloader configuration if a previous
one was not found but still swap the bootversion.

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

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
2013-08-22 05:52:16 -04:00
Colin Walters 8abad0b452 admin: Write out correct version fields in boot/loader/entries files
Before, we were writing the "bootversion", which is either 0 or 1, for
all entries.  This is completely wrong; the idea of the "version"
field is to compare between entries.

Fix this by writing out the inverted index - internally, index 0 is
the *first* boot entry, so we give it the highest version number, and
index N is the last, so give it version 0.

Then fix the deployment sorting code to correctly reverse the version
number comparison, so we read back the right order.

In practice before this bug didn't matter because "normally" you only
have at most two deployments.

https://bugzilla.gnome.org/show_bug.cgi?id=706546
2013-08-22 05:46:11 -04:00
Colin Walters 7e2e072ad4 doc: Add repo docs 2013-08-21 09:29:04 -04:00
Colin Walters caf6be331b libostree: Check out directories depth-first in serial, switch to sync API
The way we recurse into subdirectories in parallel makes it far too
easy to hit up against the arbitrary Linux fd limit of 1024.

Since the fix here is about dropping parallelism, let's just go all
the way for now and make a plain old synchronous API =(

This does simplify both internal callers which wanted a sync API
anyways.

https://bugzilla.gnome.org/show_bug.cgi?id=706380
2013-08-21 09:22:37 -04:00
Javier Martinez Canillas 750a60d3aa main: Add U-Boot bootlader backend support
This patch adds support to generate files that
can be used by Universal Bootloader (U-Boot).

U-Boot allows to modify boards default boot commands by
reading and executing a bootscript file or importing a
plain text file that contains environment variables that
could parameterize the boot command or a bootscript.

OSTree generates a uEnv.txt file that contains booting
information that is taken from Boot Loader Specification
snippets files as defined in the new OSTree deployment model:

https://wiki.gnome.org/OSTree/DeploymentModel2

On deploy or upgrade an uEnv.txt env var file is created
in the path /boot/loader.${bootversion}/uEnv.txt. Also, a
/boot/uEnv.txt symbolic link to loader/uEnv.txt is created
so U-Boot can always import the file from a fixed path.

Since U-Boot does not support a menu to list a set of
Operative Systems, the most recent bootloader configuration
from the list is used.

To boot an OSTree using the generated uEnv.txt file, a
board has to parameterize its default boot command using the
following variables defined by OSTree:

${kernel_image}:  path to the Linux kernel image
${ramdisk_image}: path to the initial ramdisk image
${bootargs}:      parameters passed to the kernel command line

Alternatively, for boards that don't support this scheme,
a bootscript that overrides the default boot command can be used.

An example of such a bootscript could be:

setenv scriptaddr 40008000
setenv kernel_addr 0x40007000
setenv ramdisk_addr 0x42000000
ext2load mmc 0:1 ${scriptaddr} uEnv.txt
env import -t ${scriptaddr} ${filesize}
ext2load mmc 0:1 ${kernel_addr} ${kernel_image}
ext2load mmc 0:1 ${ramdisk_addr} ${ramdisk_image}
bootm ${kernel_addr} ${ramdisk_addr}

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=706370
2013-08-20 13:00:46 -04:00
Javier Martinez Canillas cf14b398da admin: Extract ot_admin_join_config_lines() helper function
ot-bootloader-syslinux.c has a join_lines() function that is rather
generic and can be used in other places. Let's add it as a helper
function.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=706370
2013-08-20 13:00:19 -04:00
Javier Martinez Canillas 2033edc658 test: fix a trivial typo in libtests.sh
When running the test-admin-deploy-1.sh unit test,
cat shows the following error:

cat: boot/vmlinuz-3-6.0: No such file or directory

due a trivial typo in the kernel image file name.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=706371
2013-08-20 06:46:52 -04:00
Colin Walters 871be4b75a libostree: Extend gtk-doc coverage for refs and prune APIs 2013-08-19 10:32:08 -04:00
Colin Walters 6a8e9d7151 ostree.doap: Update description based on docs. 2013-08-19 10:32:08 -04:00
Colin Walters 16c36fbc34 main: Use macro to reduce duplication among builtin prototypes
Just less code.
2013-08-19 10:32:08 -04:00