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
RevLine 
[1c48007]1#!/bin/sh
2########################################################################
[0cda898]3# Begin udev_retry
[1c48007]4#
5# Description : Udev cold-plugging script (retry)
6#
7# Authors : Alexander E. Patrakov
[f874424]8# DJ Lucas - dj@linuxfromscratch.org
[0cda898]9# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
[2a1c1e0]10# Bryan Kadzban -
[1c48007]11#
[0cda898]12# Version : LFS 7.0
[1c48007]13#
14########################################################################
15
[0cda898]16### BEGIN INIT INFO
17# Provides: udev_retry
18# Required-Start: udev
[6903d5e]19# Should-Start: $local_fs modules
[0cda898]20# Required-Stop:
21# Should-Stop:
22# Default-Start: S
23# Default-Stop:
[cb02946]24# Short-Description: Replays failed uevents and creates additional devices.
[0cda898]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
[f874424]31. /lib/lsb/init-functions
[1c48007]32
33case "${1}" in
[0cda898]34 start)
[f874424]35 log_info_msg "Retrying failed uevents, if any..."
[0cda898]36
[9b7cbc7]37 # As of udev-186, the --run option is no longer valid
[f6fe500]38 #rundir=$(/sbin/udevadm info --run)
[36ba266]39 rundir=/run/udev
[0cda898]40 # From Debian: "copy the rules generated before / was mounted
41 # read-write":
42
[f874424]43 for file in ${rundir}/tmp-rules--*; do
[0cda898]44 dest=${file##*tmp-rules--}
45 [ "$dest" = '*' ] && break
46 cat $file >> /etc/udev/rules.d/$dest
47 rm -f $file
48 done
49
[2a1c1e0]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
[f6fe500]55 /sbin/udevadm trigger --subsystem-match=$subsystem --action=add
[2a1c1e0]56 done
57 done
[0cda898]58
59 # Now wait for udevd to process the uevents we triggered
[85ce884e]60 if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then
[f6fe500]61 /sbin/udevadm settle
[85ce884e]62 fi
63
[642e2e9]64 evaluate_retval
[0cda898]65 ;;
66
67 *)
68 echo "Usage ${0} {start}"
69 exit 1
70 ;;
[1c48007]71esac
72
[f874424]73exit 0
74
[0cda898]75# End udev_retry
Note: See TracBrowser for help on using the repository browser.