Commit Graph

178 Commits

Author SHA1 Message Date
Colin Walters
09b392675a main: Make ostree --version output YAML (and add gitrev)
I learned today that `docker version` does this and I really like
the idea.  While we have the patient open, also add the gitrev
with code taken from https://github.com/projectatomic/rpm-ostree/pull/584

Closes: #691
Approved by: giuseppe
2017-02-22 18:57:18 +00:00
Colin Walters
3ec509c89b build: Add --with-smack, use it to reset contexts for writing objects
At some point we'll want to follow what systemd is doing and add
better support for smack, along the lines of `OstreeSePolicy`.  However,
short term this patch fixes AGL which uses Smack.

See: https://jira.automotivelinux.org/browse/SPEC-386
See: https://github.com/ostreedev/ostree/pull/698

Closes: #698
Approved by: OYTIS
2017-02-22 14:37:19 +00:00
Colin Walters
da21d7350e Release 2017.2
We should get a release out to try to keep with at least a once-a-month cadence.
This one has some exciting stuff like libcurl and Rust, and various bugfixes.
Also importantly I want to cut this *before* we land some other bigger stuff, so
rpm-ostree can start using the reload_config API etc.

Closes: #685
Approved by: jlebon
2017-02-14 16:21:57 +00:00
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
Colin Walters
d894f609db oxidation: Add implementation of bupsplit in Rust
This is an initial drop of "oxidation", or adding implementation
of components in Rust.  The bupsplit code is a good target - no
dependencies, just computation.

Translation into Rust had a few twists -

 - The C code relies a lot on overflowing unsigned ints, and
   also on the C promotion rules for e.g. `uint8_t -> int32_t`
 - There were some odd loops that I introduced bugs in while
   translating...in particular, the function always returns `len`,
   but I mistakenly translated to `len+1`, resulting in an OOB
   read on the C side, which was hard to debug.

On the plus side, an off-by-one array indexing in the Rust code paniced nicely.

In practice, we'll need a lot more build infrastructure to make this work, such
as using `cargo vendor` when producing build artifacts for example. Also, Cargo
is yet another thing we need to cache.

Where do we go with this? Well, I think we should merge this, it's not a lot of
code. We can just have it be an alternative CI target. Should we do a lot more
right now? Probably not immediately, but I find the medium/long term prospects
pretty exciting!

Closes: #656
Approved by: jlebon
2017-02-03 14:29:00 +00:00
Colin Walters
7803fe1d60 Rename to libOSTree
There are many motivating factors. The biggest is simply that at a practical
level, the command line is not sufficient to build a real system. The docs say
that it's a demo for the library. Let's make that more obvious, so people don't
try to use `ostree admin upgrade` for their real systems, and also don't use
e.g. `ostree commit` on the command line outside of test suites/quick hacking.

This change will also help clarify the role of rpm-ostree, which we will likely
be renamed to "nts". Then use of the term "ostree" will become much clearer. And
similarly for other people writing upgraders, they can say they use libostree.

I didn't try to change all of the docs and code at once, because it's going to
lead to conflicts.

The next big steps are:

  - Rename the github repo (github will inject a redirect)
  - Look at supporting a build where we don't do `ostree admin`, or at least
    it's only built for tests. We may want to split it off as a separate binary
    or so? That way people with their own upgraders don't need to ship it.

Closes: #659
Approved by: jlebon
2017-02-02 17:47:43 +00:00
Colin Walters
6517a8a27a Release 2017.1
Just bugfixes, but it's time to ship them.

Closes: #653
Approved by: jlebon
2017-01-23 20:37:28 +00:00
Colin Walters
c9d565a5a9 Release 2016.15
Closes: #632
Approved by: jlebon
2016-12-12 17:19:01 +00:00
Colin Walters
47b4dd1b38 Skip gjs-based tests if ASAN is enabled
Unfortunately, introspection uses dlopen(), which doesn't quite
work when the DSO is compiled with ASAN but the outer executable
isn't.

Trying to inject LD_PRELOAD=libasan means the outer executable has to
be leak free...which, yeah, I'm not going to get into running ASAN
today on gjs or pygobject.

So, let's skip those tests - ideally, we still run them in some other
context without the sanitizers.  The coverage we have from them is
middling anyways.

