* setarch cannot set all listed architectures
@ 2014-12-24 16:35 Benno Schulenberg
2014-12-31 8:30 ` Mike Frysinger
0 siblings, 1 reply; 6+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:35 UTC (permalink / raw)
To: Util-Linux
Hi,
The man page of setarch says for the option --list: "List the architectures
that can be set." However...
$ ./setarch --list
uname26
linux32
linux64
i386
i486
i586
i686
athlon
x86_64
ia64
$ ./setarch x86_64 uname -m
setarch: x86_64: Unrecognized architecture
Huh?
$ ./setarch ia64 uname -m
setarch: ia64: Unrecognized architecture
$ ./setarch linux64 uname -m
i686
$ ./setarch --version
setarch from util-linux 2.25.548-fe2c9
Maybe --list should not be listing x86_64 and ia64 on this machine?
Or maybe the error message in these cases should say "Cannot set
the requested architecture" instead?
Benno
--
http://www.fastmail.com - Access your email from home and the web
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: setarch cannot set all listed architectures
2014-12-24 16:35 setarch cannot set all listed architectures Benno Schulenberg
@ 2014-12-31 8:30 ` Mike Frysinger
2014-12-31 9:15 ` Benno Schulenberg
0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2014-12-31 8:30 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Util-Linux
[-- Attachment #1: Type: text/plain, Size: 883 bytes --]
On 24 Dec 2014 17:35, Benno Schulenberg wrote:
> The man page of setarch says for the option --list: "List the architectures
> that can be set." However...
>
> $ ./setarch --list
> uname26
> linux32
> linux64
> i386
> i486
> i586
> i686
> athlon
> x86_64
> ia64
>
> $ ./setarch x86_64 uname -m
> setarch: x86_64: Unrecognized architecture
>
> Huh?
>
> $ ./setarch ia64 uname -m
> setarch: ia64: Unrecognized architecture
>
> $ ./setarch linux64 uname -m
> i686
>
> $ ./setarch --version
> setarch from util-linux 2.25.548-fe2c9
>
> Maybe --list should not be listing x86_64 and ia64 on this machine?
> Or maybe the error message in these cases should say "Cannot set
> the requested architecture" instead?
are you running a 32bit or 64bit kernel ? is your compiled setarch 32bit or
64bit ? i'm going to guess both are 32bit.
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: setarch cannot set all listed architectures
2014-12-31 8:30 ` Mike Frysinger
@ 2014-12-31 9:15 ` Benno Schulenberg
2014-12-31 9:23 ` Mike Frysinger
0 siblings, 1 reply; 6+ messages in thread
From: Benno Schulenberg @ 2014-12-31 9:15 UTC (permalink / raw)
To: Mike Frysinger; +Cc: Util-Linux
On Wed, Dec 31, 2014, at 09:30, Mike Frysinger wrote:
> On 24 Dec 2014 17:35, Benno Schulenberg wrote:
> > The man page of setarch says for the option --list: "List the architectures
> > that can be set." However...
> >
> > $ ./setarch --list
> > [...]
> > i686
> > athlon
> > x86_64
> > ia64
> >
> > $ ./setarch x86_64 uname -m
> > setarch: x86_64: Unrecognized architecture
> >
> > [...]
> >
> > Maybe --list should not be listing x86_64 and ia64 on this machine?
> > Or maybe the error message in these cases should say "Cannot set
> > the requested architecture" instead?
>
> are you running a 32bit or 64bit kernel ? is your compiled setarch 32bit or
> 64bit ? i'm going to guess both are 32bit.
You guessed correctly. :)
$ getconf LONG_BIT
32
$ grep " lm" /proc/cpuinfo || echo no
no
$ file ./setarch
./setarch: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x830fc9635dbe83defa4db7b0b5db241093d4c86d, not stripped
So... setarch --list shouldn't be mentioning x86_64 nor ia64 here?
Benno
--
http://www.fastmail.com - A no graphics, no pop-ups email service
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: setarch cannot set all listed architectures
2014-12-31 9:15 ` Benno Schulenberg
@ 2014-12-31 9:23 ` Mike Frysinger
2015-01-06 10:35 ` Karel Zak
0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2014-12-31 9:23 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Util-Linux
[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]
On 31 Dec 2014 10:15, Benno Schulenberg wrote:
> On Wed, Dec 31, 2014, at 09:30, Mike Frysinger wrote:
> > On 24 Dec 2014 17:35, Benno Schulenberg wrote:
> > > The man page of setarch says for the option --list: "List the architectures
> > > that can be set." However...
> > >
> > > $ ./setarch --list
> > > [...]
> > > i686
> > > athlon
> > > x86_64
> > > ia64
> > >
> > > $ ./setarch x86_64 uname -m
> > > setarch: x86_64: Unrecognized architecture
> > >
> > > [...]
> > >
> > > Maybe --list should not be listing x86_64 and ia64 on this machine?
> > > Or maybe the error message in these cases should say "Cannot set
> > > the requested architecture" instead?
> >
> > are you running a 32bit or 64bit kernel ? is your compiled setarch 32bit or
> > 64bit ? i'm going to guess both are 32bit.
>
> You guessed correctly. :)
>
> $ getconf LONG_BIT
> 32
>
> $ grep " lm" /proc/cpuinfo || echo no
> no
>
> $ file ./setarch
> ./setarch: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x830fc9635dbe83defa4db7b0b5db241093d4c86d, not stripped
>
> So... setarch --list shouldn't be mentioning x86_64 nor ia64 here?
maybe, but is it really worth the effort ?
if you took that exact 32bit binary and booted a 64bit kernel, i imagine it'd
work fine.
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: setarch cannot set all listed architectures
2014-12-31 9:23 ` Mike Frysinger
@ 2015-01-06 10:35 ` Karel Zak
2015-01-10 13:40 ` Benno Schulenberg
0 siblings, 1 reply; 6+ messages in thread
From: Karel Zak @ 2015-01-06 10:35 UTC (permalink / raw)
To: Benno Schulenberg, Util-Linux
On Wed, Dec 31, 2014 at 04:23:54AM -0500, Mike Frysinger wrote:
> On 31 Dec 2014 10:15, Benno Schulenberg wrote:
> > $ file ./setarch
> > ./setarch: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x830fc9635dbe83defa4db7b0b5db241093d4c86d, not stripped
> >
> > So... setarch --list shouldn't be mentioning x86_64 nor ia64 here?
>
> maybe, but is it really worth the effort ?
>
> if you took that exact 32bit binary and booted a 64bit kernel, i imagine it'd
> work fine.
Exactly. I think it would be enough to add a note into man page that
things are not perfect and supported features depends on kernel.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: setarch cannot set all listed architectures
2015-01-06 10:35 ` Karel Zak
@ 2015-01-10 13:40 ` Benno Schulenberg
0 siblings, 0 replies; 6+ messages in thread
From: Benno Schulenberg @ 2015-01-10 13:40 UTC (permalink / raw)
To: Karel Zak; +Cc: Util-Linux
On Tue, Jan 6, 2015, at 11:35, Karel Zak wrote:
> I think it would be enough to add a note into man page that
> things are not perfect and supported features depends on kernel.
Okay. Patch coming up.
I think it would also be nice if setarch differentiated between not
recognizing any architecture in the provided string and not being
able to set the architecture to the recognized one. On my machine:
$ ./setarch sometypo uname -m
setarch: sometypo: Unrecognized architecture
$ ./setarch ia64 uname -m
setarch: Kernel cannot set architecture to ia64
This change is included in the upcoming patches, but I have no
idea whether this is correct.
Another thing:
$ ./setarch -BRF --help | tail -1
For more details see setarch(8).
$ ./setarch -BRF --version
setarch from util-linux 2.25.634-8501-dirty
$ ./setarch -BRF --list
./setarch: unrecognized option '--list'
setarch: Try `setarch --help' for more information.
Nowhere does it say that --list cannot be combined with other
options. Instead of adding such a remark, upcoming patch makes
it be accepted in combinations, just like --help and --version.
By the way, in setarch.c there are two occurrences of:
if (argc < 1)
show_usage(_("Not enough arguments"));
Isn't the first one superfluous? I cannot trigger it.
Benno
--
http://www.fastmail.com - mmm... Fastmail...
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-01-10 13:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 16:35 setarch cannot set all listed architectures Benno Schulenberg
2014-12-31 8:30 ` Mike Frysinger
2014-12-31 9:15 ` Benno Schulenberg
2014-12-31 9:23 ` Mike Frysinger
2015-01-06 10:35 ` Karel Zak
2015-01-10 13:40 ` Benno Schulenberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).