第九章:网络配置

增加dns

touch ${OUTPUTDIR}/rootfs/etc/resolv.conf
	echo "nameserver 114.114.114.114" >> ${OUTPUTDIR}/rootfs/etc/resolv.conf
	echo "nameserver 8.8.8.8" >> ${OUTPUTDIR}/rootfs/etc/resolv.conf

将libdns路径添加到环境变量

echo export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:/appconfigs/libdns >> ${OUTPUTDIR}/rootfs/etc/profile

开启lo回环

echo "ifconfig lo up" >> ${OUTPUTDIR}/rootfs/etc/profile

设置主机名

echo "hostname localhost" >> ${OUTPUTDIR}/rootfs/etc/profile

将libdns复制到文件系统

mkdir -p  ${OUTPUTDIR}/rootfs/usr/lib
	cp -rf $(PROJ_ROOT)/board/sat_run/libdns  $(OUTPUTDIR)/appconfigs/ -rfd; 

增加localhost 域名

touch ${OUTPUTDIR}/rootfs/etc/hosts
	echo "127.0.0.1   localhost:localdomain   localhost" >> ${OUTPUTDIR}/rootfs/etc/hosts;

增加nesswitch.conf

touch ${OUTPUTDIR}/rootfs/etc/nsswitch.conf
	echo "hosts:      files dns" >> ${OUTPUTDIR}/rootfs/etc/nsswitch.conf

增加host.conf

touch ${OUTPUTDIR}/rootfs/etc/host.conf
	echo "order hosts,bind" >> ${OUTPUTDIR}/rootfs/etc/hosts.conf
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值