ostree/src/switchroot
William Manley 2aacc6912b ostree-prepare-root: Fix running with musl
musl libc's implementation of `realpath` works by opening the path and then
doing a lookup in `/proc/self/fd` to find the canonical path.  This fails
if `/proc` is not mounted.  This causes problems for us if
`ostree-prepare-root` is `init` as `/proc` won't be mounted.

We have to mount `/proc` anyway for `/proc/cmdline` so this fix just
expands the scope over which `/proc` is mounted to include both our
`realpath` calls.

See also:

* http://www.openwall.com/lists/musl/2016/06/08/2 and
* http://git.musl-libc.org/cgit/musl/tree/src/misc/realpath.c?id=e738b8cbe64b6dd3ed9f47b6d4cd7eb2c422b38d

Closes: #485
Approved by: cgwalters
2016-09-01 20:17:58 +00:00
..
ostree-mount-util.h switchroot: Move `path_is_on_readonly_fs` to header file 2016-08-30 22:41:27 +00:00
ostree-prepare-root.c ostree-prepare-root: Fix running with musl 2016-09-01 20:17:58 +00:00
ostree-remount.c switchroot: Replace custom error printing with err/warn functions from libc 2016-08-30 22:41:27 +00:00