Check-in [6c60df91c9]
Overview
SHA1:6c60df91c9e2d9c95395078f6ca530240a8cc629
Date: 2015-02-13 19:16:19
User: rkeene
Comment:Updated to allow scan_and_load_kernel_modules to be supplied arguments for kernel modules
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2015-02-18
02:45
[4ea5feb1d3] Added more whitespace separators to module argument parameters (user: rkeene, tags: trunk)
2015-02-13
19:16
[6c60df91c9] Updated to allow scan_and_load_kernel_modules to be supplied arguments for kernel modules (user: rkeene, tags: trunk)
2015-02-04
16:19
[f73c910cba] Added settimeofday (user: rkeene, tags: trunk)
Changes

Modified tuapi.tcl from [7e7b0aca26] to [801dd82b1f].

   554    554   	}
   555    555   
   556    556   	return $retval
   557    557   }
   558    558   
   559    559   # Scan the various buses attached to the system and load the appropriate
   560    560   # kernel modules
   561         -proc ::tuapi::scan_and_load_kernel_modules {{rescan_hardware 0}} {
          561  +proc ::tuapi::scan_and_load_kernel_modules args {
          562  +	set parameters [list "ata_generic.all_generic_ide=1"]
          563  +	foreach arg $args {
          564  +		if {[info exists var_to_set]} {
          565  +			set $var_to_set $arg
          566  +
          567  +			unset var_to_set
          568  +
          569  +			continue
          570  +		}
          571  +
          572  +		if {[info exists var_to_lappend]} {
          573  +			lappend $var_to_lappend $arg
          574  +
          575  +			unset var_to_lappend
          576  +
          577  +			continue
          578  +		}
          579  +
          580  +		switch -- $arg {
          581  +			"-arg" {
          582  +				set var_to_lappend parameters
          583  +			}
          584  +			"-args" {
          585  +				set var_to_set parameters
          586  +			}
          587  +			default {
          588  +				return -code error "Unknown option: $arg"
          589  +			}
          590  +		}
          591  +	}
          592  +
   562    593   	set modules [list]
   563    594   
   564    595   	# Determine which modules are already loaded
   565    596   	foreach module [glob -tails -nocomplain -directory /sys/module -type d *] {
   566    597   		set alt_module1 [string map [list "_" "-"] $module]
   567    598   		set alt_module2 [string map [list "-" "_"] $module]
   568    599   
................................................................................
   593    624   		}
   594    625   		close $fd
   595    626   	}
   596    627   
   597    628   	set failed_to_load [list]
   598    629   	set able_to_load [list]
   599    630   	foreach module $modules {
   600         -		if {[::tuapi::modprobe -args {ata_generic.all_generic_ide=1} $module] == ""} {
          631  +		if {[::tuapi::modprobe -args $parameters $module] == ""} {
   601    632   			lappend failed_to_load $module
   602    633   		} else {
   603    634   			lappend able_to_load $module
   604    635   		}
   605    636   	}
   606    637   
   607    638   	return [list -failed $failed_to_load -loaded $able_to_load]