Re: can one rely on uname -i results?

2013-05-26 Thread Slavko
Dňa 25.05.2013 20:34 Doug  wrote / napísal(a):
>> Small example from my machine – Debian testing:
>>
>> slavko@bonifac:~$ uname -i
>> unknown
>> slavko@bonifac:~$ uname -m
>> x86_64
>>
> I don't get those results. Here are my results, including the kernel.
> 
> Linux linux1.localdomain 3.2.18-pclos2.pae.bfs #1 SMP PREEMPT Thu May 24
> 05:33:57 CEST 2012 i686 i686 i386 GNU/Linux
> [doug@linux1 ~]$ uname -i
> i386
> [doug@linux1 ~]$ uname -m
> i686
> 
> IOW, I'm running a 32-bit kernel on a 64-bit processor.
> Perhaps uname is set up differently in Debian? Should it be?

I am using amd64 kernel from Jessie. Someone described already, that -i
option returns info from kernel (if it provides it). It seems, that the
i386 kernel provides it, but the amd64 kernel doesn't. You can see in
other responses, that i am not only one :-)

I want only to demonstrate, that the -i option is not reliable in all
cases/systems.

regards

-- 
Slavko
http://slavino.sk



signature.asc
Description: OpenPGP digital signature


Re: can one rely on uname -i results?

2013-05-25 Thread Vladimir Budnev
Wow! Thanks everyone for answers. Its clear for me now.


2013/5/25 Vladimir Budnev 

> Goodday everyone!
>
> While trying some opensource utility I'v found that one of launching
> scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
> futher processing.
>
> But on my desktop it gives "unknown", so script does not work as expected.
> And at the same time:
> steve@dbsteve: /home/coin %
> % uname -a
> Linux dbsteve 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux
>
> Does it mean one cant rely on uname -i results or my distro (debian
> testing) behaves strange?
>
> PS
> % cat /etc/debian_version
> 7.0
>
>
>
>
>


Re: can one rely on uname -i results?

2013-05-25 Thread Doug

On 05/25/2013 07:55 AM, Slavko wrote:

Dňa 25.05.2013 12:34 Claudius Hubig  wrote / napísal(a):

Dear Vladimir,

Vladimir Budnev wrote:

While trying some opensource utility I'v found that one of launching
scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
futher processing.

-i is for the ‘hardware platform’. You likely rather want to use
‘-m’, which gives the ‘machine hardware name’. While the naming
appears a little strange, the former is probably intended to give the
actual hardware architecture, whereas the latter gives the kernel
architecture.

An i386 kernel running on an amd64 CPU would hence give out ‘i386’ (or
something like that) when queried via -m, whereas ‘-i’, if available,
would have to say ‘x86_64’ – which doesn’t help at all, since the
kernel couldn’t run such code.

Small example from my machine – Debian testing:

slavko@bonifac:~$ uname -i
unknown

but:

slavko@bonifac:~$ uname -m
x86_64

regards


I don't get those results. Here are my results, including the kernel.

Linux linux1.localdomain 3.2.18-pclos2.pae.bfs #1 SMP PREEMPT Thu May 24 
05:33:57 CEST 2012 i686 i686 i386 GNU/Linux

[doug@linux1 ~]$ uname -i
i386
[doug@linux1 ~]$ uname -m
i686

IOW, I'm running a 32-bit kernel on a 64-bit processor.
Perhaps uname is set up differently in Debian? Should it be?

--doug


--
Blessed are the peacemakers..for they shall be shot at from both sides. 
--A.M.Greeley


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/51a1042e.1020...@optonline.net



Re: can one rely on uname -i results?

2013-05-25 Thread sp113438
On Sat, 25 May 2013 13:55:25 +0200
Slavko  wrote:

On my Wheezy system:

# dpkg --print-architecture
amd64

# uname -m
x86_64

# uname -i
unknown


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130525192734.2189083f@fx4100



Re: can one rely on uname -i results?

