File: initramfs.bottom

package info (click to toggle)
udev 164-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,336 kB
  • ctags: 1,738
  • sloc: ansic: 18,516; sh: 11,378; perl: 1,725; xml: 1,286; makefile: 692; python: 34
file content (35 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
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
#!/bin/sh -e

PREREQS=""

prereqs() { echo "$PREREQS"; }

case "$1" in
    prereqs)
    prereqs
    exit 0
    ;;
esac

# Stop udevd, we'll miss a few events while we run init, but we catch up
for proc in /proc/[0-9]*; do
  [ -x $proc/exe ] || continue
  if [ "$(readlink $proc/exe)" = /sbin/udevd ]; then
    # errors must be ignored due to a race with udevd child processes
    # naturally terminating
    kill ${proc#/proc/} 2> /dev/null || true
  fi
done

udev_root="/dev"
if [ -e /etc/udev/udev.conf ]; then
  . /etc/udev/udev.conf
fi

# move the /dev tmpfs to the rootfs
mount -n -o move /dev ${rootmnt}${udev_root}

# create a temporary symlink to the final /dev for other initramfs scripts
nuke /dev
ln -s ${rootmnt}${udev_root} /dev