summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
blob: 11ebc22899a51fbb56ef8c763993bae7204c8c3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
8086 24c5 / 8086 24d5 / 10de 00da / 10de 006a
hoping that the sound is now unmutted by default.

Diffstat (limited to 'lst/pcitable')
-rw-r--r--lst/pcitable8
1 files changed, 4 insertions, 4 deletions
diff --git a/lst/pcitable b/lst/pcitable
index 62bcc5b3..53016cc6 100644
--- a/lst/pcitable
+++ b/lst/pcitable
@@ -1758,14 +1758,14 @@
0x10de 0x0066 "nvnet" "Nvidia Corporation|nForce2 MCP Networking Adapter"
0x10de 0x0067 "usb-ohci" "Nvidia Corporation|nForce2 USB 1.0 OHCI Controller"
0x10de 0x0068 "ehci-hcd" "Nvidia Corporation|nForce2 USB 2.0 Enhanced Controller"
-0x10de 0x006a "i810_audio" "Nvidia Corporation|nForce2 Audio Codec Interface"
+0x10de 0x006a "snd-intel8x0" "Nvidia Corporation|nForce2 Audio Codec Interface"
0x10de 0x006b "unknown" "Nvidia Corporation|nForce2 APU"
0x10de 0x006c "unknown" "Nvidia Corporation|nForce2 External PCI Bridge"
0x10de 0x006d "unknown" "Nvidia Corporation|nForce2 PCI Bridge"
0x10de 0x006e "ohci1394" "Nvidia Corporation|nForce2 Firewire Controller"
0x10de 0x00a0 "Card:RIVA TNT2" "nVidia Corporation|Riva TNT2"
0x10de 0x00d4 "unknown" "NVIDIA Corporation|nForce MCP3? SMBus Controller"
-0x10de 0x00da "i810_audio" "Nvidia Corporation|nForce2 Audio Codec Interface"
+0x10de 0x00da "snd-intel8x0" "Nvidia Corporation|nForce2 Audio Codec Interface"
0x10de 0x0100 "Card:NVIDIA GeForce 256 (generic)" "nVidia Corporation|GeForce 256"
0x10de 0x0101 "Card:NVIDIA GeForce 256 (generic)" "nVidia Corporation|GeForce DDR"
0x10de 0x0102 "Card:NVIDIA GeForce 256 (generic)" "nVidia Corporation|NV10 GeForce 256 Ultra"
@@ -4199,7 +4199,7 @@
0x8086 0x24c2 "usb-uhci" "Intel Corporation|82801DB USB Controller"
0x8086 0x24c3 "unknown" "Intel Corporation|82801DB SMBus Controller"
0x8086 0x24c4 "usb-uhci" "Intel Corporation|82801DB USB Controller"
-0x8086 0x24c5 "i810_audio" "Intel Corporation|ICH4 845G/GL Chipset AC'97 Audio Controller"
+0x8086 0x24c5 "snd-intel8x0" "Intel Corporation|ICH4 845G/GL Chipset AC'97 Audio Controller"
0x8086 0x24c6 "unknown" "Intel Corp.|82801DB AC"
0x8086 0x24c7 "usb-uhci" "Intel Corporation|82801DB USB Controller"
0x8086 0x24ca "unknown" "Intel Corporation|82801DBM IDE Controller (UltraATA/100)"
@@ -4211,7 +4211,7 @@
0x8086 0x24d2 "usb-uhci" "Intel Corporation|USB Controller"
0x8086 0x24d3 "unknown" "Intel Corp.|82801EB SMBus"
0x8086 0x24d4 "usb-uhci" "Intel Corporation|USB Controller"
-0x8086 0x24d5 "i810_audio" "Intel Corp.|82801EB AC'97 Audio"
+0x8086 0x24d5 "snd-intel8x0" "Intel Corp.|82801EB AC'97 Audio"
0x8086 0x24d7 "usb-uhci" "Intel Corporation|USB Controller"
0x8086 0x24db "unknown" "Intel Corp.|82801EB ICH5 IDE"
0x8086 0x24dd "ehci-hcd" "Intel Corporation|USB Enhanced Controller"
"hl opt">; use c; use MDK::Common; use log; 1; sub run_or_die { my ($name, @args) = @_; run($name, @args) or die "$name failed\n"; } sub rooted_or_die { my ($root, $name, @args) = @_; rooted($root, $name, @args) or die "$name failed\n"; } sub get_stdout { my ($name, @args) = @_; my @r; run($name, '>', \@r, @args) or return; wantarray() ? @r : join('', @r); } sub rooted_get_stdout { my ($root, $name, @args) = @_; my @r; rooted($root, $name, '>', \@r, @args) or return; wantarray() ? @r : join('', @r); } sub run { raw({}, @_) } sub rooted { my ($root, $name, @args) = @_; raw({ root => $root }, $name, @args); } sub raw { my ($options, $name, @args) = @_; my $root = $options->{root} || ''; my $real_name = ref($name) ? $name->[0] : $name; my ($stdout_raw, $stdout_mode, $stderr_raw, $stderr_mode); ($stdout_mode, $stdout_raw, @args) = @args if $args[0] =~ /^>>?$/; ($stderr_mode, $stderr_raw, @args) = @args if $args[0] =~ /^2>>?$/; my $args = $options->{sensitive_arguments} ? '<hidden arguments>' : join(' ', @args); log::explanations("running: $real_name $args" . ($root ? " with root $root" : "")); return if $root && $<; $root ? ($root .= '/') : ($root = ''); my $tmpdir = sub { my $dir = $< != 0 ? "$ENV{HOME}/tmp" : -d '/root' ? '/root/tmp' : '/tmp'; -d $dir or mkdir($dir, 0700); $dir; }; my $stdout = $stdout_raw && (ref($stdout_raw) ? $tmpdir->() . "/.drakx-stdout.$$" : "$root$stdout_raw"); my $stderr = $stderr_raw && (ref($stderr_raw) ? $tmpdir->() . "/.drakx-stderr.$$" : "$root$stderr_raw"); #- checking if binary exist to avoid clobbering stdout file my $rname = $real_name =~ /(.*?)[\s\|]/ ? $1 : $real_name; if (! ($rname =~ m!^/! ? -x "$root$rname" || $root && -l "$root$rname" #- handle non-relative symlink which can be broken when non-rooted : whereis_binary($rname, $root))) { log::l("program not found: $real_name"); return; } if (my $pid = fork()) { if ($options->{detach}) { $pid; } else { my $ok; add2hash_($options, { timeout => 10 * 60 }); eval { local $SIG{ALRM} = sub { die "ALARM" }; my $remaining = $options->{timeout} && $options->{timeout} ne 'never' && alarm($options->{timeout}); waitpid $pid, 0; $ok = $? == -1 || ($? >> 8) == 0; alarm $remaining; }; if ($@) { log::l("ERROR: killing runaway process (process=$real_name, pid=$pid, args=@args, error=$@)"); kill 9, $pid; return; } if ($stdout_raw && ref($stdout_raw)) { if (ref($stdout_raw) eq 'ARRAY') { @$stdout_raw = cat_($stdout); } else { $$stdout_raw = cat_($stdout); } unlink $stdout; } if ($stderr_raw && ref($stderr_raw)) { if (ref($stderr_raw) eq 'ARRAY') { @$stderr_raw = cat_($stderr); } else { $$stderr_raw = cat_($stderr); } unlink $stderr; } $ok; } } else { if ($options->{setuid}) { require POSIX; POSIX::setuid($options->{set_uid}); } sub die_exit { log::l($_[0]); c::_exit(128); } if ($stderr && $stderr eq 'STDERR') { } elsif ($stderr) { $stderr_mode =~ s/2//; open STDERR, "$stderr_mode $stderr" or die_exit("run_program can not output in $stderr (mode `$stderr_mode')"); } elsif ($::isInstall) { open STDERR, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die_exit("run_program can not log, give me access to /tmp/ddebug.log"); } if ($stdout && $stdout eq 'STDOUT') { } elsif ($stdout) { open STDOUT, "$stdout_mode $stdout" or die_exit("run_program can not output in $stdout (mode `$stdout_mode')"); } elsif ($::isInstall) { open STDOUT, ">> /tmp/ddebug.log" or open STDOUT, ">> /dev/tty7" or die_exit("run_program can not log, give me access to /tmp/ddebug.log"); } $root and chroot $root; chdir($options->{chdir} || "/"); my $ok = ref $name ? do { exec { $name->[0] } $name->[1], @args; } : do { exec $name, @args; }; if (!$ok) { die_exit("exec of $real_name failed: $!"); } } } # run in background a sub that give back data through STDOUT a la run_program::get_stdout but w/ arbitrary perl code instead of external program package bg_command; sub new { my ($class, $sub) = @_; my $o = bless {}, $class; if ($o->{pid} = open(my $fd, "-|")) { $o->{fd} = $fd; $o; } else { $sub->(); c::_exit(0); } } sub DESTROY { my ($o) = @_; close $o->{fd} or warn "kid exited $?"; waitpid $o->{pid}, 0; } 1; #- Local Variables: #- mode:cperl #- tab-width:8 #- End: