more harmless space-related matters
authorparmentelat <thierry.parmentelat@inria.fr>
Fri, 14 Dec 2018 10:39:26 +0000 (11:39 +0100)
committerparmentelat <thierry.parmentelat@inria.fr>
Fri, 14 Dec 2018 10:39:26 +0000 (11:39 +0100)
initscripts/pl_boot
initscripts/pl_functions
initscripts/pl_hwinit
initscripts/pl_sysinit
initscripts/pl_validateconf

index f0faaf8..2f57cf5 100755 (executable)
@@ -83,7 +83,7 @@ while true; do
         verbose-message "pl_boot: got request to cancel boot, exiting"
         exit 0
     fi
-    
+
     if [[ $contact_count -ge $ATTEMPTS_BEFORE_BACKUP ]]; then
 
         contact_count=0
@@ -200,7 +200,7 @@ while true; do
         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
@@ -217,7 +217,7 @@ while true; do
     rm -f $UNVERIFIED_SCRIPT
     chmod +x $VERIFIED_SCRIPT
     $VERIFIED_SCRIPT
-    
+
     verbose-message "pl_boot: downloaded script has returned"
 done
 
index 18e6952..10fccf2 100644 (file)
@@ -32,17 +32,17 @@ function verbose-file-uncommented-patterns () {
         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
@@ -56,7 +56,7 @@ function verbose-forensics () {
     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;}')
index 7cddccb..16763c0 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+# xxx could use a port to python3..
+
 import sys
 import pypci
 import pypcimap
@@ -64,30 +66,30 @@ def main(argv):
                     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")
 
@@ -104,7 +106,7 @@ def main(argv):
 
     # 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,
@@ -140,7 +142,7 @@ def main(argv):
 
         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))
index dd2f893..25cba4e 100755 (executable)
@@ -86,7 +86,7 @@ function check-block-devices() {
                 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
@@ -126,7 +126,7 @@ if [ $mounted -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() {
 
@@ -137,7 +137,7 @@ 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
index cd0d694..8b8dcad 100755 (executable)
@@ -2,7 +2,7 @@
 
 # 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'