How to create a uname wrapper to return a i686 instead of x86_64


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » System Level

How to create a uname wrapper to return a i686 instead of x86_64Last Modified: May 28, 2011, 2:14 pm
If you're running a 32-bit vps on a 64-bit master OS, then the "uname -m" may return a 64-bit result even though you're running a 32-bit system.  You can create a wrapper for uname to return the value you want:

cd /bin
mv uname uname.orig
nano uname

in the uname wrapper script, enter the code:

#!/bin/sh

if [ $# -eq 1 ] && [ "$1" = "-m" ]; then
            echo "i686";
            exit 0;
fi

/bin/uname.orig $@
exit $?

then type

chmod 755 uname
./uname -m
./uname -r

to chmod the script to make it executable, and to test the output.

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST