source: bootscripts/lfs/init.d/udev_retry@ 6903d5e

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 6903d5e was 6903d5e, checked in by DJ Lucas <dj@…>, 5 years ago

Update to LFS-Bootscripts-20190902

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11666 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#!/bin/sh
2########################################################################
3# Begin udev_retry
4#
5# Description : Udev cold-plugging script (retry)
6#
7# Authors : Alexander E. Patrakov
8# DJ Lucas - dj@linuxfromscratch.org
9# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
10# Bryan Kadzban -
11#
12# Version : LFS 7.0
13#
14########################################################################
15
16### BEGIN INIT INFO
17# Provides: udev_retry
18# Required-Start: udev
19# Should-Start: $local_fs modules
20# Required-Stop:
21# Should-Stop:
22# Default-Start: S
23# Default-Stop:
24# Short-Description: Replays failed uevents and creates additional devices.
25# Description: Replays any failed uevents that were skipped due to
26# slow hardware initialization, and creates those needed
27# device nodes
28# X-LFS-Provided-By: LFS
29### END INIT INFO
30
31. /lib/lsb/init-functions
32
33case "${1}" in
34 start)
35 log_info_msg "Retrying failed uevents, if any..."
36
37 # As of udev-186, the --run option is no longer valid
38 #rundir=$(/sbin/udevadm info --run)
39 rundir=/run/udev
40 # From Debian: "copy the rules generated before / was mounted
41 # read-write":
42
43 for file in ${rundir}/tmp-rules--*; do
44 dest=${file##*tmp-rules--}
45 [ "$dest" = '*' ] && break
46 cat $file >> /etc/udev/rules.d/$dest
47 rm -f $file
48 done
49
50 # Re-trigger the uevents that may have failed,
51 # in hope they will succeed now
52 /bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \
53 while read line ; do
54 for subsystem in $line ; do
55 /sbin/udevadm trigger --subsystem-match=$subsystem --action=add
56 done
57 done
58
59 # Now wait for udevd to process the uevents we triggered
60 if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then
61 /sbin/udevadm settle
62 fi
63
64 evaluate_retval
65 ;;
66
67 *)
68 echo "Usage ${0} {start}"
69 exit 1
70 ;;
71esac
72
73exit 0
74
75# End udev_retry
Note: See TracBrowser for help on using the repository browser.