LS1043A lsdk2108 ubuntu20.04配置开机启动:
把配置写入ramdisk_fs只把需要执行的代码放在/etc/profile的文件末尾,即可实现开机自启动
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
cd /
echo "123" > 1.txt
网口顺序及名称修改配置文件:
root@localhost:/# cat /etc/udev/rules.d/72-fsl-dpaa-persistent-networking.rules
# Rules for handling naming the DPAA FMan ethernet ports in a consistent way
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae0000", NAME="eth0"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae2000", NAME="eth1"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae4000", NAME="eth2"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae6000", NAME="eth3"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1ae8000", NAME="eth4"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1aea000", NAME="eth5"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1af0000", NAME="eth6"
SUBSYSTEM=="net", DRIVERS=="fsl_dpa*", ATTR{device_addr}=="1af2000", NAME="eth7"
# Rename macless0 to "macless0"
SUBSYSTEM=="net", ATTR{device_type}=="macless0", NAME="macless0"
配置网络:
root@localhost:/# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.188
gateway 192.168.0.1
netmask 255.255.255.0
配置DNS:(此方法重启失效)
root@localhost:/# cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 192.168.0.1
options edns0 trust-ad
resolv.conf 现在归systemd管,需要修改/etc/systemd/resolved.conf 文件
root@localhost:/# cat /etc/systemd/resolved.conf
# This file is part of systemd.
# See resolved.conf(5) for details
[Resolve]
DNS=192.168.0.1
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=no-negative
#DNSStubListener=yes
#ReadEtcHosts=yes
然后重启服务
systemctl restart systemd-resolved.service
查看结果:
root@localhost:/# systemd-resolve --status
Global
LLMNR setting: no
MulticastDNS setting: no
DNSOverTLS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.0.1
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
重启网络:
root@localhost:/# /etc/init.d/networking restart
Restarting networking (via systemctl): networking.service.
安装I2C报错
error while loading shared libraries: libi2c.so.0: cannot open shared object file: No such file or directory
将i2c-tools-4.0/lib/libi2c.so.0.1.1复制到/usr/lib/下, 重命名为libi2c.so.0, 并修改权限为777:
sudo cp lib/libi2c.so.0.1.1 /usr/lib/libi2c.so.0
sudo chmod 777 /usr/lib/libi2c.so.0