Commit Graph

1254 Commits

Author SHA1 Message Date
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
Colin Walters
326be41d12 Revert "libotutil: Make use of GBytes in ot_variant_read()"
This reverts commit c77908bf514d61e75798932f61b5b414d9e36a3c; we can't
do this since g_variant_get_data_as_bytes() is a GLib 2.36 API.
2013-08-18 07:51:25 -04:00
Colin Walters
b35840e1b8 libotutil: Drop accidental use of GLib 2.36 API
Sticking with 2.34 for a while longer.
2013-08-18 07:50:50 -04:00
Colin Walters
eaee309112 Use { 0, } for structure initialization rather than memset()
It's cleaner, safer, and I had a totally wrong idea stuck in my head
about why memset() should be used.

https://bugzilla.gnome.org/show_bug.cgi?id=705968
2013-08-18 07:20:46 -04:00
Colin Walters
5f90502482 Release 2013.5 2013-08-17 17:05:17 -04:00
Colin Walters
12ccbffad7 build: Fix and prettify build option output
The documentation one was broken by the gtk-doc changes, and let's
align things.
2013-08-17 15:21:31 -04:00
Sjoerd Simons
e5d9bd97aa ostree init: Fix mode list help string
It's archive-z2, not archive-z.

https://bugzilla.gnome.org/show_bug.cgi?id=705849
2013-08-17 15:05:04 -04:00
Sjoerd Simons
d1babde95e Fix make distcheck
make distcheck was unhappy for various reasons:
  * headers aren't data, so use _HEADERS otherwise compilation fails
  * Mark the gir & typelib data as cleanfiles so they aren't left around
    after make clean
  * Don't nuke the .la file. This breaks make uninstall, leave it up to
    distributions to not install .la files if they don't want them.

https://bugzilla.gnome.org/show_bug.cgi?id=705850
2013-08-17 14:57:05 -04:00
Colin Walters
00c352ba67 libostree: Delete some leftover remnant API for archive files 2013-08-17 14:08:04 -04:00
Colin Walters
35d7b9cdbf libostree: Increase gtk-doc coverage of ostree-repo.[ch] 2013-08-17 13:57:22 -04:00
Colin Walters
1fea88e64b libostree: Add gtk-doc section for ostree-repo.c 2013-08-17 13:22:58 -04:00
Colin Walters
0f9d7d2179 libostree: More gtk-doc updates for ostree-core 2013-08-17 10:54:00 -04:00
Colin Walters
75cd17d9d9 docs: Add an overview section, migrate some content from the wiki 2013-08-17 10:16:02 -04:00
Colin Walters
abe2320039 libostree: Fix many gtk-doc warnings 2013-08-17 08:41:31 -04:00
Colin Walters
06d1a56bc9 core: Drop duplicated type declarations
3 fewer gtk-doc warnings, 99 still left on the wall...
2013-08-17 08:23:28 -04:00
Colin Walters
c3121b52bc libostree: Document more core macros 2013-08-17 08:21:04 -04:00
Stef Walter
349d7958f3 Fix use of uninitialized memory in ostree_builtin_checksum()
https://bugzilla.gnome.org/show_bug.cgi?id=705968
2013-08-17 07:07:54 +02:00
Colin Walters
aecac2fd8e TODO: Tweak 2013-08-16 23:19:30 -04:00
Colin Walters
9c79b352a1 build: Fix the build without documentation
Just key everything of gtk-doc.
2013-08-16 23:14:30 -04:00
Colin Walters
1ec7c30408 core: Remove old "archive" mode
We'll always have "bare" mode for keeping files-as-hardlinks as root.
But "archive" was my second attempt at a format for non-root file
storage, used by the gnome-ostree buildsystem which runs as non-root.

It was really handy to have a "tar" like mode where I can create
tarballs as a user, that contain files owned by root for example.

The "archive" mode stored content files as two pieces in the
filesystem; ".file" contained metadata, and ".filecontent" was the
actual content, uncompressed.  The nice thing about this was that to
check out a tree as non-root, you could just hardlink into the repo.

However, archive was fairly bad for serving via HTTP; it required
*two* HTTP requests per content object, greatly magnifing the already
inefficient fetch process.  So "archive-z2" was introduced.

