#!/bin/sh /etc/rc.common start() { log 'Enabling device hotplugging' if ! [ -e /dev/null ]; then mount -t tmpfs -o noexec,nosuid,mode=0755 tmpfs /dev || \ return ${?} if [ -e /proc/sys/kernel/hotplug ]; then printf '/sbin/mdev\n' >/proc/sys/kernel/hotplug fi mdev -s fi } stop() { log 'Disabling device hotplugging' if [ -e /proc/sys/kernel/hotplug ]; then printf '\n' >/proc/sys/kernel/hotplug fi if [ -e /dev/null ]; then rm -Rf /dev/* umount /dev || return ${?} fi } restart() { log 'Recanning devices' if ! [ -e /dev/null ]; then mount -t tmpfs -o noexec,nosuid,mode=0755 tmpfs /dev || \ return ${?} if [ -e /proc/sys/kernel/hotplug ]; then printf '/sbin/mdev\n' >/proc/sys/kernel/hotplug fi fi mdev -s }