嵌入式產品:啓動

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中添加

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章