Closes: #622
Approved by: jlebon
2016-12-09 18:05:53 +00:00
Colin Walters
ef438c8d60 build: Error if glib isn't found
This is a bit extracted from my work on ASAN.

Closes: #625
Approved by: jlebon
2016-12-09 16:35:52 +00:00
Colin Walters
a2d627352d build: Add more default errors
Newer gcc has `-Wincompatible-pointer-types`, hooray!
Add a few others that we pass today.

Closes: #618
Approved by: jlebon
2016-12-07 16:44:15 +00:00
Colin Walters
7584dc0f25 Release 2016.14
Closes: #593
Approved by: jlebon
2016-11-23 16:20:49 +00:00
Colin Walters
36c8946870 Release 2016.13
Closes: #570
Approved by: jlebon
2016-11-10 17:24:39 +00:00
Colin Walters
d3f14f02e3 Release 2016.12
Closes: #540
Approved by: cgwalters
2016-10-21 19:24:31 +00:00
Colin Walters
a0e1344cf8 Release 2016.11
Closes: #524
Approved by: cgwalters
2016-10-07 19:21:41 +00:00
Colin Walters
54621d9e53 libglnx: Update to latest
This pulls in a new compilation flag for wrpseudo compatibility.  Also
note we need to add some includes since glnx-libcontainer went away,
and with it some includes for `sys/mount.h` etc.

Closes: #522
Approved by: cgwalters
2016-10-06 11:54:39 +00:00
Colin Walters
36e8ba124e Release 2016.10
Closes: #502
Approved by: cgwalters
2016-09-09 00:28:02 +00:00
Colin Walters
dd71999dc9 Release 2016.9
Closes: #481
Approved by: jlebon
2016-08-31 16:36:19 +00:00
William Manley
42dab85728 ostree-prepare-root: Allow building statically with musl
If the `--with-static-compiler=musl-gcc` configure flag is given.

ostree-prepare-root can be used as init in a system without a populated
/lib.  To support this use case we need to link statically as we will be
unable to locate libc.so at run time if it's not installed in /lib.

We support building ostree-prepare-root with a different compiler to the
rest of ostree so we can use musl rather than glibc.  This reduces the size
of the executable significantly: from ~700K -> ~30K.  We have to use
`_SCRIPTS` here to get autotools to install this as an executable but
without generating rules to make it itself which we have specified
manually.

See https://lists.gnu.org/archive/html/help-gnu-utils/2007-01/msg00007.html
for advice on using autotools in this manner.

Closes: #477
Approved by: cgwalters
2016-08-30 20:50:33 +00:00
Colin Walters
07ec35ef03 libostree.sym: Add 2016.9 section
We should remember to do this in the commit updating configure.ac.

Closes: #453
Approved by: jlebon
2016-08-09 20:00:24 +00:00
Colin Walters
73eabca5e8 Release 2016.8
It's time for a new release, there's enough queued and it's
been ~a month.

Closes: #452
Approved by: jlebon
2016-08-09 19:12:25 +00:00
Colin Walters
a29bb0ab6b Final excision of libgsystem dependency
Lots and lots of preparation led to this moment - when nothing
apparent changes for users!  Woo!

But seriously, having the extra dependency is a minor annoyance, and
in the big picture I think the libgsystem idea was wrong - we need to
land things in GLib, and use git submodules for API-unstable or
Linux-specific sharing.  For a lot of OSTree, the libgsystem `GFile*`
orientation was also wrong, we really want fd-relative.

Closes: #444
Approved by: jlebon
2016-08-09 15:36:09 +00:00
Colin Walters
e7b3cf9850 build: Make -Werror=int-conversion fatal
This should hopefully avoid me accidentally passing NULL for an `int`
file descriptor in the future.

Closes: #431
Approved by: giuseppe
2016-08-08 11:13:06 +00:00
Colin Walters
76d6afa707 build: Import attributes.m4, detect CFLAGS at build time
I want to add `-Werror=int-conversion`, but it's only available in
newer GCC versions.  So let's start autodetecting available compiler
flags.

Closes: #431
Approved by: giuseppe
2016-08-08 11:13:06 +00:00
Colin Walters
1ce633f158 Update libglnx for O_TMPFILE build time option
See: https://github.com/ostreedev/ostree/issues/421