To allow gnome-ostree to still check out trees as a user, the
"uncompressed-object-cache" was introduced, and that's how things have
been working for a while.

So we should just be able to kill this code.  Specifically note just
how much better the stage_object() function became.

https://bugzilla.gnome.org/show_bug.cgi?id=706057
2013-08-16 22:56:42 -04:00
Colin Walters
17560a57bf Add gtk-doc support
Yes, it's really me.  Colin Walters.  Writing documentation.  You
don't need to do a DNA test.
2013-08-16 22:56:12 -04:00
Stef Walter
f9b2c45fc0 Add 'ostree reset' command to undo a bad commit
Accepts the following arguments: ref checksum

Checks that the checksum is a parent of the ref before rewriting
the ref.

https://bugzilla.gnome.org/show_bug.cgi?id=705979
2013-08-16 17:28:43 +02:00
Colin Walters
5a4b7d708f configure: Use AS_IF() consistently
See https://bugzilla.gnome.org/show_bug.cgi?id=681413
2013-08-15 18:33:19 -04:00
Sjoerd Simons
a00eb681a0 Install systemd units in the right location
Debian uses /lib/systemd/system for system unit files, while i'm
putting ostree under the /usr prefix which means the hardcoded path
fails. Leave it to configure to work out the right location for systemd
units (method copied from pollkit).

Furthermore instead of installing the unit in local-fs.target.wants by
hand add a [Install] section so systemctl enable does the right thing

https://bugzilla.gnome.org/show_bug.cgi?id=705864
2013-08-15 18:28:04 -04:00
Colin Walters
a04bda126c core: Use gs_stream_fstat()
Just a cleanup.
2013-08-15 14:21:26 -04:00
Colin Walters
6bb4ea46ab core: Add some more gtk-doc 2013-08-15 11:17:16 -04:00
Colin Walters
1f35655ac1 core: Add some gtk-doc
Just documenting a few functions to get in the habit of things.
2013-08-15 07:04:29 -04:00
Stef Walter
3989e0d397 Add 'ostree log' command
Follows the parent of commits showing each in turn until it reaches
the top of the commit tree.

https://bugzilla.gnome.org/show_bug.cgi?id=705973
2013-08-15 07:01:30 +02:00
Stef Walter
5efb8e86e9 Add ostree_commit_get_parent() to get parent from variant
https://bugzilla.gnome.org/show_bug.cgi?id=705973
2013-08-15 06:52:53 +02:00
Stef Walter
790132a81a Intelligible display for 'ostree show'
Show something similar to git metadata display. Show raw variant
data when --raw is specified

https://bugzilla.gnome.org/show_bug.cgi?id=705973
2013-08-15 06:48:25 +02:00
Colin Walters
11bdbe1fb8 repo: Add API to load any object as a stream
We have APIs to load metadata as variants, and files as parsed
content/info/xattrs, but for some cases such as static deltas, all we
want is to operate on all objects in their canonical representation.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 21:50:37 -04:00
Colin Walters
c77908bf51 libotutil: Make use of GBytes in ot_variant_read()
This is just cleaner; we avoid using GObject data, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 19:55:34 -04:00
Colin Walters
d9f59c6fd5 core: Add API to convert checksum -> csum in place
We already have the opposite, and this will be used in some
places to avoid a malloc.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 19:49:54 -04:00
Colin Walters
76cd7ae4ea libotutil: Add API to create an "ay" GVariant from GBytes
We used to have a version of this, but since I'm trying to use
GBytes more, this became a more common operation, and it's annoying
to type out the whole G_VARIANT_TYPE ("ay") each time, and pass
TRUE for trusted.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 19:23:33 -04:00
Jeremy Whiting
71f6f10cd2 trivial-httpd: Add --force-range-requests option to force range requests
This will be used to test resuming interrupted downloads for
ostree-pull.

With this option, if a whole file is asked for, only half of the file
is given.  Then the client should retry with a range request, and
we'll give them the other half.

https://bugzilla.gnome.org/show_bug.cgi?id=705925
2013-08-14 17:33:23 -04:00
Colin Walters
f68ac018c2 test-xattrs: Skip if current FS doesn't support user_xattr
tmpfs doesn't =(
2013-08-14 20:46:46 +02:00