From 59394e6b2950b9178cc3e99c6eea49af7a8d5917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 12 Jun 2012 04:16:20 +0200 Subject: Update network configuration support for RHEL/Fedora Thanks to Francois Andriot for the patch! --- knetworkconf/backends/platform.pl.in | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'knetworkconf/backends/platform.pl.in') diff --git a/knetworkconf/backends/platform.pl.in b/knetworkconf/backends/platform.pl.in index a3b52bb..7c8269e 100644 --- a/knetworkconf/backends/platform.pl.in +++ b/knetworkconf/backends/platform.pl.in @@ -71,6 +71,8 @@ $PLATFORM_INFO = { "redhat-7.3" => "Red Hat Linux 7.3 Valhalla", "redhat-8.0" => "Red Hat Linux 8.0 Psyche", "redhat-9" => "Red Hat Linux 9.0 Shrike", + "rhel-5" => "Enterprise Linux 5", + "rhel-6" => "Enterprise Linux 6", "openna-1.0" => "OpenNA Linux 1.0 VSLC", "mandrake-7.1" => "Linux Mandrake 7.1", "mandrake-7.2" => "Linux Mandrake 7.2 Odyssey", @@ -123,6 +125,9 @@ $PLATFORM_INFO = { "fedora-3" => "Fedora Core 3 (Heidelberg)", "fedora-4" => "Fedora Core 4 (Stentz)", "fedora-5" => "Fedora Core 5 (Bordeaux)", + "fedora-15" => "Fedora 15 (LoveLock)", + "fedora-16" => "Fedora 16 (Verne)", + "fedora-17" => "Fedora 17 (Beefy Miracle)", "rpath" => "rPath Linux", "ark" => "Ark Linux", }; @@ -191,6 +196,27 @@ sub check_redhat return -1; } +sub check_rhel +{ + open RELEASE, "$gst_prefix/etc/redhat-release" or return -1; + while () + { + chomp; + if ( + (/^CentOS release (\d)([\d\.]+)\s+.*/) + or (/^Scientific Linux release (\d)([\d\.]+)\s+.*/) + or (/^Red Hat Enterprise Linux \w release (\d)([\d\.]+)\s+.*/) + ) + { + close RELEASE; + return "rhel-$1"; + } + } + close RELEASE; + return -1; +} + + sub check_openna { open OPENNA, "$gst_prefix/etc/openna-release" or return -1; @@ -343,7 +369,10 @@ sub check_fedora $ver = $_; chomp ($ver); - if ($ver =~ /^Fedora Core release (\S+)/) + if ( + ($ver =~ /^Fedora Core release (\S+)/) + or ($ver =~ /^Fedora release (\S+)/) + ) { close FEDORA; return "fedora-$1"; @@ -584,7 +613,7 @@ sub gst_platform_guess my %check = ( # Red Hat check must run after Vine, Mandrake and Fedora, and Mandrake after BlackPanther "Linux" => [ \&check_lsb, \&check_debian, \&check_caldera, \&check_suse, \&check_blackpanther, \&check_vine, - \&check_fedora, \&check_mandrake, \&check_mandriva, \&check_conectiva, \&check_linuxppc, \&check_redhat, \&check_openna, + \&check_fedora, \&check_mandrake, \&check_mandriva, \&check_conectiva, \&check_linuxppc, \&check_rhel, \&check_redhat, \&check_openna, \&check_turbolinux, \&check_slackware, \&check_vlos, \&check_gentoo, \&check_pld, \&check_rpath, \&check_archlinux, \&check_ark ], "FreeBSD" => [ \&check_freebsd ], "SunOS" => [ \&check_solaris ] -- cgit v1.2.1