3 echo "pl_sysinit: bringing system online"
5 echo "pl_sysinit: mounting file systems"
8 echo "pl_sysinit: starting udevd"
9 [ -x /sbin/start_udev ] && /sbin/start_udev
11 echo "pl_sysinit: invoking hardware initialization script"
17 if [ -f /usr/isolinux/pl_version ] ; then
18 # it mounted, but we should probably make sure its our boot cd
19 # this can be done by making sure the /pl_version file (on initrd)
20 # matches /usr/isolinux/pl_version
21 initrd_version=$(/bin/cat /pl_version)
22 cd_version=$(/bin/cat /usr/isolinux/pl_version)
23 if [ "$initrd_version" == "$cd_version" ]; then
33 # so that * expands to empty string if there are no block devices
36 for device in /sys/block/*; do
37 device=$(/bin/basename $device)
39 # skipping any devices that start with md or ra (ram) or lo
40 # (loop) or fd (floppy)
42 start_device=${device:0:2}
43 if [ "$start_device" == "ra" ] || [ "$start_device" == "md" ] ||
44 [ "$start_device" == "lo" ] || [ "$start_device" == "fd" ]; then
48 # If this is a removable (e.g., USB flash) device, then try to
49 # look for an ISO image on each of its partitions.
50 if [ "$(cat /sys/block/$device/removable)" = "1" ] ; then
51 partitions=$(/bin/awk "\$4 ~ /${device}[0-9]*/ { print \$4 }" /proc/partitions)
52 for partition in $partitions ; do
53 echo "pl_sysinit: checking $partition for iso image"
54 mkdir -p /tmp/$partition
55 if /bin/mount -o ro -t msdos,ext2 /dev/$partition /tmp/$partition 2>&1 > /dev/null ; then
56 # Look for the first ISO image
57 for iso in /tmp/$partition/*.iso ; do
58 if /sbin/losetup /dev/loop0 $iso ; then
59 echo "pl_sysinit: using $(basename $iso) on $partition"
64 if [ "$device" != "loop0" ] ; then
65 /bin/umount /tmp/$partition 2>&1 > /dev/null
71 echo "pl_sysinit: checking $device for /usr contents"
72 /bin/mount -o ro -t iso9660 /dev/$device /usr 2>&1 > /dev/null
74 # it mounted, but we should probably make sure its our boot cd
75 # this can be done by making sure the /pl_version file (on initrd)
76 # matches /usr/isolinux/pl_version
77 initrd_version=$(/bin/cat /pl_version)
78 cd_version=$(/bin/cat /usr/isolinux/pl_version)
80 if [ "$initrd_version" != "$cd_version" ]; then
81 # eh, wrong cd, keep trying
82 /bin/umount /usr 2>&1 /dev/null
84 echo "pl_sysinit: found cd and mounted on /usr"
93 echo "pl_sysinit: finding cd to mount on /usr"
99 [ ! -d /usr ] && mkdir /usr
101 [ $? -eq 1 ] && mounted=1
104 if [ $mounted -eq 0 ]; then
105 echo "pl_sysinit: unable to find boot cdrom, cannot continue."
106 # todo: maybe we can put a staticly linked sshd here
107 /sbin/shutdown -h now
111 # parts of this were copied from devmap_mknod.sh from the device-mapper
112 # source. Since fedora decided not to include it in the rpm, it is
114 echo "pl_sysinit: creating device mapper control node"
117 DM_NAME="device-mapper"
119 CONTROL="$DIR/control"
121 MAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)
122 MINOR=$(sed -n "s/^ *\([0-9]\+\) \+$DM_NAME\$/\1/p" /proc/misc)
124 if [ -n "$MAJOR" ] && [ -n "$MINOR" ]; then
125 /bin/mkdir -p --mode=755 $DIR
127 /bin/mknod --mode=600 $CONTROL c $MAJOR $MINOR
129 echo "pl_sysinit: unable to create device mapper control node, continuing"
132 echo "pl_sysinit: configuring kernel parameters"
133 /sbin/sysctl -e -p /etc/sysctl.conf
135 echo "pl_sysinit: bringing network online"
136 /etc/init.d/pl_netinit
138 echo "pl_sysinit: attempting to sync clock"
139 /usr/sbin/ntpdate -b -t 10 -u pool.ntp.org