home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] what is the "uname" variation that shows a 32-bit install on 64-bit system?

  • Subject: Re: [OCLUG-Tech] what is the "uname" variation that shows a 32-bit install on 64-bit system?
  • From: "Peter Sjöberg" <lpaseen [ at ] gmail [ dot ] com>
  • Date: Mon, 09 May 2011 11:24:23 -0400

On 05/08/2011 11:41 PM, Bart Trojanowski wrote:
> 2011/5/9 Peter Sjöberg <lpaseen [ at ] gmail [ dot ] com>
>>
>> On 05/06/2011 02:49 PM, Bart Trojanowski wrote:
>>> On Fri, May 6, 2011 at 18:24, Richard Guy Briggs <rgb [ at ] tricolour [ dot ] net> wrote:
>>>
>>>> Not quite what you intended, but how about:
>>>>        file $(which uname)
>>>>
>>> I often do exactly this with '/bin/ls' to test the OS bitness.
>>>
>>> Another alternative is to use gcc -dumpmachine ... which is available on all
>>> systems that matter :-)
>> What am I missing?
> Not sure.
>
> Richard and I both thought that Rob was asking about the userland
> bitness, as opposed to the kernel bitness.  Uname is fine, as long as
> you assume the user isn't running a 64bit kernel and 32bit userland.
>
> Also, using uname cannot be trusted in some situations, say if you're
> building for a 32bit target in a chroot (and didn't run with linux32).
>
> This is something that should probably be part of LSB (lsb_release
> command), but isn't.
>
> -Bart

Original
>  is there an option with
> "uname" (or perhaps some other command or file) that identifies that a
> 32-bit version of some linux distro has been installed on a 64-bit
> system?
I guess the question then is what rob means with "system". I was
thinking system=computer system and I made the assumption that that if
you install any distro the kernel is included so if the kernel is 64bit
then most userland sw is probably 64bit also.
But if you want to know whatever some specific program is 64 or 32bit
"file" is the one to go with, and that will tell you half the story. If
the program is 32bit it might be because the system is 32bit, not
because you got wrong bitness installed.

Robert, Do you have your answer yet?
* to check a individual program: file /bin/ls
* to check the running kernel: uname -m
* to check the cpu:  grep "^flags.* lm " /proc/cpuinfo

/ps

Attachment: signature.asc
Description: OpenPGP digital signature