Diff

Differences From Artifact [7e7b0aca26]:

To Artifact [801dd82b1f]:


554
555
556
557
558
559
560
561































562
563
564
565
566
567
568
	}

	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]








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







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
	}

	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]

593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
		}
		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]







|







624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
		}
		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]