嵌入式产品:启动

百般思念 提交于 2020-01-10 05:22:33

boot启动命令

cat /proc/cmdline
console=ttyAMA0,115200n8 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=/sbin/init sysremd.show_status=false g_ether.host_addr=82:cf:ce:fa:44:18 initrd=0x49000000,0x400000 console=tty1 lcd=HDMI720p60

查看信息

cat /proc/cpuinfo # CPU
df -h # 存储
free -m # 内存

配置网络

ifconfig eth0 up # 启动指定的网络设备
ifconfig eth0 192.168.0.100 netmask 255.255.255.0 # 配置网卡的IP地址
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx # 配置网卡的MAC 地址(hw 代表hardware 硬件,ether 代表ethernet 以太网)
route add default gw 192.168.0.1 # 添加默认网关

设置DNS域名服务

cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 114.114.114.11

校正网络时间

ntpdate ntp.api.bz
ntpdate time.windows.com
ntpdate time.nist.gov

开机启动服务

在开机时启用一个服务: systemctl enable xxx.service
在开机时禁用一个服务: systemctl disable xxx.service
显示一个服务的状态: systemctl status xxx.service
启动一个服务: systemctl start xxx.service
关闭一个服务: systemctl stop xxx.service
重启一个服务: systemctl restart xxx.service

应用程序自启

在/etc/init.d/rc.local中添加

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!