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
555
556
557
558
559
560
561































562
563
564
565
566
567
568
...
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
	}

	return $retval
}

# Scan the various buses attached to the system and load the appropriate
# kernel modules
proc ::tuapi::scan_and_load_kernel_modules {{rescan_hardware 0}} {































	set modules [list]

	# Determine which modules are already loaded
	foreach module [glob -tails -nocomplain -directory /sys/module -type d *] {
		set alt_module1 [string map [list "_" "-"] $module]
		set alt_module2 [string map [list "-" "_"] $module]

................................................................................
		}
		close $fd
	}

	set failed_to_load [list]
	set able_to_load [list]
	foreach module $modules {
		if {[::tuapi::modprobe -args {ata_generic.all_generic_ide=1} $module] == ""} {
			lappend failed_to_load $module
		} else {
			lappend able_to_load $module
		}
	}

	return [list -failed $failed_to_load -loaded $able_to_load]







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
...
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
	}

	return $retval
}

# Scan the various buses attached to the system and load the appropriate
# kernel modules
proc ::tuapi::scan_and_load_kernel_modules args {
	set parameters [list "ata_generic.all_generic_ide=1"]
	foreach arg $args {
		if {[info exists var_to_set]} {
			set $var_to_set $arg

			unset var_to_set

			continue
		}

		if {[info exists var_to_lappend]} {
			lappend $var_to_lappend $arg

			unset var_to_lappend

			continue
		}

		switch -- $arg {
			"-arg" {
				set var_to_lappend parameters
			}
			"-args" {
				set var_to_set parameters
			}
			default {
				return -code error "Unknown option: $arg"
			}
		}
	}

	set modules [list]

	# Determine which modules are already loaded
	foreach module [glob -tails -nocomplain -directory /sys/module -type d *] {
		set alt_module1 [string map [list "_" "-"] $module]
		set alt_module2 [string map [list "-" "_"] $module]

................................................................................
		}
		close $fd
	}

	set failed_to_load [list]
	set able_to_load [list]
	foreach module $modules {
		if {[::tuapi::modprobe -args $parameters $module] == ""} {
			lappend failed_to_load $module
		} else {
			lappend able_to_load $module
		}
	}

	return [list -failed $failed_to_load -loaded $able_to_load]