Closes: #426
Approved by: gatispaeglis
2016-08-04 13:30:55 +00:00
Colin Walters
6d310db1e7 libglnx porting: Migrate to new tempfile code
In general this is even cleaner now, though it was better after I
extracted a helper function for the "write tempfile with contents"
bits that were shared between metadata and regular file codepaths.

Closes: #369
Approved by: jlebon
2016-07-29 19:02:41 +00:00
Colin Walters
c31cf75552 Release 2016.7
Closes: #386
Approved by: jlebon
2016-07-08 19:40:55 +00:00
Mathnerd314
55f5f73d80 configure: Turn on -Wempty-body
I spent half an hour debugging an extra semicolon,
and this C "feature" is not used at all in ostree

Closes: #359
Approved by: cgwalters
2016-06-22 16:10:01 +00:00
Colin Walters
9e2763106b lib: Use sd_journal directly (optionally)
This was the last caller of libgsystem that isn't
`gs_file_get_path_cached()`.  I think the use case ostree has where
the same code can be called via command line and via a shared library
*and* via a daemon is rather unusual, so let's just copy the code for
logging from libgsystem into here.

For example rpm-ostree hard depends on a daemon mode, so it'll just
use `sd_journal` directly.

Closes: #341
Approved by: jlebon
2016-06-21 18:24:17 +00:00
Colin Walters
6c7e191147 Release 2016.6 2016-06-20 11:51:32 -04:00
Jonathan Lebon
b4c49f5acf configure.ac: properly check for bison
The AC_PROG_YACC already does the checking for us, so we don't need to
use AC_CHECK_PROGS (which wasn't working anyway because autoconf didn't
run the check thinking it was cached already from the earlier
AC_PROC_YACC, so we didn't get the default ":" value)

Closes: #325
Approved by: cgwalters
2016-06-07 19:47:58 +00:00
Krzesimir Nowak
24e3ccb780 build: Remind about bumping related versions
Closes: #295
Approved by: cgwalters
2016-05-17 21:13:20 +00:00
Colin Walters
831e9dcdea build: Introduce --with-dracut=yesbutnoconf
It's actually just easier for build systems (e.g. rpm-ostree)
using dracut to use `--add ostree` rather than indirecting
through the conf file.

This makes it easier for yum-managed systems to install ostree without
side effects.

Closes: #279
Approved by: gatispaeglis
2016-05-01 10:25:19 +00:00
Gatis Paeglis
ad0de186bb Fix --enable_rofiles_fuse=no build
Closes: #276
Approved by: cgwalters
2016-04-25 12:40:58 +00:00
Colin Walters
bfa23bdc1f Release 2016.5
Closes: #261
Approved by: cgwalters
2016-04-15 15:09:31 +00:00
Gatis Paeglis
80c68ba7f0 Fix AS_HELP_STRING for builtin grub2 mkconfig
Closes: #253
Approved by: giuseppe
2016-04-12 11:22:50 +00:00
Colin Walters
e9640ca4d9 build: Find grub2-mkconfig a bit more automagically
If one happens to not have grub2 installed, the previous commit
would cause us to fall back to `grub-mkconfig` with bad results.

We should likely just do dynamic detection and avoid pain, but
there's no harm in also allowing this to be statically determined.

The automagic here is that if `/etc/os-release` says `ID_LIKE=fedora`,
we know to use `grub2-mkconfig`.  But distro scripts should set this
in the build configurations using `--with-grub2-mkconfig=`.

Closes: #240
Approved by: jlebon
2016-04-06 21:16:11 +00:00
Gatis Paeglis
4e81548447 Introducing ostree-grub-generator
ostree-grub-generator can be used to customize
the generated grub.cfg file. Compile time
decision ostree-grub-generator vs grub2-mkconfig
can be overwritten with the OSTREE_GRUB2_EXEC
envvar - useful for auto tests and OS installers.

Why this alternative approach:

1) The current approach is less flexible than using a
   custom 'ostree-grub-generator' script. Each system can
   adjust this script for its needs, instead of using the
   hardcoded values from ostree-bootloader-grub2.c.

2) Too much overhead on embedded to generate grub.cfg
   via /etc/grub.d/ configuration files. It is still
   possible to do so, even with this patch applied.
   No need to install grub2 package on a target device.