2013-05-25 Thread Andrei POPESCU
On Sb, 25 mai 13, 14:21:29, Vladimir Budnev wrote:
> Goodday everyone!
> 
> While trying some opensource utility I'v found that one of launching
> scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
> futher processing.
> 
> But on my desktop it gives "unknown", so script does not work as expected.
> And at the same time:
> steve@dbsteve: /home/coin %
> % uname -a
> Linux dbsteve 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux
> 
> Does it mean one cant rely on uname -i results or my distro (debian
> testing) behaves strange?

Depending on what you need the information for you might want to 
consider using 'dpkg --print-architecture' instead:

amp@sid:~$ uname -i
unknown
amp@sid:~$ uname -m
x86_64
amp@sid:~$ dpkg --print-architecture
i386
amp@sid:~$ uname -a
Linux sid 3.8-2-amd64 #1 SMP Debian 3.8.13-1 x86_64 GNU/Linux

As you can see, I'm running the -amd64 kernel with i386 userland. If the
script is trying to guess whether to launch a 32 bit or a 64 bit binary, 
'uname -i' would be useless and 'uname -m' would be wrong.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: can one rely on uname -i results?

2013-05-25 Thread Slavko
Dňa 25.05.2013 12:34 Claudius Hubig  wrote / napísal(a):
> Dear Vladimir,
> 
> Vladimir Budnev wrote:
>> While trying some opensource utility I'v found that one of launching
>> scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
>> futher processing.
> 
> -i is for the ‘hardware platform’. You likely rather want to use
> ‘-m’, which gives the ‘machine hardware name’. While the naming
> appears a little strange, the former is probably intended to give the
> actual hardware architecture, whereas the latter gives the kernel
> architecture.
> 
> An i386 kernel running on an amd64 CPU would hence give out ‘i386’ (or
> something like that) when queried via -m, whereas ‘-i’, if available,
> would have to say ‘x86_64’ – which doesn’t help at all, since the
> kernel couldn’t run such code.

Small example from my machine – Debian testing:

slavko@bonifac:~$ uname -i
unknown

but:

slavko@bonifac:~$ uname -m
x86_64

regards

-- 
Slavko
http://slavino.sk



signature.asc
Description: OpenPGP digital signature


Re: can one rely on uname -i results?

2013-05-25 Thread Claudius Hubig
Dear Vladimir,

Vladimir Budnev wrote:
> While trying some opensource utility I'v found that one of launching
> scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
> futher processing.

-i is for the ‘hardware platform’. You likely rather want to use
‘-m’, which gives the ‘machine hardware name’. While the naming
appears a little strange, the former is probably intended to give the
actual hardware architecture, whereas the latter gives the kernel
architecture.

An i386 kernel running on an amd64 CPU would hence give out ‘i386’ (or
something like that) when queried via -m, whereas ‘-i’, if available,
would have to say ‘x86_64’ – which doesn’t help at all, since the
kernel couldn’t run such code.

Best,

Claudius
-- 
Please don’t CC me.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130525113456.7b00e...@ares.home.chubig.net



Re: can one rely on uname -i results?

2013-05-25 Thread Brian
On Sat 25 May 2013 at 14:21:29 +0400, Vladimir Budnev wrote:

> While trying some opensource utility I'v found that one of launching
> scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
> futher processing.
> 
> But on my desktop it gives "unknown", so script does not work as expected.
> And at the same time:
> steve@dbsteve: /home/coin %
> % uname -a
> Linux dbsteve 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux
> 
> Does it mean one cant rely on uname -i results or my distro (debian
> testing) behaves strange?
> 
> PS
> % cat /etc/debian_version
> 7.0

>From the info page for uname:

 '-i'
 '--hardware-platform'
 Print the hardware platform name (sometimes called the hardware
 implementation).  Print 'unknown' if the kernel does not make this
 information easily available, as is the case with Linux kernels.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130525104613.GG3596@desktop



can one rely on uname -i results?

2013-05-25 Thread Vladimir Budnev
Goodday everyone!

While trying some opensource utility I'v found that one of launching
scripts uses uname -i | grep x86_64 to check for 64/32 bit platform and
futher processing.

But on my desktop it gives "unknown", so script does not work as expected.
And at the same time:
steve@dbsteve: /home/coin %
% uname -a
Linux dbsteve 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux

Does it mean one cant rely on uname -i results or my distro (debian
testing) behaves strange?

PS
% cat /etc/debian_version
7.0