| || |
Re: Change hostname, harder than anticipated
Everything found under /proc is part of a virtual file system; the easiest way to change these is an init.d script so that it applies on boot, that's what the xda post is suggesting.
Originally Posted by ohgoditsgoingtobreak
Write a script in notepad++ or gedit or similar (NOT notepad), something along the following lines
where CellPhoneHostName is the name you want applied.
echo CellPhoneHostName > /proc/sys/kernel/hostname
save it with no extension something like: 88hostname
the number in the name refers to the order at which the scripts are executed on boot up, 1 being first, 99 being last. Most custom roms will have other init.d scripts setup so before you save it make sure the number you are using doesn't exist on your current rom. Just look in /system/etc/init.d/
usually there's just a few scripts in there.
Once you have your script written you will need to copy it to the /system/etc/init.d/ directory
than set the permission, could do it in a terminal, or an adb shell
chown 077 /system/etc/init.d/88hostname
substitute 88hostname for whatever you named your script.
I havn't ever tried to rename the network name on a phone, and I havn't tested this method; the file in question does exist, and the above script will successfully change it. Whether it will yield the correct results I'm not sure. Too lazy to check myself
Edit: You didn't say what rom this was. Init.d scripting is not supported in stock.
Edit2: Haha, I must have been half asleep when I wrote this, for anyone trying to do that, the permissions would be chown 0777... Seems I missed 1, sorry lol