uname -p on ubuntu 9.04 is broken.

23 views
Skip to first unread message

ron minnich

unread,
Jul 16, 2009, 1:32:48 AM7/16/09
to plan9p...@googlegroups.com
not sure of the source of this.

rminnich@xcpu2:~/src/plan9/plan9port$ uname -a
Linux xcpu2 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 22:12:12 UTC
2009 x86_64 GNU/Linux
rminnich@xcpu2:~/src/plan9/plan9port$ uname -p
unknown
rminnich@xcpu2:~/src/plan9/plan9port$

This breaks building p9p. I'm kind of overwhelmed that this of all
things does not work.

rminnich@xcpu2:~/src/plan9/plan9port$ cat /etc/issue
Ubuntu 9.04 \n \l

Anyway ... no time to look just now, thought you ought to know. strace
did not reveal anything of value. Sorry. Will try to get something
useful tomorrow.

ron

ron minnich

unread,
Jul 16, 2009, 1:53:31 AM7/16/09
to plan9p...@googlegroups.com
Turns out it is not broken ... you're not supposed to use it (!).

See: https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/111863

Do we need the first para below in the fortune file?

ron
Thank you for your bug report.

This behavior is according to the documentation. Under the
descriptions for both "-i" and "-p", it states, "Print `unknown' if
the kernel does not make this information easily available, as is the
case with Linux kernels."

Most of the values for options given to the uname command come from a
call to uname(). The "-i" and "-p" options, though, are not defined in
POSIX (and so aren't portable). Some systems, especially BSD, provide
additional, separate information for these concepts of "hardware
architecture" or "processor type", and print these values obtained
from a special system call, either sysinfo() or sysctl(). Linux,
however, does not offer the BSD-style sysinfo() (it has an entirely
different system call named sysinfo()); and it does not offer a value
for the HW_MODEL or HW_MACHINE_ARCH in sysctl().

So, these options are extensions, provided to take advantage of some
more-or-less BSD-specific features. Rather than just give an error
when these options are used on OSses that don't support them, as they
could have done, they opted to have them print "unknown" instead.

The "-m" option, on the other hand, is extremely portable, and may be
depended upon to give reliable results.

Benjamin Huntsman

unread,
Jul 16, 2009, 1:56:35 AM7/16/09
to plan9p...@googlegroups.com
>not sure of the source of this.

That'd be my fault. I added a few changes to begin supporting AIX. Since 'uname -m' on AIX returns the machine serial number, not the processor type, i changed some of the scripts to use 'uname -p' whereas they had used 'uname -m' before. This didn't break my CentOS box, whose 'uname -p' still yields "i686". You'll find the change in mkhdr, which is probably what's causing you trouble. Since adding a transform for "unknown" to "i386" is probably unreasonable, perhaps mkhdr just needs to get a bit more complicated... For now, you could just change it back in $PLAN9/src/mkhdr to use 'uname -m' and it'll build like normal... you may also need to fix it in $PLAN9/dist/buildmk.

In mkhdr, I need OBJTYPE to be "power" if uname="AIX", else run the stuff that's in there now but with "uname -m"...
Can you give me a suggestion on how to accomplish that?

Thanks, and sorry for the inconvenience!

-Ben

winmail.dat

Russ Cox

unread,
Jul 16, 2009, 3:30:16 AM7/16/09
to plan9p...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages