FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 11-24-2007, 03:57 AM
 
Default cluster configure

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: fabbione@sourceware.org 2007-11-24 04:57:31

Modified files:
. : configure

Log message:
Switch configure to use perl warnings and fix them up.

Add kernel_version version check subroutine.

Set minimal kernel version requirement to 2.6.23.

Many thanks should go to Marian Marinov <mm at yuhu.biz> for the original
patch and contribution.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/configure.diff?cvsroot=cluster&r1=1.37&r2=1.38

--- cluster/configure 2007/10/26 19:18:55 1.37
+++ cluster/configure 2007/11/24 04:57:31 1.38
@@ -13,16 +13,22 @@
################################################## #############################
################################################## #############################

+use warnings;
use Getopt::Long;
use POSIX qw(uname);

+
print "
Configuring Makefiles for your system...
";

# Set a bunch of variables

-$ret = 0;
+my $ret = 0;
+
+# this should be only the major version without the extra version
+# eg. only the first 3 digits
+my $required_kernelversion = '2.6.23';

-%options = (
+my %options = (
help => $help,
cc => $cc,
debug => $debug,
@@ -80,7 +86,7 @@
without_rgmanager => $without_rgmanager,
);

-$err = &GetOptions (\%options,
+my $err = &GetOptions (\%options,
'help',
'cc=s',
'debug',
@@ -202,6 +208,67 @@
exit $ret;
}

+sub kernel_version {
+ my $autoconf_path = shift;
+ my $required_version = shift;
+ my $build_version = 0;
+ my $build_patchlevel = 0;
+ my $build_sublevel = 0;
+
+ print "
Checking kernel:
";
+
+ # add autoconf to the path
+ $autoconf_path .= '/include/linux/autoconf.h';
+ my @version = split /./, $required_version;
+ my $current_version = 0;
+ if ( -f $autoconf_path ) {
+ # open the autoconf.h to feth VERSION, PATCHLEVEL and SUBLEVEL, if needed I can add EXTRAVERSION too
+ open AUTOCONF, '<', $autoconf_path;
+ while (<AUTOCONF>) {
+ if ($_ =~ /CONFIG_KERNELVERSION/) {
+ $current_version = $_;
+ # we don't need to check any thing else in this file so we are stopping the read
+ last;
+ }
+ }
+ close AUTOCONF;
+ # leaving only the numbers from the lines
+ # this is faster then split and doesn't alocate useless arrays
+ $current_version =~ s/.*"(.*)"
/$1/;
+ # parse the kernel version into the variables
+ if ($current_version =~ /-/) {
+ my @line = split /-/, $current_version;
+ my @ver = split /./, $line[0];
+ $build_version = $ver[0];
+ $build_patchlevel = $ver[1];
+ $build_sublevel = $ver[2];
+ } else {
+ my @kernel = split /./, $current_version;
+ $build_version = $kernel[0];
+ $build_patchlevel = $kernel[1];
+ $build_sublevel = $kernel[2];
+ }
+ # checking VERSION, PATCHLEVEL and SUBLEVEL for the supplied kernel
+ # if needed I can add also EXTRAVERSION to the check
+ if ($build_version >= $version[0] &&
+ $build_patchlevel >= $version[1] &&
+ $build_sublevel >= $version[2]) {
+ print " Current kernel version appears to be OK
";
+ return 1;
+ } else {
+ print " Current kernel version: ",$current_version,"
Minimum kernel version: ",$required_version,"
";
+ print " FAILED!
";
+ return 0;
+ }
+ } else {
+ print " Unable to find ($autoconf_path)!
";
+ print " Make sure that:
- the above path is correct
";
+ print " - your kernel is properly configured and prepared.
";
+ print " - kernel_build and kernel_src options to configure are set properly.
";
+ return 0;
+ }
+}
+
$pwd = `pwd`;
chomp($pwd);

@@ -245,6 +312,9 @@
$kernel_src=$kernel_build;
}
}
+if (!kernel_version($kernel_build,$required_kernelver sion)) {
+ exit 1;
+}
if (!$module_dir) {
$module_dir="/lib/modules/$un[2]/kernel";
}
@@ -374,10 +444,10 @@
if (!$without_rgmanager) {
$without_rgmanager="";
}
-if (not length $release_major) {
+if (defined($release_major) && not length $release_major) {
$release_major="";
}
-if (not length $release_minor) {
+if (defined($release_minor) && not length $release_minor) {
$release_minor="";
}

@@ -462,7 +532,7 @@
}

close IFILE;
-if ((not length $release_major) || (not length $release_minor)) {
+if ((not defined($release_major)) || (not defined($release_minor))) {
open IFILE, "<make/release.mk.input" or die "Can't redirect stdin";
while (<IFILE>) {
chomp;
 
Old 12-06-2007, 09:38 AM
 
Default cluster configure

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield@sourceware.org 2007-12-06 10:38:00

Modified files:
. : configure

Log message:
Add option to disable kernel_check.

From Soren Hansen:
"It's handy to be able to
disable the new kernel version check if we don't actually have the
kernel headers around, but know that the proper stuff is around when
it's needed."

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/configure.diff?cvsroot=cluster&r1=1.38&r2=1.39

--- cluster/configure 2007/11/24 04:57:31 1.38
+++ cluster/configure 2007/12/06 10:38:00 1.39
@@ -84,6 +84,7 @@
without_gfs2 => $without_gfs2,
without_gnbd => $without_gnbd,
without_rgmanager => $without_rgmanager,
+ disable_kernel_check => $disable_kernel_check,
);

my $err = &GetOptions (\%options,
@@ -139,7 +140,8 @@
'without_gfs',
'without_gfs2',
'without_gnbd',
- 'without_rgmanager');
+ 'without_rgmanager',
+ 'disable_kernel_check');

if(!$err) {
$ret = 1;
@@ -205,6 +207,7 @@
print "--without_gfs2 Disable gfs2 building (Default: enabled)
";
print "--without_gnbd Disable gnbd building (Default: enabled)
";
print "--without_rgmanager Disable rgmanager building (Default: enabled)
";
+ print "--disable_kernel_check Disable kernel version check (default: enabled)
";
exit $ret;
}

@@ -312,7 +315,7 @@
$kernel_src=$kernel_build;
}
}
-if (!kernel_version($kernel_build,$required_kernelver sion)) {
+if (not $disable_kernel_check and !kernel_version($kernel_build,$required_kernelvers ion)) {
exit 1;
}
if (!$module_dir) {
@@ -444,6 +447,9 @@
if (!$without_rgmanager) {
$without_rgmanager="";
}
+if (!$disable_kernel_check) {
+ $disable_kernel_check=0;
+}
if (defined($release_major) && not length $release_major) {
$release_major="";
}
 
Old 01-07-2008, 05:58 PM
 
Default cluster configure

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh@sourceware.org 2008-01-07 18:58:29

Modified files:
. : configure

Log message:
Figure out where slang is installed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/configure.diff?cvsroot=cluster&r1=1.46&r2=1.47

--- cluster/configure 2008/01/07 05:52:26 1.46
+++ cluster/configure 2008/01/07 18:58:29 1.47
@@ -430,6 +430,9 @@
}
if (!$slangincdir) {
$slangincdir="${incdir}";
+ if (! -f "$slangincdir/slang.h") {
+ $slangincdir="${incdir}/slang";
+ }
}
if (!$slanglibdir) {
$slanglibdir="${libdir}";
 

Thread Tools




All times are GMT. The time now is 08:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org