run-init: Add dry-run mode
authorBen Hutchings <ben@decadent.org.uk>
Sun, 17 Jan 2016 19:50:28 +0000 (19:50 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 8 May 2016 20:59:37 +0000 (20:59 +0000)
commit4770b8c65966e9380e12a43fd1db1c12fcad7fe3
tree98536f54fc1cbc53e87e3755e53bdf27075be160
parent5726e1ed21f3ae2d411f15f6b407323856ccadad
run-init: Add dry-run mode

initramfs-tools wants to validate the real init program before running
it, as there is no way out once it has exec'd run-init.  This is
complicated by the increasing use of symlinks for /sbin/init and for
/sbin itself.  We can't simply resolve them with 'readlink -f' because
any absolute symlinks will be resolved using the wrong root.  Add a
dry-run mode (-n option) to run-init that goes as far as possible to
validate that the given init is executable.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Name run-init-add-dry-run-mode.patch
usr/kinit/kinit.c
usr/kinit/run-init/run-init.c
usr/kinit/run-init/run-init.h
usr/kinit/run-init/runinitlib.c