On Monday 08 August 2005 15:16, Phill Wombat wrote: > Hi List, > > Everyone is going to have this:
> yum proceeds to download the entire FC4/x86_64 distro! even though the > UML is i386. > uname -a > Linux uml-test.localdomain 2.6.12-bb10-skas0 #1 Sun Aug 7 00:11:09 EST > 2005 x86_64 x86_64 x86_64 GNU/Linux > All the x86_64 strings make python think the architecture is x86_64. > I'm guessing this really needs to be the subject of a patch to give it > the real/true/virtual? architecture of the UML. You know what I mean.... > BTW the UML is an i386 machine but the host is x86_64 (did I already > mention that?). Yeah, thanks for informing us. That can be also fixed by prefixing the UML command with "setarch", "linux32" or "ia32" "i386" commands (I don't remember which one, but there is a command such that you run: i386 uname -m and the "i386" command fakes uname into thinking that it's running on a 32 bit system; IIRC on Fedora the command is setarch and i386 is an alias). However, the attached patch should fix things, anyway. At least it compiles. Bye -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]> --- linux-2.6.git-paolo/arch/um/kernel/user_util.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) diff -puN arch/um/kernel/user_util.c~uml-fix-uname arch/um/kernel/user_util.c --- linux-2.6.git/arch/um/kernel/user_util.c~uml-fix-uname 2005-08-12 17:48:29.000000000 +0200 +++ linux-2.6.git-paolo/arch/um/kernel/user_util.c 2005-08-12 17:55:19.000000000 +0200 @@ -132,7 +132,12 @@ void setup_machinename(char *machine_out struct utsname host; uname(&host); - strcpy(machine_out, host.machine); + /* XXX: crude detection of 32-bit binary. */ + if (sizeof(long) == 4 && !strcmp(host.machine, "x86_64")) { + strcpy(machine_out, "i686"); + } else { + strcpy(machine_out, host.machine); + } } char host_info[(_UTSNAME_LENGTH + 1) * 4 + _UTSNAME_NODENAME_LENGTH + 1]; _