File: 01_udev

package info (click to toggle)
multipath-tools 0.4.7-1.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 1,196 kB
  • ctags: 2,144
  • sloc: ansic: 18,261; makefile: 398; sh: 270
file content (50 lines) | stat: -rwxr-xr-x 869 bytes parent folder | download | duplicates (8)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
#
cp /sbin/udev $INITRDDIR/sbin/hotplug
cp /sbin/udevstart $INITRDDIR/sbin/
cp /bin/mountpoint $INITRDDIR/bin/
cp /bin/readlink $INITRDDIR/bin/

PROGS="/sbin/udev /sbin/udevstart /bin/mountpoint /bin/readlink"
LIBS=`ldd $PROGS | grep -v linux-gate.so | sort -u | \
awk '{print $3}'` 
for i in $LIBS
do
	mkdir -p `dirname $INITRDDIR/$i`
	cp $i $INITRDDIR/$i
done

#
# config files
#
if [ -d /etc/dev.d ]
then
	cp -a /etc/dev.d $INITRDDIR/etc/
fi

if [ -d /etc/udev ]
then
	cp -a /etc/udev $INITRDDIR/etc/
fi

#
# run udev from initrd
#
cat <<EOF >| $INITRDDIR/scripts/10_udev.sh

cd /
mount -nt proc proc proc
mount -nt sysfs sysfs sys
mount -nt tmpfs tmpfs dev || mount -nt ramfs ramfs dev
mount -nt tmpfs tmpfs tmp || mount -nt ramfs ramfs tmp

#modprobe dm-mod
#modprobe dm-multipath
/sbin/udevstart

umount -n tmp
umount -n sys
umount -n proc

sleep 2
EOF