summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-05-13 09:43:55 +0000
committerOlivier Blin <oblin@mandriva.org>2005-05-13 09:43:55 +0000
commit69705571009c7740c0ff89c837873ab035d03059 (patch)
tree8c93f117d950e433b03c6b783c48bdcc0b114749 /perl-install/network
parentdbfb323659ad997d54aacde9ac606c3613caceba (diff)
downloaddrakx-69705571009c7740c0ff89c837873ab035d03059.tar
drakx-69705571009c7740c0ff89c837873ab035d03059.tar.gz
drakx-69705571009c7740c0ff89c837873ab035d03059.tar.bz2
drakx-69705571009c7740c0ff89c837873ab035d03059.tar.xz
drakx-69705571009c7740c0ff89c837873ab035d03059.zip
DVB support
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/netconnect.pm48
-rw-r--r--perl-install/network/network.pm3
2 files changed, 49 insertions, 2 deletions
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 825d25090..2dfe368d6 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -91,6 +91,7 @@ sub real_main {
my $my_isdn = join('', N("Manual choice"), " (", N("Internal ISDN card"), ")");
my (@ndiswrapper_drivers, $ndiswrapper_driver, $ndiswrapper_device);
my ($is_wireless, $wireless_enc_mode, $wireless_enc_key);
+ my ($dvb_adapter, $dvb_ad, $dvb_net, $dvb_pid);
my ($module, $auto_ip, $protocol, $onboot, $needhostname, $peerdns, $peeryp, $peerntpd, $hotplug, $track_network_id); # lan config
my $success = 1;
my $ethntf = {};
@@ -130,11 +131,15 @@ sub real_main {
grep { to_bool($is_wireless) == detect_devices::is_wireless_interface($_->[0]) } @all_cards;
};
- my $find_lan_module = sub {
+ my $is_dvb_interface = sub { $_[0]{DEVICE} =~ /^dvb\d+_\d+/ };
+
+ my $find_lan_module = sub {
if (my $dev = find { $_->{device} eq $ethntf->{DEVICE} } detect_devices::pcmcia_probe()) { # PCMCIA case
$module = $dev->{driver};
} elsif ($dev = find { $_->[0] eq $ethntf->{DEVICE} } @all_cards) {
$module = $dev->[1];
+ } elsif ($is_dvb_interface->($ethntf)) {
+ $module = $dvb_adapter->{driver};
} else { $module = "" }
};
@@ -302,6 +307,7 @@ sub real_main {
[ N("Cable connection"), "cable" ],
[ N("ISDN connection"), "isdn" ],
[ N("Modem connection"), "modem" ],
+ [ N("DVB connection"), "dvb" ],
);
foreach (@connections) {
@@ -1289,6 +1295,46 @@ See iwpriv(8) man page for further information."),
},
+ dvb =>
+ {
+ name => N("DVB configuration") . "\n\n" . N("Select the network interface to configure:"),
+ data => [ { label => N("DVB Adapter"), type => "list", val => \$dvb_adapter, allow_empty_list => 1,
+ list => [ modules::probe_category("multimedia/dvb") ], format => sub { $_[0]{description} } } ],
+ next => "dvb_adapter",
+ },
+
+
+ dvb_adapter =>
+ {
+ pre => sub {
+ use Fcntl qw(O_RDWR O_NONBLOCK);
+ my $previous_ethntf = find { $is_dvb_interface->($_) } values %$intf;
+ $dvb_ad = $previous_ethntf->{DVB_ADAPTER_ID};
+ $dvb_net = $previous_ethntf->{DVB_NETWORK_DEMUX};
+ $dvb_pid = $previous_ethntf->{DVB_NETWORK_PID};
+ if (my $device = find { sysopen(undef, $_, O_RDWR | O_NONBLOCK) } glob("/dev/dvb/adapter*/net*")) {
+ ($dvb_ad, $dvb_net) = $device =~ m,/dev/dvb/adapter(\d+)/net(\d+),;
+ }
+ },
+ name => N("DVB adapter settings"),
+ data => sub {
+ [
+ { label => N("Adapter card"), val => \$dvb_ad },
+ { label => N("Net demux"), val => \$dvb_net },
+ { label => N("PID"), val => \$dvb_pid },
+ ];
+ },
+ post => sub {
+ $ntf_name = 'dvb' . $dvb_ad . '_' . $dvb_net;
+ $ethntf = $intf->{$ntf_name} ||= {};
+ $ethntf->{DEVICE} = $ntf_name;
+ $ethntf->{DVB_ADAPTER_ID} = qq("$dvb_ad");
+ $ethntf->{DVB_NETWORK_DEMUX} = qq("$dvb_net");
+ $ethntf->{DVB_NETWORK_PID} = qq("$dvb_pid");
+ return "lan_protocol";
+ },
+ },
+
static_hostname =>
{
pre => sub {
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 500bea186..50411ca1f 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -160,6 +160,7 @@ sub write_interface_conf {
setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR METRIC MII_NOT_SUPPORTED TYPE USERCTL ATM_ADDR),
qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV WIRELESS_WPA_DRIVER),
+ qw(DVB_ADAPTER_ID DVB_NETWORK_DEMUX DVB_NETWORK_PID),
if_($intf->{BOOTPROTO} eq "dhcp", qw(DHCP_CLIENT DHCP_HOSTNAME NEEDHOSTNAME PEERDNS PEERYP PEERNTPD DHCP_TIMEOUT)),
if_($intf->{DEVICE} =~ /^ippp\d+$/, qw(DIAL_ON_IFUP))
);
@@ -416,7 +417,7 @@ sub read_all_conf {
add2hash($netc, read_resolv_conf());
add2hash($netc, read_tmdns_conf());
foreach (all("$::prefix/etc/sysconfig/network-scripts")) {
- my ($device) = /^ifcfg-([A-Za-z0-9.:]+)$/;
+ my ($device) = /^ifcfg-([A-Za-z0-9.:_-]+)$/;
next if $device =~ /.rpmnew$|.rpmsave$/;
if ($device && $device ne 'lo') {
my $intf = findIntf($intf, $device);