今天遇到个问题,启动系统的时候:
Mounting local filesystems...
Setting up networking...done.
Hostname: none.
Configuring network interfaces: done.
Starting portmap daemon: portmap.
Setting up networking...done.
Hostname: none.
Configuring network interfaces: done.
Starting portmap daemon: portmap.
Fast Replaying boot udev events...
INIT: Entering runlevel: 3
Starting sshd:/usr/sbin/sshd: error while loading shared libraries: libcrypto.so.0.9.8: cannot open shared object file: No such file or directory
ok
Starting xinetd: ok
INIT: Entering runlevel: 3
Starting sshd:/usr/sbin/sshd: error while loading shared libraries: libcrypto.so.0.9.8: cannot open shared object file: No such file or directory
ok
Starting xinetd: ok
STMicroelectronics Base Distribution version 2.3
none login: root
Linux xxha 2.6.23.17_stm23_A19-SDK7105_7105-STSDK #19 PREEMPT Thu Jun 24 11:38:20 CST 2010 sh4 unknown unknown GNU/Linux
Linux xxha 2.6.23.17_stm23_A19-SDK7105_7105-STSDK #19 PREEMPT Thu Jun 24 11:38:20 CST 2010 sh4 unknown unknown GNU/Linux
Welcome to STMicroelectronics Base Distribution.
hostname,没解析出来,于是就在网上查了些关于主机名解析资料。终于知道怎么一回事了。
原来是etc/下面没有hostname文件。
系统启动的时候,会运行etc/init.d/hostname.sh 脚本。
[root@localhost etc]# cat init.d/hostname.sh
#
# hostname.sh Set hostname.
#
# Version: @(#)hostname.sh 1.10 26-Feb-2001 miquels@cistron.nl
#
# chkconfig: S 40 0
#
#
# hostname.sh Set hostname.
#
# Version: @(#)hostname.sh 1.10 26-Feb-2001 miquels@cistron.nl
#
# chkconfig: S 40 0
#
echo -n "Hostname: "
if [ -f /etc/hostname ]
then
hostname --file /etc/hostname
fi
then
hostname --file /etc/hostname
fi
echo $(hostname)"."
[root@localhost etc]#
[root@localhost etc]#
可以看出,他是读取了hostname文件,来命名主机名。
所以添加个hostname文件。
[root@localhost etc]# cat hostname
xxha
[root@localhost etc]#
xxha
[root@localhost etc]#
然后再做成yaffs2文件系统,启动,oye,
Mounting local filesystems...
Setting up networking...done.
Hostname: xxha.
Configuring network interfaces: done.
Starting portmap daemon: portmap.
Setting up networking...done.
Hostname: xxha.
Configuring network interfaces: done.
Starting portmap daemon: portmap.
Fast Replaying boot udev events...
INIT: Entering runlevel: 3
Starting sshd:/usr/sbin/sshd: error while loading shared libraries: libcrypto.so.0.9.8: cannot open shared object file: No such file or directory
ok
Starting xinetd: ok
INIT: Entering runlevel: 3
Starting sshd:/usr/sbin/sshd: error while loading shared libraries: libcrypto.so.0.9.8: cannot open shared object file: No such file or directory
ok
Starting xinetd: ok
STMicroelectronics Base Distribution version 2.3
xxha login: root
Linux xxha 2.6.23.17_stm23_A19-SDK7105_7105-STSDK #19 PREEMPT Thu Jun 24 11:38:20 CST 2010 sh4 unknown unknown GNU/Linux
Linux xxha 2.6.23.17_stm23_A19-SDK7105_7105-STSDK #19 PREEMPT Thu Jun 24 11:38:20 CST 2010 sh4 unknown unknown GNU/Linux
Welcome to STMicroelectronics Base Distribution.
主机名出来了。
另外用hostname命令,也可以添加主机名,如下:
[root@localhost etc]# hostname --help
Usage: hostname [-v] {hostname|-F file} set hostname (from file)
domainname [-v] {nisdomain|-F file} set NIS domainname (from file)
hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name
hostname [-v] display hostname
Usage: hostname [-v] {hostname|-F file} set hostname (from file)
domainname [-v] {nisdomain|-F file} set NIS domainname (from file)
hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name
hostname [-v] display hostname
hostname -V|--version|-h|--help print info and exit
dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y
-s, --short short host name
-a, --alias alias names
-i, --ip-address addresses for the hostname
-f, --fqdn, --long long host name (FQDN)
-d, --domain DNS domain name
-y, --yp, --nis NIS/YP domainname
-F, --file read hostname or NIS domainname from given file
This command can read or set the hostname or the NIS domainname. You can
-a, --alias alias names
-i, --ip-address addresses for the hostname
-f, --fqdn, --long long host name (FQDN)
-d, --domain DNS domain name
-y, --yp, --nis NIS/YP domainname
-F, --file read hostname or NIS domainname from given file
also read the DNS domain or the FQDN (fully qualified domain name).
Unless you are using bind or NIS for host lookups you can change the
FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
part of the FQDN) in the /etc/hosts file.
[root@localhost etc]#