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 <benh@debian.org>
Mon, 28 Jun 2021 14:24:37 +0000 (15:24 +0100)
commit20b4b970621a8ca3a62004414a4d801707a96be1
treea1b0ce02b455f3864d47edf22c77c53ffceffb19
parentba76295191c5c00d6d26611866f906d897063766
run-init: Add dry-run mode

Bug-Debian: https://bugs.debian.org/810965

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