Patchwork UBUNTU: check for PAE on x86 systems only

login
register
mail settings
Submitter Paolo Pisati
Date May 16, 2012, 2:17 p.m.
Message ID <1337177855-10684-2-git-send-email-paolo.pisati@canonical.com>
Download mbox | patch
Permalink /patch/159678/
State New
Headers show

Comments

Paolo Pisati - May 16, 2012, 2:17 p.m.
And while here, use STDERR for printing.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 debian/control-scripts/preinst |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
Tim Gardner - May 16, 2012, 2:34 p.m.

Patch

diff --git a/debian/control-scripts/preinst b/debian/control-scripts/preinst
index 32b4fc2..9723776 100644
--- a/debian/control-scripts/preinst
+++ b/debian/control-scripts/preinst
@@ -90,10 +90,13 @@  die "Pre inst Internal error. Aborting." unless $version;
 exit 0 if $ARGV[0] =~ /abort-upgrade/;
 exit 1 unless $ARGV[0] =~ /(install|upgrade)/;
 
-system ("grep -q ' pae ' /proc/cpuinfo");
-if ($?) {
-        print "This kernel does not support a non-PAE CPU.\n";
-        exit 1;
+$arch = `uname -i`;
+if ($arch =~ m/86/) {
+	system ("grep -q ' pae ' /proc/cpuinfo");
+	if ($?) {
+			print STDERR "This kernel does not support a non-PAE CPU.\n";
+			exit 1;
+	}
 }
 
 # remove multiple leading slashes; make sure there is at least one.