diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2009-02-19 18:04:01 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2009-02-19 18:04:01 +0000 |
commit | e59737e383b49c38768caf7a0a7e948635df3066 (patch) | |
tree | bb0c4277346062bc22f28c87223407250a68683d | |
parent | c8c34a57e12d7fec6dd378ad06d111a1b7609e65 (diff) | |
download | drakx-net-e59737e383b49c38768caf7a0a7e948635df3066.tar drakx-net-e59737e383b49c38768caf7a0a7e948635df3066.tar.gz drakx-net-e59737e383b49c38768caf7a0a7e948635df3066.tar.bz2 drakx-net-e59737e383b49c38768caf7a0a7e948635df3066.tar.xz drakx-net-e59737e383b49c38768caf7a0a7e948635df3066.zip |
Correctly writing udev rules for network devices.
-rw-r--r-- | lib/network/connection/ethernet.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index 941271d..d82ca83 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -493,8 +493,8 @@ sub update_iftab() { sub update_udev_net_config() { my $lib = arch() =~ /x86_64/ ? "lib64" : "lib"; - my $net_name_helper = "/$lib/udev/net_name_helper"; - my $udev_net_config = "/etc/udev/rules.d/61-net_config.rules"; + my $net_name_helper = "/lib/udev/write_net_rules"; + my $udev_net_config = "/etc/udev/rules.d/70-persistent-net.rules"; my @old_config = cat_($udev_net_config); #- skip aliases and vlan interfaces foreach my $intf (grep { network::tools::is_real_interface($_) } detect_devices::get_lan_interfaces()) { @@ -503,8 +503,11 @@ sub update_udev_net_config() { $mac_address =~ /^[0:]+$/ and next; #- skip already configured addresses any { !/^\s*#/ && /"$mac_address"/ } @old_config and next; + my $type = cat_("/sys/class/net/$intf/type") =~ /^\d+$/; + local $ENV{MATCHIFTYPE} = $type if $type; local $ENV{INTERFACE} = $intf; - local $ENV{SUBSYSTEM} = 'net'; + local $ENV{MATCHADDR} = $mac_address; + local $ENV{COMMENT} = "Drakx-net rule for $intf ($mac_address)"; run_program::rooted($::prefix, $net_name_helper, '>', '/dev/null', $mac_address); } } |