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>
Thu, 19 Jul 2018 00:13:54 +0000 (01:13 +0100)
commit5629d458f5f9a3f332e5bfb1d93e3c889edbf83f
treeb75d5f4bad60de8a2e9620a0ff2775ef3d85f0f9
parent805355bb12c0034aa5a938c15074e6005400b5ad
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