3) The grub2-mkconfig code path has other issues:
   https://bugzilla.gnome.org/show_bug.cgi?id=761180

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

Closes: #228
Approved by: cgwalters
2016-04-04 14:19:35 +00:00
Colin Walters
80698543c2 Release 2016.4 2016-03-23 15:45:59 -04:00
Colin Walters
8894bb3949 deploy: Handle a read-only /boot
I'd like to encourage people to make OSTree-managed systems more
strictly read-only in multiple places.  Ideally everywhere is
read-only normally besides `/var/`, `/tmp/`, and `/run`.

`/boot` is a good example of something to make readonly.  Particularly
now that there's work on the `admin unlock` verb, we need to protect
the system better against things like `rpm -Uvh kernel.rpm` because
the RPM-packaged kernel won't understand how to do OSTree right.

In order to make this work of course, we *do* need to remount `/boot`
as writable when we're doing an upgrade that changes the kernel
configuration.  So the strategy is to detect whether it's read-only,
and if so, temporarily mount read-write, then remount read-only when
the upgrade is done.

We can generalize this in the future to also do `/etc` (and possibly
`/sysroot/ostree/` although that gets tricky).

One detail: In order to detect "is this path a mountpoint" is
nontrivial - I looked at copying the systemd code, but the right place
is to use `libmount` anyways.
2016-03-21 12:49:05 -04:00
Colin Walters
d25212f04a tests: Port to glib-tap.mk, make make check run all of the tests
OSTree's code for testing predates the `glib-tap.mk` making its
way into GLib.  Let's switch to it, as it provides a number
of advantages.

By far the biggest advantage is that `make check` can start to run
most of the tests *in addition* to having them work installed.

This commit keeps the installed tests working, but `make check` turns
out to be really broken because...our TAP usage has bitrotted to say
the least.  Fix that all up.

Do some hacks so that the tests work uninstalled as well - in
particular, `glib-tap.mk` and the bits encoded into
`g_test_build_filename()` assume *recursive* Automake (blah).  Work
around that by creating a symlink when installed to loop back.
2016-03-03 08:50:19 -05:00
Colin Walters
3d7098bc5e Release 2016.3 2016-02-26 11:58:05 -05:00
Colin Walters
f4d494a0a4 Release 2016.2 2016-02-22 18:08:01 -05:00
Alexander Larsson
9f9d713a56 build: Use threadsafe GPGME
https://bugzilla.gnome.org/show_bug.cgi?id=761863
2016-02-22 18:07:30 -05:00
Colin Walters
e9ccdd2d00 Import rofiles-fuse
While it's not strictly tied to OSTree, let's move
https://github.com/cgwalters/rofiles-fuse in here because:

 - It's *very* useful in concert with OSTree
 - It's tiny
 - We can reuse OSTree's test, documentation, etc. infrastructure

One thing to consider also is that at some point we could experiment
with writing a FUSE filesystem for OSTree.  This could internalize a
better equivalent of `--link-checkout-speedup`, but on the other hand,
the cost of walking filesystem trees for these types of operations is
really quite small.

But if we did decide to do more FUSE things in OSTree, this is a step
towards that too.
2016-02-10 13:11:25 +01:00
Colin Walters
8702ec7b3e build: Remove --disable-static-deltas option
I'm confident now we can declare them stable.
2016-02-08 14:46:13 +01:00
Colin Walters
c74ea8b075 build: Add --disable-man
Gnome Continuous doesn't have docbook, so copy what we do for glib.
2016-01-28 15:22:10 -05:00
Colin Walters
32c360b5a0 build: Rename doc/ -> apidoc/
This is preparation for introducing a `mkdocs` manual under `doc/`
which should be significantly more useful for the world at large than
the minimal manual that exists there now.
2016-01-28 09:31:34 -05:00
Colin Walters
313b4720e8 build: Move man pages into man/
This is preparation for having 3 separate doc build systems (whee):

 - xsltproc for the man pages
 - gtk-doc for the API docs
 - mkdocs for a real manual
2016-01-28 09:31:34 -05:00
Colin Walters
587fc5a5a1 Release 2016.1 2016-01-12 08:55:06 -05:00