uname in the latest coreutils is broken for at least ppc and hppa. The cause of this b0rkage is 003_all_coreutils-gentoo-uname.patch. This patch does not contains code for hppa and the ppc section of this patch is broken. On ppc "uname -p" returns "0" which is the processor number first readed in /proc/cpuinfo. And "uname -i" returns the cpu type which is wrong. The patch I will attach in a few correct the ppc behaviour and add the correct hppa code. It should be applied after the actual patches are applied. This patch was tested succefully on both g3, g4, hppa1.1 and hppa2.0.
Created attachment 22486 [details, diff] Correct ppc behaviour of uname and add hppa code.
I should also add that looking at the code reveal that the 003_all_coreutils-gentoo-uname.patch might be broken for others arch. In particular, alpha boxes have a broken uname -i which return nothing.
This had to be fixed for mips once. The patch instructs uname to grab data from /proc/cpuinfo, and for mips, it was grabbing the "processor" field, which also returned 0. Rather than apply this patch after the first, might be better to edit the existing patch (which was done for mips. Any alpha people got info on what uname -i should be returning?
#if defined(__mips__) "cpu model", "system type" #endif That's the code for mips. I checked with tuxus and it seemed to return the right output. Kumba, can you check this again plz ?
That is correct for mips. It used to be "processor, system type" for mips, and it had to be changed to cpu model instead.
Created attachment 22717 [details, diff] Fix uname for hppa, ppc and alpha I've check with alpha and sparc ppl and only alpha needed a fix. sparc is correct and others arch should be too.
fixed in portage. Thanks Guy :)
This patch for all the officially supported architectures leaves uname segfaulting on -a/-i/-p when compiled on anything else - not good.
Kolbj
Kolbjørn, could you explain please what you mean?
yeah, you cant sit there and say something crashes Kolbj
yeah, you cant sit there and say something crashes Kolbjørn when you dont provide any information uname -a/i/p works fine on my x86/hppa/ppc/arm
Line 138-196 of uname.c The '*sdata[] = {}' part does not contain any escape for non listed platforms, gived that USE_PROCINFO is defined. For this means that uname segfaults on m68k.
ok, i didnt realize that the procinfo support isnt from upstream in the first place ... i'll update the code so it'll work on any arch (and add some more code for ARM :D)
coreutils-5.2.1 has this fixed ... i integrated the s390 patch (dont know why they didnt :P), added a case for arm, and added a default case for other architectures ... coreutils-5.2.1-gentoo-0.3.tar.bz2 has these changes ... no rev bump because installed base shouldnt be any different