我有一个已经root过的G1手机,我想设置它的主机名。作为root用户,我可以运行hostname
命令并设置主机名,但是这个名称在重启后不会保留。
首先,我尝试创建一个只包含我的主机名的/etc/hostname
文件,但是那样做没有起作用。
接下来,我像这样编辑了/etc/hosts
:
127.0.0.1 g1-phone localhost
但是那个方法也失败了。还有其他的方法可以尝试来永久设置主机名吗?
Runs /system/sd/userinit.sh after A2SD setup and before starting the runtime for user scripts
http://www.cyanogenmod.com/about
我没有尝试在那里放置hostname命令,因为我在论坛中读到过容易破坏该脚本并使手机变砖或不得不重置的情况。