`uname -m` on AIX is not standard -- even between machines of the same
model
here's a patch to make VSYSNAME.machine reflect `uname -p` on AIX
("powerpc")
which more accurately reflects the architecture.

(this is adapted  from IBM's own patches to GNU coreutils's uname: 
 
ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/PATCHES/coreutils
-5.2.1-aix-uname.patch )

I know this corrects 'cfagent' ... not sure about others, 
but thought it was worth sharing  ... (appologies if it turns out to be
premature/incomplete)

Regards,
David


Before patch:
---------------------------------
Operating System Type is aix
Operating System Release is 5.2
Architecture = 0004ecb6d700
 .
 .
Additional hard class defined as: 32_bit
Additional hard class defined as: aix_5_2
Additional hard class defined as: aix_0004ecb6d700
Additional hard class defined as: aix_0004ecb6d700_5_2
Additional hard class defined as: aix_0004ecb6d700_5_2_5

After patch:
---------------------------------
Operating System Type is aix
Operating System Release is 5.2
Architecture = powerpc
 .
 .
Additional hard class defined as: 32_bit
Additional hard class defined as: aix_5_2
Additional hard class defined as: aix_powerpc
Additional hard class defined as: aix_powerpc_5_2
Additional hard class defined as: aix_powerpc_5_2_5


The Patch
------------------------------------------------------------------
*** src/nameinfo.c.orig     Mon Apr 28 03:32:08 2008
--- src/nameinfo.c  Sat Jan 31 19:48:16 2009
***************
*** 36,41 ****
--- 36,44 ----
  #ifdef IRIX
  #include <sys/syssgi.h>
  #endif
+ #ifdef _AIX
+ #include <sys/systemcfg.h>
+ #endif

  #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
  # ifdef _SIZEOF_ADDR_IFREQ
***************
*** 96,101 ****
--- 99,119 ----
     {
     *sp = ToLower(*sp);
     }
+
+ #ifdef _AIX
+ switch (_system_configuration.architecture)
+    {
+    case POWER_RS:
+       strncpy(VSYSNAME.machine, "power", _SYS_NMLN);
+       break;
+    case POWER_PC:
+       strncpy(VSYSNAME.machine, "powerpc", _SYS_NMLN);
+       break;
+    case IA64:
+       strncpy(VSYSNAME.machine, "ia64", _SYS_NMLN);
+       break;
+    }
+ #endif

  for (i = 0; CLASSATTRIBUTES[i][0] != '\0'; i++)
     {

------------------------------------------------------------------------------
This message may contain confidential or proprietary information intended only 
for the use of the addressee(s) named above or may contain
information that is legally privileged. If you are not the intended addressee, 
or the person responsible for delivering it to the intended
addressee, you are hereby notified that reading, disseminating, distributing or 
copying this message is strictly prohibited.
If you have received this message by mistake, please immediately notify us by 
replying to the message and delete the original message
and any copies immediately thereafter.


==============================================================================


_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to