summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/mdev
blob: 79fbafd191c046ef2b55246a672d5b328f387c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh /etc/rc.common

start()
{
	log 'Enabling device hotplugging'
	if ! mount | grep -Fq ' /dev '; then
		mount -t tmpfs -o noexec,nosuid,mode=0755 tmpfs /dev
	fi
	printf '/sbin/mdev\n' >/proc/sys/kernel/hotplug
	mdev -s
}

stop()
{
	log 'Disabling device hotplugging'
	printf '\n' >/proc/sys/kernel/hotplug
	if mount | grep -Fq ' /dev '; then
		umount /dev
	fi
}

restart()
{
	log 'Recanning devices'
	mdev -s
}