Linux 根系统中增加自动加载网口
最近在学习复旦微的核心版。
遇到的问题是:网卡没法自动加载。在学习资料中也没有提供完整的可行方法。
经过研究,按照下面方法可行:
1 在buildrootf/fmsh/下新建/并拷贝 /lib/lsb/init-functions,2 在buildrootf/fmsh/下新建/并配置 /etc/network/interfaces,(如下)
3 在buildrootf/fmsh/下新建/并拷贝 /etc/init.d/networking,
4 把上述networking脚本更名,改为Sxxnetworking,xx为同目录下S开头的脚本文件的名字里最大数字+10。
5 然后编译根系统并生成镜像,即可。
/****** 下面抄自网络**********/
以太网/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 10.112.18.106
network 10.112.18.0
netmask 255.255.255.0
broadcast 10.112.18.255
gateway 10.112.18.254

浙公网安备 33010602011771号