Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
rc.boot: Use mdev -d
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanaraps committed Mar 7, 2020
1 parent 406d933 commit 738b1f5
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions lib/init/rc.boot
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,19 @@ log "Starting device manager..."; {
elif command -v mdev >/dev/null; then
log "Starting mdev..."

mdev -s
mdev -df & mdev_pid=$!

# Try to set the hotplug script to mdev.
# This will silently fail if unavailable.
#
# The user should then run the mdev service
# to enable hotplugging.
printf /bin/mdev 2>/dev/null > \
/proc/sys/kernel/hotplug

mdev -s
printf /bin/mdev 2>/dev/null \
> /proc/sys/kernel/hotplug

# Create /dev/mapper nodes.
[ -x /bin/dmsetup ] && dmsetup mknodes

# Handle Network interfaces.
for file in /sys/class/net/*/uevent; do
printf add > "$file"
done 2>/dev/null

# Handle USB devices.
for file in /sys/bus/usb/devices/*; do
case ${file##*/} in [0-9]*-[0-9]*)
printf add > "$file/uevent"
esac
done
fi
}

Expand Down Expand Up @@ -145,10 +134,14 @@ log "Loading sysctl settings..."; {
done
}

# Kill udevd here to let the service manager
# start it again and manage it properly.
command -v udevd >/dev/null &&
udevadm control --exit
log "Killing device manager to make way for service..."; {
if command -v udevd >/dev/null; then
udevadm control --exit

elif [ "$mdev_pid" ]; then
kill "$mdev_pid"
fi
}

log "Running rc.d hooks..."; {
for file in /etc/rc.d/*.boot; do
Expand Down

0 comments on commit 738b1f5

Please sign in to comment.