diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2016-01-29 13:48:25 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-01-29 14:21:00 +0000 |
commit | ab9130667d42d0532e8f2900fa3da280dfb61f03 (patch) | |
tree | 5d22c50516802b1555df15a75757212995becd66 | |
parent | 49e4a0555f51d9a7a48b03d2c1be7a5048200b2b (diff) |
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>
-rwxr-xr-x | init | 4 | ||||
-rw-r--r-- | initramfs-tools.8 | 2 | ||||
-rwxr-xr-x | mkinitramfs | 3 |
3 files changed, 9 insertions, 0 deletions
@@ -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 diff --git a/initramfs-tools.8 b/initramfs-tools.8 index e6bc5e2..0eee050 100644 --- a/initramfs-tools.8 +++ b/initramfs-tools.8 @@ -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. diff --git a/mkinitramfs b/mkinitramfs index 5cc6608..0906c41 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -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#./}" |