- run createrepo with the correct -g option
[bootcd.git] / conf_files / pl_netinit
index b1f9abf..1aced1b 100644 (file)
@@ -54,9 +54,6 @@ IFCONFIG_OUTPUT=/tmp/ifconfig
 # (no other configuration file found)
 DEFAULT_NET_CONF=0
 
-# amount of time to delay before we check flash devices
-FLASH_DEVICE_DELAY=25s
-
 
 net_init_failed()
 {
@@ -128,12 +125,6 @@ find_node_config()
 
     echo "pl_netinit: looking for node configuration file on flash based devices"
 
-    echo "pl_netinit: waiting for flash devices if any to come online"
-    # some usb flash based devices take a couple of seconds to initialize
-    # also, try to read the partition table off the device to make sure
-    # it shows up in /sys/block
-    /bin/sleep $FLASH_DEVICE_DELAY
-
     # make the sd* expansion fail to an empty string if there are no sd
     # devices
     shopt -s nullglob
@@ -144,26 +135,29 @@ find_node_config()
            continue
        fi
 
-       check_dev=/dev/`basename $device`1
-
-       echo "pl_netinit: looking for node configuration file on device $check_dev"
-       /bin/mount -o ro -t $NODE_CONF_DEVICE_FS_TYPES $check_dev \
-           $CONF_DEVICE_MOUNT_POINT 2>&1 > /dev/null
-       if [[ $? -eq 0 ]]; then
-           if [ -r "$CONF_DEVICE_MOUNT_POINT/$NEW_NODE_CONF_NAME" ]; then
-               echo "pl_netinit: found node configuration file plnode.txt, using"
+       partitions=$(/bin/awk "\$4 ~ /`basename $device`[0-9]*/ { print \$4 }" /proc/partitions)
+       for partition in $partitions ; do
+           check_dev=/dev/$partition
+
+           echo "pl_netinit: looking for node configuration file on device $check_dev"
+           /bin/mount -o ro -t $NODE_CONF_DEVICE_FS_TYPES $check_dev \
+               $CONF_DEVICE_MOUNT_POINT 2>&1 > /dev/null
+           if [[ $? -eq 0 ]]; then
+               if [ -r "$CONF_DEVICE_MOUNT_POINT/$NEW_NODE_CONF_NAME" ]; then
+                   echo "pl_netinit: found node configuration file plnode.txt, using"
+
+                   conf_file="$CONF_DEVICE_MOUNT_POINT/$NEW_NODE_CONF_NAME"
+                   /etc/init.d/pl_validateconf < $conf_file > $USED_NET_CONF
+                   echo "pl_netinit: found configuration"
+                   /bin/umount $CONF_DEVICE_MOUNT_POINT
+                   return 1
+               fi
+               
+               echo "pl_netinit: not found"
 
-               conf_file="$CONF_DEVICE_MOUNT_POINT/$NEW_NODE_CONF_NAME"
-               /etc/init.d/pl_validateconf < $conf_file > $USED_NET_CONF
-               echo "pl_netinit: found configuration"
                /bin/umount $CONF_DEVICE_MOUNT_POINT
-               return 1
            fi
-           
-           echo "pl_netinit: not found"
-
-           /bin/umount $CONF_DEVICE_MOUNT_POINT
-       fi
+       done
     done
 
     # normal filename expansion setting