Gentoo Archives: gentoo-commits

From: "William Hubbs (williamh)" <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/busybox/files: mdev.initd
Date: Tue, 30 Dec 2014 19:13:48
Message-Id: 20141230191342.E9604E833@oystercatcher.gentoo.org
1 williamh 14/12/30 19:13:42
2
3 Added: mdev.initd
4 Log:
5 version bump, approved by blueness
6
7 (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 0x30C46538)
8
9 Revision Changes Path
10 1.1 sys-apps/busybox/files/mdev.initd
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/mdev.initd?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/busybox/files/mdev.initd?rev=1.1&content-type=text/plain
14
15 Index: mdev.initd
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2014 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.initd,v 1.1 2014/12/30 19:13:42 williamh Exp $
21
22 depend()
23 {
24 provide dev
25 need dev-mount sysfs
26 }
27
28 find_mdev()
29 {
30 if [ -x /sbin/mdev ] ; then
31 echo "/sbin/mdev"
32 else
33 echo "/bin/busybox mdev"
34 fi
35 }
36
37 populate_mdev()
38 {
39 ebegin "Populating /dev with existing devices with mdev -s"
40 $(find_mdev) -s
41 eend $?
42 return 0
43 }
44
45 seed_dev()
46 {
47 # copy over any persistent things
48 if [ -d /lib/mdev/devices ] ; then
49 cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
50 fi
51 }
52
53 start()
54 {
55 seed_dev
56
57 # Setup hotplugging (if possible)
58 if [ -e /proc/sys/kernel/hotplug ] ; then
59 ebegin "Setting up mdev as hotplug agent"
60 echo $(find_mdev) > /proc/sys/kernel/hotplug
61 eend 0
62 fi
63
64 if get_bootparam "nocoldplug" ; then
65 ewarn "Skipping mdev coldplug as requested in kernel cmdline"
66 else
67 populate_mdev
68 fi
69 }