init: Take over handling of rootdelay parameter from udev boot script

The rootdelay parameter used to be important as a workaround for our
crappy device scanning.  It's less widely needed now but still needed
for some md-RAID configurations.

The delay used to be implemented in udev's init-top script, but was
removed from there in Debian version 220-4 and the systemd maintainers
do not want to restore it.  So implement it in init, where it probably
always should have been.

I would like to un-export ROOTDELAY now, but several other packages
use it to control their own delay or polling.  For now, document it as
deprecated.  To avoid doubling the delay when using an older udev,
make mkinitramfs patch it out of the udev init-top script.

Closes: #809740
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Ben Hutchings 2016-01-29 13:48:25 +00:00
parent 49e4a0555f
commit ab9130667d
3 changed files with 9 additions and 0 deletions

4
init
View File

@ -207,6 +207,10 @@ maybe_break modules
load_modules
[ "$quiet" != "y" ] && log_end_msg
if [ "$ROOTDELAY" ]; then
sleep $ROOTDELAY
fi
maybe_break premount
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-premount"
run_scripts /scripts/init-premount

View File

@ -559,6 +559,8 @@ Otherwise keep it alone.
.TP
\fB\fI ROOTDELAY, ROOTFLAGS, ROOTFSTYPE, IP
corresponds to the rootdelay, rootflags, rootfstype or ip boot option.
Use of ROOTDELAY is deprecated; you should implement a \fIlocal-block\fR
boot script rather than delaying or polling.
.TP
\fB\fI DPKG_ARCH
allows arch specific boot actions.

View File

@ -296,6 +296,9 @@ fi
run_scripts /usr/share/initramfs-tools/hooks
run_scripts "${CONFDIR}"/hooks
# Avoid double sleep when using older udev scripts
sed -i 's/^\s*sleep \$ROOTDELAY$/:/' "${DESTDIR}/scripts/init-top/udev"
# cache boot run order
for b in $(cd "${DESTDIR}/scripts" && find . -mindepth 1 -type d); do
cache_run_scripts "${DESTDIR}" "/scripts/${b#./}"