X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=conf_files%2Fpl_netinit;h=1aced1ba56d70d33037e0c0b3fb2971b7185be7b;hb=refs%2Fheads%2Fplanetlab-3_3-branch;hp=b1f9abf6a9c4391b25453ca96dc0c2eed98896e6;hpb=48ad56537c41e105eb5d35719a3b5afc748b9939;p=bootcd.git diff --git a/conf_files/pl_netinit b/conf_files/pl_netinit index b1f9abf..1aced1b 100644 --- a/conf_files/pl_netinit +++ b/conf_files/pl_netinit @@ -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