ostree/src/libostree
Colin Walters 361aa449fb libcurl backend
For rpm-ostree, we already link to libcurl indirectly via librepo, and
only having one HTTP library in process makes sense.

Further, libcurl is (I think) more popular in the embedded space.  It
also supports HTTP/2.0 today, which is a *very* nice to have for OSTree.

This seems to be working fairly well for me in my local testing, but it's
obviously brand new nontrivial code, so it's going to need some soak time.

The ugliest part of this is having to vendor in the soup-url code. With
Oxidation we could follow the path of Firefox and use the
[Servo URL parser](https://github.com/servo/rust-url).  Having to redo
cookie parsing also sucked, and that would also be a good oxidation target.

But that's for the future.

Closes: #641
Approved by: jlebon
2017-02-09 16:37:45 +00:00
..
README-gpg pull: Verify commits with gpg signatures from detached metadata 2013-09-29 14:49:47 -04:00
README.md core: Associate branches with remotes, move trigger runs into checkout 2012-04-03 23:46:34 -04:00
bupsplit.c lib: Move the bupsplit selftest into our test framework 2017-02-02 16:51:36 +00:00
bupsplit.h lib: Move the bupsplit selftest into our test framework 2017-02-02 16:51:36 +00:00
libostree.sym lib: Add ostree_repo_reload_config() 2017-02-07 16:12:58 +00:00
ostree-1.pc.in Install a shared library 2013-07-26 19:25:07 -04:00
ostree-async-progress.c docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-async-progress.h lib: Introduce versioned symbols 2016-03-01 21:45:26 -05:00
ostree-autocleanups.h build: Allow ostree to use g_autoptr on its types internally 2016-05-17 21:13:20 +00:00
ostree-bootconfig-parser.c tree-wide: Use g_hash_table_add() where applicable 2016-12-06 17:45:23 +00:00
ostree-bootconfig-parser.h lib: Introduce versioned symbols 2016-03-01 21:45:26 -05:00
ostree-bootloader-grub2.c tree-wide: Remove unused variables detected by CLang 2016-10-27 17:02:01 +00:00
ostree-bootloader-grub2.h syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree-bootloader-syslinux.c libglnx porting: Port "load utf8 file" contents API callers 2016-05-30 11:33:28 +00:00
ostree-bootloader-syslinux.h syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree-bootloader-uboot.c u-boot: Merge ostree's and systems uEnv.txt 2016-08-27 13:11:22 +00:00
ostree-bootloader-uboot.h libostree: Make OstreeBootloader private 2013-09-15 20:26:13 -04:00
ostree-bootloader.c Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
ostree-bootloader.h syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree-chain-input-stream.c Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
ostree-chain-input-stream.h lib: Introduce versioned symbols 2016-03-01 21:45:26 -05:00
ostree-checksum-input-stream.c Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
ostree-checksum-input-stream.h lib: Introduce versioned symbols 2016-03-01 21:45:26 -05:00
ostree-cmdprivate.c delta: Add --if-not-exists option 2016-07-04 13:27:06 +00:00
ostree-cmdprivate.h delta: Add --if-not-exists option 2016-07-04 13:27:06 +00:00
ostree-core-private.h repo: Add archive/zlib-level option, drop default compression to 6 2017-02-07 17:01:09 +00:00
ostree-core.c repo: Add archive/zlib-level option, drop default compression to 6 2017-02-07 17:01:09 +00:00
ostree-core.h core: Make OSTREE_TIMESTAMP public API 2016-09-09 00:10:21 +00:00
ostree-deployment-private.h docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-deployment.c [ASAN] sysroot: Fix leak/double free of keyfile origin 2016-11-30 18:51:26 +00:00
ostree-deployment.h admin: Add an `unlock` command, and libostree API 2016-03-23 11:09:09 -04:00
ostree-diff.c docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-diff.h docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-dummy-enumtypes.c build: Don't run glib-mkenums if there's nothing to do 2016-05-12 17:15:50 +00:00
ostree-dummy-enumtypes.h build: Don't run glib-mkenums if there's nothing to do 2016-05-12 17:15:50 +00:00
ostree-enumtypes.c.template lib: Ensure we use _GNU_SOURCE in enum templates 2016-12-07 23:00:58 +00:00
ostree-enumtypes.h.template Make enum generation private by default, export stub symbol 2016-05-12 17:15:50 +00:00
ostree-fetcher-curl.c libcurl backend 2017-02-09 16:37:45 +00:00
ostree-fetcher-soup.c libcurl backend 2017-02-09 16:37:45 +00:00
ostree-fetcher-uri.c libcurl backend 2017-02-09 16:37:45 +00:00
ostree-fetcher-util.c fetcher: Split lowlevel API into file/membuf variants 2017-01-04 16:32:11 +00:00
ostree-fetcher-util.h fetcher: Move high level functions into "fetcher-util" 2017-01-04 16:32:11 +00:00
ostree-fetcher.h fetcher: Rework API to use strings for tls keys/db 2017-01-19 10:47:15 +00:00
ostree-gpg-verifier.c Add "gpgkeypath" option to remotes 2016-11-17 09:44:07 +00:00
ostree-gpg-verifier.h Add "gpgkeypath" option to remotes 2016-11-17 09:44:07 +00:00
ostree-gpg-verify-result-private.h libotutil: Establish a place for GPG utilities 2015-05-01 10:20:34 -04:00
ostree-gpg-verify-result.c gpg: do not segfault when the algorithm name is not known 2016-09-08 11:19:20 +00:00
ostree-gpg-verify-result.h repo: Factor out the check of gpg result to a separate function 2016-05-27 11:20:00 +00:00
ostree-kernel-args.c Filter bootloader supplied kernel cmdline options 2016-11-01 18:00:37 +00:00
ostree-kernel-args.h Filter bootloader supplied kernel cmdline options 2016-11-01 18:00:37 +00:00
ostree-libarchive-input-stream.c Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
ostree-libarchive-input-stream.h Define and use cleanup helpers for libarchive 2016-12-05 15:20:56 +00:00
ostree-libarchive-private.h Define and use cleanup helpers for libarchive 2016-12-05 15:20:56 +00:00
ostree-linuxfsutil.c lib: Port some manual close() cleanups to be glnx_fd_close 2016-06-13 14:58:55 +00:00
ostree-linuxfsutil.h syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree-lzma-common.c static-delta: Handle LZMA_BUF_ERROR returned by zlib 2015-10-10 10:27:17 -04:00
ostree-lzma-common.h deltas: Link to liblzma, add internal API to use it 2014-04-29 10:59:57 -04:00
ostree-lzma-compressor.c docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-lzma-compressor.h deltas: Link to liblzma, add internal API to use it 2014-04-29 10:59:57 -04:00
ostree-lzma-decompressor.c docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-lzma-decompressor.h deltas: Link to liblzma, add internal API to use it 2014-04-29 10:59:57 -04:00
ostree-metalink.c fetcher: Move high level functions into "fetcher-util" 2017-01-04 16:32:11 +00:00
ostree-metalink.h fetcher: Define an abstraction over SoupURI 2016-12-07 23:00:58 +00:00
ostree-mutable-tree.c docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-mutable-tree.h docs: Get API docs working again 2016-06-09 18:15:49 +00:00
ostree-repo-checkout.c tree-wide: Use g_hash_table_add() where applicable 2016-12-06 17:45:23 +00:00
ostree-repo-commit.c repo: Add archive/zlib-level option, drop default compression to 6 2017-02-07 17:01:09 +00:00
ostree-repo-deprecated.h libostree: mark ostree_repo_checkout_tree_at as deprecated 2016-07-30 11:24:52 +00:00
ostree-repo-file-enumerator.c Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
ostree-repo-file-enumerator.h syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree-repo-file.c core: Use OSTREE_SHA256_STRING_LEN instead of 64 2016-06-22 16:10:01 +00:00
ostree-repo-file.h lib: Remove ostree_repo_file_make_empty_tree 2016-04-17 13:52:07 +00:00
ostree-repo-libarchive.c Define and use cleanup helpers for libarchive 2016-12-05 15:20:56 +00:00
ostree-repo-private.h pull: Add queuing into the higher level logic 2017-02-07 19:59:40 +00:00
ostree-repo-prune.c Add support for more selective pruning 2017-01-19 16:28:00 +00:00
ostree-repo-pull.c libcurl backend 2017-02-09 16:37:45 +00:00
ostree-repo-refs.c refs: resolve conflict between local/remote repos 2016-06-23 19:52:26 +00:00
ostree-repo-static-delta-compilation-analysis.c [ASAN] lib: Squash various leaks in library and commandline 2016-11-21 16:34:06 +00:00
ostree-repo-static-delta-compilation.c static-delta: Pretend that world unreadable objects are new objects 2016-12-16 14:52:09 +00:00
ostree-repo-static-delta-core.c lib: Squash last use of GFile deltas_dir 2016-12-12 15:50:11 +00:00
ostree-repo-static-delta-private.h lib: Always checksum content in deltas 2016-12-06 15:59:35 +00:00
ostree-repo-static-delta-processing.c lib: Always checksum content in deltas 2016-12-06 15:59:35 +00:00
ostree-repo-traverse.c traverse: Use g_hash_table_add 2016-11-30 18:51:26 +00:00
ostree-repo.c pull: Show Estimating if we're scanning too 2017-02-07 19:59:40 +00:00
ostree-repo.h lib: Add ostree_repo_reload_config() 2017-02-07 16:12:58 +00:00
ostree-rollsum.c rollsum: Fix assertion for CRC matches 2015-08-25 09:26:22 -04:00
ostree-rollsum.h Add bsdiff support to deltas 2015-03-03 12:16:17 -05:00
ostree-sepolicy.c [ASAN] lib: Squash various leaks in library and commandline 2016-11-21 16:34:06 +00:00
ostree-sepolicy.h OstreeSePolicy: add ostree_sepolicy_get_csum() 2016-03-25 15:28:29 +00:00
ostree-soup-form.c libcurl backend 2017-02-09 16:37:45 +00:00
ostree-soup-uri.c libcurl backend 2017-02-09 16:37:45 +00:00
ostree-soup-uri.h libcurl backend 2017-02-09 16:37:45 +00:00
ostree-sysroot-cleanup.c [ASAN] lib: Squash various leaks in library and commandline 2016-11-21 16:34:06 +00:00
ostree-sysroot-deploy.c _ostree_sysroot_write_deployments_internal: stop leaking hash table 2016-10-30 22:11:15 +00:00
ostree-sysroot-private.h sysroot: Avoid double cleanup, and ensure no cleanup if specified 2016-09-08 20:42:09 +00:00
ostree-sysroot-upgrader.c repo: Add unconfigured-state to remote config options 2016-12-09 17:46:54 +00:00
ostree-sysroot-upgrader.h lib: Introduce versioned symbols 2016-03-01 21:45:26 -05:00
ostree-sysroot.c [ASAN] sysroot: Squash a leak in lockfile acquisition 2016-12-08 16:18:19 +00:00
ostree-sysroot.h sysroot: Add a flag to suppress post-deploy cleanup 2016-08-29 07:45:24 +00:00
ostree-tls-cert-interaction.c fetcher: Rework API to use strings for tls keys/db 2017-01-19 10:47:15 +00:00
ostree-tls-cert-interaction.h fetcher: Rework API to use strings for tls keys/db 2017-01-19 10:47:15 +00:00
ostree-types.h lib: Introduce versioned symbols 2016-03-01 21:45:26 -05:00
ostree-varint.c syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree-varint.h syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
ostree.h libostree: Add g_autoptr() support for the public types 2016-05-17 21:13:19 +00:00

README.md

Repository design

At the heart of OSTree is the repository. It's very similar to git, with the idea of content-addressed storage. However, OSTree is designed to store operating system binaries, not source code. There are several consequences to this. The key difference as compared to git is that the OSTree definition of "content" includes key Unix metadata such as owner uid/gid, as well as all extended attributes.

Essentially OSTree is designed so that if two files have the same OSTree checksum, it's safe to replace them with a hard link. This fundamental design means that an OSTree repository imposes negligible overhead. In contrast, a git repository stores copies of zlib-compressed data.

Key differences versus git

  • As mentioned above, extended attributes and owner uid/gid are versioned
  • Optimized for Unix hardlinks between repository and checkout
  • SHA256 instead of SHA1
  • Support for empty directories

Binary files

While this is still in planning, I plan to heavily optimize OSTree for versioning ELF operating systems. In industry jargon, this would be "content-aware storage".

Trimming history

OSTree will also be optimized to trim intermediate history; in theory one can regenerate binaries from corresponding (git) source code, so we don't need to keep all possible builds over time.

MILESTONE 1

  • Basic pack files (like git)

MILESTONE 2

  • Store checksums as ay
  • Drop version/metadata from tree/dirmeta objects
  • Add index size to superindex, pack size to index
    • So pull can calculate how much we need to download
  • Split pack files into metadata/data
  • pull: Extract all we can from each packfile one at a time, then delete it
  • Restructure repository so that links can be generated as a cache; i.e. objects/raw, pack files are now the canonical
  • For files, checksum combination of metadata variant + raw data
    • i.e. there is only OSTREE_OBJECT_TYPE_FILE (again)

MILESTONE 3

  • Drop archive/raw distinction - archive repositories always generate packfiles per commit
  • Include git packv4 ideas:
    • metadata packfiles have string dictionary (tree filenames and checksums)
    • data packfiles match up similar objects
  • Rolling checksums for partitioning large files? Kernel debuginfo
  • Improved pack clustering
    • file fingerprinting?
  • ELF-x86 aware deltas

git: http://git-scm.com/ Venti: http://plan9.bell-labs.com/magic/man2html/6/venti Elephant FS: http://www.hpl.hp.com/personal/Alistair_Veitch/papers/elephant-hotos/index.html

Compression

xdelta: http://xdelta.org/ Bsdiff: http://www.daemonology.net/bsdiff/ xz: http://tukaani.org/xz/