3 echo "pl_sysinit: bringing system online"
5 echo "pl_sysinit: mounting file systems"
8 echo "pl_sysinit: invoking hardware initialization script"
11 echo "pl_sysinit: finding cd to mount on /usr"
13 initrd_version=$(/bin/cat /pl_version)
16 # so that * expands to empty string if there are no block
20 for device in /sys/block/*; do
21 device=$(/bin/basename $device)
23 # skipping any devices that start with md or ra (ram) or lo (loop) or
25 start_device=${device:0:2}
26 if [ "$start_device" == "ra" ] || [ "$start_device" == "md" ] ||
27 [ "$start_device" == "lo" ] || [ "$start_device" == "fd" ]; then
31 # If this is a removable (e.g., USB flash) device, then try to
32 # look for an ISO image on each of its partitions.
33 if [ "$(cat /sys/block/$device/removable)" = "1" ] ; then
34 partitions=$(/bin/awk "\$4 ~ /${device}[0-9]*/ { print \$4 }" /proc/partitions)
35 for partition in $partitions ; do
36 echo "pl_sysinit: checking $partition for iso image"
37 if /bin/mount -o ro -t msdos,ext2 /dev/$partition /usr 2>&1 > /dev/null ; then
38 # Look for the first ISO image
39 for iso in /usr/*.iso ; do
40 if /sbin/losetup /dev/loop0 $iso ; then
41 echo "pl_sysinit: using $iso on $partition"
46 if [ "$device" != "loop0" ] ; then
47 /bin/umount /usr 2>&1 > /dev/null
53 echo "pl_sysinit: checking $device for /usr contents"
54 /bin/mount -o ro -t iso9660 /dev/$device /usr 2>&1 > /dev/null
56 # it mounted, but we should probably make sure its our boot cd
57 # this can be done by making sure the /pl_version file (on initrd)
58 # matches /usr/isolinux/pl_version
59 cd_version=$(/bin/cat /usr/isolinux/pl_version)
61 if [ "$initrd_version" != "$cd_version" ]; then
62 # eh, wrong cd, keep trying
63 /bin/umount /usr 2>&1 /dev/null
65 echo "pl_sysinit: found cd and mounted on /usr"
72 if [ $mounted -eq 0 ]; then
73 echo "pl_sysinit: unable to find boot cdrom, cannot continue."
74 # todo: maybe we can put a staticly linked sshd here
79 # parts of this were copied from devmap_mknod.sh from the device-mapper
80 # source. Since fedora decided not to include it in the rpm, it is
82 echo "pl_sysinit: creating device mapper control node"
85 DM_NAME="device-mapper"
87 CONTROL="$DIR/control"
89 MAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)
90 MINOR=$(sed -n "s/^ *\([0-9]\+\) \+$DM_NAME\$/\1/p" /proc/misc)
92 if [ -n "$MAJOR" ] && [ -n "$MINOR" ]; then
93 /bin/mkdir -p --mode=755 $DIR
95 /bin/mknod --mode=600 $CONTROL c $MAJOR $MINOR
97 echo "pl_sysinit: unable to create device mapper control node, continuing"
100 echo "pl_sysinit: configuring kernel parameters"
101 /sbin/sysctl -e -p /etc/sysctl.conf
103 echo "pl_sysinit: bringing network online"
104 /etc/init.d/pl_netinit