Installing on 32bit distro with 64bit kernel breaks packages install

The GPL installer check the kernel with "uname -m" to see what architecture it is running under. This can mean the installer fails during package install if the server is running a 64bit kernel on a 32bit install. I recomend using "getconf LONG_BIT" to establish the bittedness of the system instead.

I'm not sure if a fall back is needed for some wierd distros. Perhaps this patch will be useful to get some discussion going.

:~# diff -p install.sh install.new
*** install.sh  Tue May  5 04:45:41 2015
--- install.new Wed Jan 20 04:13:35 2016
*************** VER=1.1.2
*** 90,98 ****
  echo "$SERIAL" | grep "[^a-z^A-Z^0-9]" && echo "Serial number $SERIAL contains invalid characters." && exit
  echo "$KEY" | grep "[^a-z^A-Z^0-9]" && echo "License $KEY contains invalid characters." && exit
 
! arch=`uname -m`
! if [ "$arch" = "i686" ]; then
        arch=i386
  fi
  if [ "$SERIAL" = "GPL" ]; then
        LOGIN=""
--- 90,103 ----
  echo "$SERIAL" | grep "[^a-z^A-Z^0-9]" && echo "Serial number $SERIAL contains invalid characters." && exit
  echo "$KEY" | grep "[^a-z^A-Z^0-9]" && echo "License $KEY contains invalid characters." && exit
 
! arch=$(getconf LONG_BIT)
! if [ "${arch}" = "32" ]; then
        arch=i386
+ elif [ "${arch}" = "64" ]; then
+       arch=x86_64
+ else
+       echo "Unsupported Architecture, seen \"${arch}\""
+         exit 1
  fi
  if [ "$SERIAL" = "GPL" ]; then
        LOGIN=""
Status: 
Active

Comments

Howdy -- thanks for letting us know!

After making that change, does the install script work properly on your server?

I'm running further tests at the moment. It works fine for 64bit debian jessie. I'll be testing 32bit ubuntu 1404 next. Let me know what kind of logs or other info you would like to see and I'll include those.

Works for me on 32bit installs, I've tested a couple. The below patch is closer to the original flow, includes fallback to uname if getconf is missing (unlikely) for some reason. An alternate to the if clause might be to use a case statement which could be more compact if there are plans to add support for more values later on. Let me know if you want a patch for that instead.

~# diff -u install.sh install.new
--- install.sh  2015-05-05 04:45:41.000000000 +0000
+++ install.new 2016-01-20 21:16:58.225515988 +0000
@@ -90,10 +90,17 @@
 echo "$SERIAL" | grep "[^a-z^A-Z^0-9]" && echo "Serial number $SERIAL contains invalid characters." && exit
 echo "$KEY" | grep "[^a-z^A-Z^0-9]" && echo "License $KEY contains invalid characters." && exit
 
-arch=`uname -m`
-if [ "$arch" = "i686" ]; then
+arch=$(getconf LONG_BIT)
+[ ! -n "${arch}" ] && arch=$(uname -m)
+if [ "$arch" = "32" ]; then
        arch=i386
+elif [ "$arch" = "i686" ]; then
+        arch=i386
+elif [ "$arch" = "64" ]; then
+        arch=x86_64
 fi
+echo "Installing for architecture "\${arch}\""
+
 if [ "$SERIAL" = "GPL" ]; then
        LOGIN=""
        PRODUCT="GPL
Assigned: Unassigned »

Joe, do you think this change would be good to include in the next installer release?