verbose-message "pl_boot: got request to cancel boot, exiting"
exit 0
fi
-
+
if [[ $contact_count -ge $ATTEMPTS_BEFORE_BACKUP ]]; then
contact_count=0
cp $UNVERIFIED_SCRIPT /tmp/boot-media
umount /tmp/boot-media
rmdir /tmp/boot-media
- fi
+ fi
verbose-message "pl_boot: verifying downloaded script"
rm -f $VERIFIED_SCRIPT
rm -f $UNVERIFIED_SCRIPT
chmod +x $VERIFIED_SCRIPT
$VERIFIED_SCRIPT
-
+
verbose-message "pl_boot: downloaded script has returned"
done
grep -v '^#' $file | egrep "$egrep_pattern"
fi
}
-
+
function verbose-forensics () {
message="$1"; shift
verbose-message "BEG FORENSICS -- $message"
verbose-run dmesg
verbose-run lsmod
verbose-run lspci
-
+
# XXX : need to check for a running udev
- for file in /etc/resolv.conf /run/resolvconf/resolv.conf /etc/sysconfig/network-scripts/ifcfg-eth*; do
+ for file in /etc/resolv.conf /run/resolvconf/resolv.conf /etc/sysconfig/network-scripts/ifcfg-eth*; do
verbose-file $file
done
verbose-message Configured interfaces
BOOT_SERVER=$(cat $BOOT_FILE)
verbose-message Pinging boot server $BOOT_SERVER "(" from file $BOOT_FILE ")"
verbose-run ping -c 4 -w 4 $BOOT_SERVER
- verbose-message Pinging google public DNS
+ verbose-message Pinging google public DNS
verbose-run ping -c 1 -w 5 8.8.8.8
# try to resolve this hostname as that's the one used for ntp
dnss=$(grep '^nameserver' /etc/resolv.conf 2>/dev/null | awk '{print $2;}')
#!/usr/bin/python
+# xxx could use a port to python3..
+
import sys
import pypci
import pypcimap
storage_devices += 1
elif base == 0x02:
network_devices += 1
-
+
# FIXME: This needs improved logic in the case of multiple matching modules
for module in modules:
if module not in blacklisted_modules:
verbose_message("pl_hwinit: found and loading module {} (%s)" % (module, slot))
modprobe(module, loadedmodules)
-
+
if network_devices == 0:
verbose_message("pl_hwinit: no supported network devices found!")
verbose_message("pl_hwinit: the following devices were found, but have no driver:")
lines = [ "{} x {}".format(slot, dev) for slot, dev in missing ]
for line in lines:
verbose_message("pl_hwinit: missing " + line)
-
+
# XXX: could check for storage devices too, but older kernels have a lot of that built-in
-
+
# sd_mod won't get loaded automatically
verbose_message("pl_hwinit: loading sd_mod")
modprobe("sd_mod", loadedmodules)
-
+
# load usb_storage to support node conf files on flash disks
verbose_message("pl_hwinit: loading usb_storage")
modprobe("usb_storage", loadedmodules)
-
+
verbose_message("pl_hwinit: loading floppy device driver")
modprobe("floppy", loadedmodules, "floppy=0,allowed_drive_mask")
# the way this will be done is to look for files in /sys/devices that are named
# 'bInterfaceClass', these will be a list of the usb devices on the system, and
- # their primary usb device interface class ids. The base directory these files
+ # their primary usb device interface class ids. The base directory these files
# exist in will be the full path to the /sys/device entry for that device.
# for each mass storage devices (they have an interface class value of 08),
# we wait for a new symbolic link named 'driver' to exist in that directory,
total_wait_time = 0
success = False
- while total_wait_time < MAX_USB_WAIT_TIME:
+ while total_wait_time < MAX_USB_WAIT_TIME:
total_wait_time += PER_CHECK_USB_WAIT_TIME
verbose_message("pl_hwinit: waiting {} seconds.".format(PER_CHECK_USB_WAIT_TIME))
fi
done
fi
-
+
verbose-message "pl_sysinit: checking $device for /usr contents"
/bin/mount -o ro -t iso9660 /dev/$device /usr 2>&1 > /dev/null
if [ $? -eq 0 ]; then
fi
# parts of this were copied from devmap_mknod.sh from the device-mapper
-# source. Since fedora decided not to include it in the rpm, it is
+# source. Since fedora decided not to include it in the rpm, it is
# being copied here
function create-device-mapper-node() {
MAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)
MINOR=$(sed -n "s/^ *\([0-9]\+\) \+$DM_NAME\$/\1/p" /proc/misc)
-
+
if [ -n "$MAJOR" ] && [ -n "$MINOR" ]; then
/bin/mkdir -p --mode=755 $DIR
/bin/rm -f $CONTROL
# Valid environment variables to appear in a planetlab config file
TAGS='IP_METHOD HOST_NAME DOMAIN_NAME PROXY_SERVER
- IP_ADDRESS IP_GATEWAY IP_NETMASK IP_NETADDR IP_BROADCASTADDR
+ IP_ADDRESS IP_GATEWAY IP_NETMASK IP_NETADDR IP_BROADCASTADDR
IP_DNS1 IP_DNS2 NET_DEVICE NODE_KEY NODE_ID
IPMI_ADDRESS IPMI_MAC DISCONNECTED_OPERATION
WLAN_SSID WLAN_IWCONFIG WLAN_MODE'