Check-in [8a0dedb7c5]
Overview
SHA1:8a0dedb7c5eabc0d228a0ceb7bcfbfd52d489b0a
Date: 2014-12-15 16:19:19
User: rkeene
Comment:Added wildcard matching to modprobe
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-12-15
16:55
[882f8b5c54] Updated to support scanning /sys/devices for modules to load (user: rkeene, tags: trunk)
16:19
[8a0dedb7c5] Added wildcard matching to modprobe (user: rkeene, tags: trunk)
2014-11-03
18:00
[e28b7fa02d] Work towards a better ifconfig interface (user: rkeene, tags: trunk)
Changes

Modified test.tcl from [6bb651550d] to [3abe608065].

     1      1   #! /usr/bin/env tclsh
     2      2   
     3      3   puts [exec ./build-dyn.sh]
     4      4   
     5      5   load ./tuapi.so
     6      6   
     7         -::tuapi::modprobe /dev/fuse
            7  +::tuapi::modprobe pci:v000014E4d0000164Csv00001028sd000001B3bc03sc00i00
     8      8   
     9         -::tuapi::syscall::tsmf_start_svc blah /bin/true /tmp/logfile [list PATH=/bin] / 022 0 0 10
            9  +#foreach x [list AS CORE CPU DATA FSIZE LOCKS MEMLOCK MSGQUEUE NICE NOFILE OFILE NPROC RSS RTPRIO RTTIME SIGPENDING STACK] {
           10  +#	puts "\t\tcase [format 0x%xLU [::tuapi::internal::hash $x]]: /* $x */"
           11  +#	puts "\t\t\tresource_id = RLIMIT_$x;"
           12  +#	puts "\t\t\tbreak;"
           13  +#}
           14  +#exit
    10     15   
    11     16   foreach iface [tuapi::syscall::ifconfig] {
    12     17   #lo0:2: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    13     18   #        inet 127.0.0.1 netmask ff000000 
    14     19   #aggr100003:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
    15     20   #        inet 140.194.100.149 netmask ffffff00 broadcast 140.194.100.255
    16     21   

Modified tuapi.tcl from [f5399ad231] to [f69d9c9167].

   318    318   	set aliases_file [file join $modules_dir modules.alias]
   319    319   	set fd [open $aliases_file]
   320    320   	::tuapi::helper::foreach_line $fd " " {
   321    321   		set alias [lindex $line 1]
   322    322   		set module [lindex $line 2]
   323    323   
   324    324   		set alias2module($alias) $module
          325  +		if {[string match {*\**} $alias]} {
          326  +			set alias2module_wildcards($alias) $module
          327  +		}
   325    328   	}
   326    329   	close $fd
   327    330   
   328    331   	# Load dependencies
   329    332   	set deps_file [file join $modules_dir modules.dep]
   330    333   	set fd [open $deps_file]
   331    334   	::tuapi::helper::foreach_line $fd ":" {
................................................................................
   347    350   	close $fd
   348    351   
   349    352   	# Load modules
   350    353   	foreach modules $args {
   351    354   		foreach module $modules {
   352    355   			for {set try 0} {$try < 100} {incr try} {
   353    356   				if {![info exists alias2module($module)]} {
          357  +					# If no exact match found, process wildcard entries
          358  +					set found_wildcard_match 0
          359  +					foreach alias [array name alias2module_wildcards] {
          360  +						if {[string match $alias $module]} {
          361  +							set module $alias2module_wildcards($alias)
          362  +
          363  +							set found_wildcard_match 1
          364  +
          365  +							break
          366  +						}
          367  +					}
          368  +
          369  +					if {!$found_wildcard_match} {
   354    370   					break
   355    371   				}
          372  +				}
   356    373   
   357    374   				set module $alias2module($module)
   358    375   			}
   359    376   
   360    377   			if {[info exists module2deps($module)]} {
   361    378   				set load $module2deps($module)
   362    379   			} else {