Check-in Number:
|
3659 | |
Date: |
2003-Oct-31 21:27:48 (local)
2003-Oct-31 20:27:48 (UTC) |
User: | rse |
Branch: | |
Comment: |
more correct IBM AIX platform information determination (not tried on a real AIX box, but assembled together from various information pieces found on the net) |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/platform/platform.sh 1.16 -> 1.17
--- platform.sh 2003/10/31 20:01:18 1.16
+++ platform.sh 2003/10/31 20:27:48 1.17
@@ -576,12 +576,27 @@
# IBM AIX
*:AIX:* )
- AT="${UNAME_MACHINE}"
+ cpu_arch=rs6000
+ if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
+ cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then
+ cpu_arch=powerpc
+ fi
+ fi
+ if [ -x /usr/bin/oslevel ]; then
+ os_level=`/usr/bin/oslevel`
+ else
+ os_level="`uname -r`.`uname -v`"
+ fi
+ os_level=`echo "${os_level}" |\
+ sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \
+ -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'`
+ AT="${cpu_arch}"
AP="${AT}"
AC="${AP}"
- ST="[IBM ]AIX ${UNAME_RELEASE}"
+ ST="[IBM ]AIX ${os_level}"
SP="${ST}"
- case "${UNAME_RELEASE}" in
+ case "${os_level}" in
[12]* ) SC="SVR2" ;;
* ) SC="SVR4" ;;
esac
|
|