Overview
Comment: | Added support for device name loading |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
50eb7273e9c59d28049a7e3ec0d79675 |
User & Date: | rkeene on 2014-10-29 16:17:30 |
Other Links: | manifest | tags |
Context
2014-10-29
| ||
18:09 | Added basic support for "stty" check-in: a7c3ea759b user: rkeene tags: trunk | |
16:17 | Added support for device name loading check-in: 50eb7273e9 user: rkeene tags: trunk | |
16:07 | Added working modprobe check-in: 3b9488fc72 user: rkeene tags: trunk | |
Changes
Modified test.tcl from [0a5644d7e0] to [6bb651550d].
1 2 3 4 5 6 | #! /usr/bin/env tclsh puts [exec ./build-dyn.sh] load ./tuapi.so | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #! /usr/bin/env tclsh puts [exec ./build-dyn.sh] load ./tuapi.so ::tuapi::modprobe /dev/fuse ::tuapi::syscall::tsmf_start_svc blah /bin/true /tmp/logfile [list PATH=/bin] / 022 0 0 10 foreach iface [tuapi::syscall::ifconfig] { #lo0:2: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 # inet 127.0.0.1 netmask ff000000 #aggr100003:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2 |
︙ | ︙ |
Modified tuapi.tcl from [395d853f2a] to [741721e332].
︙ | ︙ | |||
270 271 272 273 274 275 276 | uplevel 1 [list set line $line] uplevel 1 $code } uplevel 1 [list unset -nocomplain line] } proc ::tuapi::modprobe args { | | > > > > > > > > > > > > > > > > > > > > | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | uplevel 1 [list set line $line] uplevel 1 $code } uplevel 1 [list unset -nocomplain line] } proc ::tuapi::modprobe args { # Set module base directory set modules_dir [file join /lib/modules $::tcl_platform(osVersion)] # Load device names set devnames_file [file join $modules_dir modules.devname] set fd [open $devnames_file] ::tuapi::internal::foreach_line $fd " " { set module [lindex $line 0] set device [lindex $line 1] set id [lindex $line 2] set id_type [string index $id 0] set id_type [string map [list "c" "char" "b" "block"] $id_type] set id [split [string range $id 1 end] :] set id_alias "${id_type}-major-[lindex $id 0]-[lindex $id 1]" set "alias2module(/dev/${device})" $module set alias2module($id_alias) $module } close $fd # Load aliases set aliases_file [file join $modules_dir modules.alias] set fd [open $aliases_file] ::tuapi::internal::foreach_line $fd " " { set alias [lindex $line 1] set module [lindex $line 2] set alias2module($alias) $module |
︙ | ︙ | |||
323 324 325 326 327 328 329 330 331 332 333 334 335 336 | } else { set load [list] } lappend load $module foreach module $load { set module [file join $modules_dir $module] ::tuapi::syscall::insmod $module } } } } | > > > > | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | } else { set load [list] } lappend load $module foreach module $load { if {[string match "/dev/*" $module]} { return -code error "Unable to lookup device node module for $module" } set module [file join $modules_dir $module] ::tuapi::syscall::insmod $module } } } } |