#!/usr/bin/perl -w # # $Id: ase-check-prereq.pl,v 1.3 2004/12/07 14:59:13 mpeppler Exp $ use strict; my $VERSION = substr(q$Revision: 1.3 $, 10); my @version = qw(slackware-version redhat-release gentoo-release SuSE-release mandrake-release debian-version); my $min_glibc = '2.2.4'; my $min_kernel = '2.4.9'; my $min_shmmax = 67108864; my $fmt = "%-20.20s %-25s %s\n"; my @instructions; my $unsupported = 0; my $fail = 0; my $uname = get_uname(); my $processor = `uname -m`; chomp($uname); chomp($processor); print "\nASE installation pre-requisites checker for linux (version $VERSION)\n\n"; print "System: $uname\n\n"; if($processor =~ /i(\d+)/) { if($1 < 586) { print <-release" or something similar (Red Hat/Fedora uses /etc/redhat-release, for example). Please send me (Michael Peppler - mpeppler\@peppler.org) the name of this file and its contents so that I can update this little script. Thank you. EOF check_distro(); check_kernel(); check_glibc(); check_libstdc(); check_shmmax(); if($fail) { print <= 7.2 && $1 != 9) { return "UNSUPPORTED"; } elsif($1 == 9) { push(@instructions, "You are trying to install ASE on Red Hat 9. This requires the installation of a glibc patch. We strongly recommended upgrading to either Fedora Core or Red Hat Enterprise 3.x instead"); return "REQUIRES glibc PATCH (not recommended)"; } else { push(@instructions, "This version of Red Hat is too old to support ASE. Please upgrade to Red Hat Enterprise 3.x, or (for an 'unsupported' platform) to Fedora Core\n"); ++$fail; return "FAIL"; } } if($distro =~ /Red Hat Enterprise Linux .+ release ([\d\.]+)/) { return "OK"; } if($distro =~ /Fedora Core/ || $distro =~ /Gentoo/) { return "UNSUPPORTED"; } if($distro =~ /slack/i) { ++$fail; push(@instructions, "Slackware will not run ASE out of the box. It is highly recommended that you move to Red Hat Enterprise Linux, SuSE Enterprise, or, for an 'unsupported' platform to Fedora Core"); return "FAIL"; } if($distro =~ /SuSE/) { if($distro =~ /SLES-8/) { return "OK"; } else { return "UNSUPPORTED"; } } if($distro =~ /Mandrake/i) { return "UNSUPPORTED"; } if($distro =~ /debian/i) { return "UNSUPPORTED"; } return "UNKNOWN"; } sub compare_rev { my $min = shift; my $rev = shift; my(@min) = split(/\./, $min); my(@rev) = split(/\./, $rev); for(my $i = 0; $i < @min; ++$i) { local $^W = 0; if($rev[$i] > $min[$i]) { return 1; } } if($rev[$#min] == $min[$#min]) { return 1; } return 0; } sub get_uname { my $uname = ''; foreach (qw(-s -n -r -m)) { my $t = `uname $_`; chomp($t); $uname .= "$t "; } return $uname; }