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, 6 Jan 2019 19:33:01 +0000 (19:33 +0000)
commit45d5231a1024a244fc8af6e22e62e1d3d1188a87
treec92e66119c8a13e57ef6ad39981498e04e8da1eb
parent68115b15f3c43a8bd108ebcb4d4836b35ba50125
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