When the uname hack does not suffice

Nico R. n-roeser at gmx.net
Thu Aug 5 11:21:19 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Lingard wrote:

> zippo wrote:
> 
>> That would be time for a mgaic --build=i386-pc-linux-gnu
>> --host=i386-pc-linux-gnu
>> 
>> that should fool it, in every way, Uname -a still says athlon if i
>> remember.
> 
> To be precise:
> 
> Linux trent 2.6.7 #1 Sun Jun 27 16:24:54 BST 2004 i486 athlon-4 i386
> GNU/Linux

This one is easy to work around: use a special uname: as root, run the
following commands:

mv /bin/uname{,.orig} &&
cat > /bin/uname << "EOF" &&
#!/bin/sh
exec /bin/uname.orig "$@" | sed 's/athlon-4/i486/'
EOF
chmod 0755 /bin/uname


For another build system, you may have to replace "athlon-4" by the
respective processor name.

Or you may want to use the hardcore version of the script:

#!/bin/sh
PROCESSOR="`/bin/uname.orig -p`"
exec /bin/uname.orig "$@" | sed "s/$PROCESSOR/i486/"

Please note that this script will take a little longer to execute,
because it needs two calls to the original uname. It will also work
with an old, unpatched uname if that uname returns "unknown" for the
processor type (and for no fields before that in `uname -a`), but that
is true for all unames I have come across on my LFS machines.


Disclaimer: All scripts untested. ;-) But they look nice, don't they? I
might actually use them.
- -- 
Nico
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFBEnqkxI5uhYOGv4URAqD0AKDp886C85u0W1T/GqGs8tFtvo+PxwCdGFkC
BMdLO97M6HrnOA/SXilmvW0=
=yWlH
-----END PGP SIGNATURE-----



More information about the lfs-dev mailing list