Imported Upstream version 0.6.4
[platform/upstream/multipath-tools.git] / multipath / 01_udev
1 #!/bin/sh
2 #
3 cp /sbin/udev $INITRDDIR/sbin/hotplug
4 cp /sbin/udevstart $INITRDDIR/sbin/
5 cp /bin/mountpoint $INITRDDIR/bin/
6 cp /bin/readlink $INITRDDIR/bin/
7
8 PROGS="/sbin/udev /sbin/udevstart /bin/mountpoint /bin/readlink"
9 LIBS=`ldd $PROGS | grep -v linux-gate.so | sort -u | \
10 awk '{print $3}'`
11 for i in $LIBS
12 do
13         mkdir -p `dirname $INITRDDIR/$i`
14         cp $i $INITRDDIR/$i
15 done
16
17 #
18 # config files
19 #
20 if [ -d /etc/dev.d ]
21 then
22         cp -a /etc/dev.d $INITRDDIR/etc/
23 fi
24
25 if [ -d /etc/udev ]
26 then
27         cp -a /etc/udev $INITRDDIR/etc/
28 fi
29
30 #
31 # run udev from initrd
32 #
33 cat <<EOF >| $INITRDDIR/scripts/10_udev.sh
34
35 cd /
36 mount -nt proc proc proc
37 mount -nt sysfs sysfs sys
38 mount -nt tmpfs tmpfs dev || mount -nt ramfs ramfs dev
39 mount -nt tmpfs tmpfs tmp || mount -nt ramfs ramfs tmp
40
41 #modprobe dm-mod
42 #modprobe dm-multipath
43 /sbin/udevstart
44
45 umount -n tmp
46 umount -n sys
47 umount -n proc
48
49 sleep 2
50 EOF