2006-08-03 13:43:56 +00:00
|
|
|
#!/bin/sh
|
2006-02-23 17:19:35 +00:00
|
|
|
|
2011-02-20 15:25:41 +01:00
|
|
|
# - if /dev is not mounted - mount as a devtmpfs (CONFIG_DEVTMPFS=y) or tmpfs
|
|
|
|
# - if /dev is mounted (e.g. due to handover from initramfs or
|
|
|
|
# CONFIG_DEVTMPFS_MOUNT=y), remount with specific options
|
|
|
|
# - some video drivers require exec access in /dev, thus it's set here
|
|
|
|
# - for completness, we add few sanity limits (2k non-empty files, 16k inodes)
|
|
|
|
|
|
|
|
UDEVOPTS="exec,nosuid,noatime,mode=0755,nr_blocks=2048,nr_inodes=16384"
|
|
|
|
if /bin/mountpoint -q /dev ; then
|
|
|
|
/bin/mount -n -o remount,${UDEVOPTS} dev /dev
|
|
|
|
else
|
|
|
|
if /bin/sed -n '/devtmpfs/q1' /proc/filesystems ; then
|
2010-12-02 16:08:16 +01:00
|
|
|
UDEVFS=tmpfs
|
2011-02-20 15:25:41 +01:00
|
|
|
else
|
|
|
|
UDEVFS=devtmpfs
|
2010-12-02 16:08:16 +01:00
|
|
|
fi
|
2011-02-20 15:25:41 +01:00
|
|
|
/bin/mount -n -t $UDEVFS -o ${UDEVOPTS} dev /dev
|
2010-12-02 16:08:16 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# make sure hotplugger is not set
|
2006-08-03 13:43:56 +00:00
|
|
|
echo > /proc/sys/kernel/hotplug
|
2006-02-23 17:19:35 +00:00
|
|
|
|
2010-12-02 16:08:16 +01:00
|
|
|
# since v155, udevd automatically copies /lib/udev/devices
|
|
|
|
# and creates /proc/{kcore,self/fd/{0,1,2}} symlinks
|
2006-02-23 17:19:35 +00:00
|
|
|
|
2011-02-20 15:25:41 +01:00
|
|
|
# launch udev daemon, make sure it's not running first
|
|
|
|
test -z "$(/bin/pidof -s udevd)" && /sbin/udevd --daemon
|
2006-02-23 17:19:35 +00:00
|
|
|
|
2006-08-03 13:43:56 +00:00
|
|
|
# coldplug devices and wait for the queue to be processed
|
2010-12-02 16:08:16 +01:00
|
|
|
/sbin/udevadm trigger --type=subsystems --action=add
|
|
|
|
/sbin/udevadm trigger --type=devices --action=add
|
|
|
|
/sbin/udevadm settle
|
|
|
|
|
|
|
|
# retry any failures
|
|
|
|
/sbin/udevadm trigger --type=failed --action=add
|
2008-06-07 10:07:13 +02:00
|
|
|
/sbin/udevadm settle
|