-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #831 from kernelkit/boot-wait-slow-devs
Wait for slow devices before continuing boot
- Loading branch information
Showing
5 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Use <pid/syslogd> as barrier for other system tasks and service that | ||
# rely on modules, firmware, and device nodes to be ready. | ||
service if:udevd nowarn env:-/etc/default/sysklogd <run/udevadm:post/success> \ | ||
[S0123456789] syslogd -F $SYSLOGD_ARGS -- System log daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Extend finit's default udevadm settle synchronization for situations | ||
# where device are very slow to probe (see #685) | ||
run nowarn if:udevd cgroup.init <service/udevd/ready> log \ | ||
[S] /usr/libexec/infix/hw-wait -- Probing hardware | ||
|
||
# Now that everything should be probed, do a final pass over the | ||
# uevent queue before starting syslogd and everything else | ||
run nowarn if:udevd cgroup.init :post <service/udevd/ready> log \ | ||
[S] udevadm settle -t 30 -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
# (Ab)use the kernel's device link subsystem to detect consumer side | ||
# devices that may be very slow to probe (looking at you, mv88e6xxx!). | ||
|
||
ident=$(basename "$0") | ||
|
||
report() | ||
{ | ||
if [ -r "/tmp/$ident" ]; then | ||
logger -k -p "user.$1" -t "$ident" "Waited for slow devices:" | ||
sort "/tmp/$ident" | uniq -c | logger -k -p "user.$1" -t "$ident" | ||
fi | ||
|
||
rm -f "/tmp/$ident" | ||
} | ||
|
||
for _ in $(seq 50); do | ||
again= | ||
|
||
for dl in /sys/class/devlink/*; do | ||
[ -r "$dl/status" ] || continue | ||
|
||
status=$(cat "$dl/status") | ||
if [ "$status" = "consumer probing" ]; then | ||
basename "$(readlink "$dl/consumer")" >>"/tmp/$ident" | ||
again=yes | ||
fi | ||
|
||
done | ||
|
||
if [ -z "$again" ]; then | ||
report notice | ||
exit 0 | ||
fi | ||
|
||
sleep .2 | ||
done | ||
|
||
logger -k -p user.error -t "$ident" "Timeout waiting for devices to come online" | ||
report error | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters