Diff

Differences From Artifact [dc4245bc68]:

To Artifact [fd3cc0d95d]:


250
251
252
253
254
255
256




















































				::tuapi::syscall::ifconfig $interface flags $flags
			}

		}
	}
}


























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
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
306
307

				::tuapi::syscall::ifconfig $interface flags $flags
			}

		}
	}
}

proc ::tuapi::internal::foreach_line {fd {sep ""} code} {
	while {![eof $fd]} {
		gets $fd line

		regsub { *#.*$} $line {} line

		if {$line == ""} {
			continue
		}

		if {$sep == ""} {
			set line [split $line]
		} else {
			set line [split $line $sep]
		}

		uplevel 1 [list set line $line]
		uplevel 1 $code
	}
	uplevel 1 [list unset -nocomplain line]
}

proc ::tuapi::modprobe args {
	# Load aliases
	set modules_dir [file join /lib/modules $::tcl_platform(osVersion)]
	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
	}

	close $fd

	# Load dependencies
	set deps_file [file join $modules_dir modules.dep]
	::tuapi::internal::foreach_line $fd ":" {
		set module [string trim [lindex $line 0]]
		set deps [split [string trim [lrange $line 1 end]]]
		puts "$module -> $deps"
	}

	# Load modules
	foreach modules $args {
		foreach module $modules {
		}
	}
}