-> >
-> >> I am curious about is there any way to change hostid
-> >>under Solaris 2.x except physical changing EPROM on the
-> >>system board?
-> >
-> > I am curious why you'd want to, other than stealing licensed software?
-> > ---
-> > Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109
-> >
-> I would like to do this on both 4.1.3 and 2.3 because we have backup
-> hardware for our server if it dies. We want to be able to reboot the
-> backup hardware so that it will be indistinguishable from the original
-> server in the event of failure. I do not believe that this is
-> stealing licensed software as it will only be used when the hardware
-> on which the software is licensed is physically dead.
I can help you with 4.1.3, but I haven't looked at 2.3 yet.
Run:
adb -w -k /vmunix /dev/mem
Now enter this and hit return twice:
_gethostid+4/i
You'll get this:
_gethostid+4: call _machineid
_gethostid+8: nop
The trick is to replace these eight bytes with machine code that will
load the hostid you want into %o0.
At gethostid+4, we want to use SETHI to set the top bits of %o0, and
at gethostid+8, we want to binary or in the low bits. Here's an
algorithm for coming up with the right values:
#define HIMASK 0x3FFFFF
#define LOWMASK 0x3ff
#define SETHI 0x11000000
#define OR 0x90122000
wordone = SETHI | ((newid>>10)&HIMASK);
wordtwo = OR | (newid&LOWMASK);
I don't remember how I came up with this, and I haven't had enough
coffee to try and figure it out again.
For an example, say we want to set the hostid to 0x12345678. Using
the above algorithm, wordone would be 0x11048D15 and wordtwo would be
0x90122278. Install these instructions with adb like this:
_gethostid+4/W0x11048D15
_gethostid+8/W0x90122278
The hostid function will now kick out 12345678. This change is made
in memory and will go away at the next reboot.
If anyone figures out how to do this same thing under 2.3, please send
it to me, as I doubt I will have a chance to work on it.
--
Jason C. Austin