rk3288 ubuntu 固件管理


原文链接: rk3288 ubuntu 固件管理

1. 配置ssh

sudo vi /etc/ssh/sshd_config

"#PermitRootLogin prohibit-password" ==> PermitRootLogin yes

passwd

2. 配置网卡

nmcli conn add type ethernet con-name "eth0-static" ifname eth0 autoconnect yes ip4 192.168.0.10/24 gw4 192.168.0.2
nmcli conn mod eth0-static ipv4.dns "223.5.5.5"

systemctl daemon-reload && systemctl restart network-manager

3. 配置wifiAP模式 (可跳过)

nmcli con add con-name wifi type wifi ifname wlan0 ssid SmartHomeAP mode ap -- ipv4.method shared ipv4.addresses 192.168.42.1/24

4. 配置 systemd-resolved DNS

apt-get install dnsutils dig 命令

vim /etc/systemd/resolved.conf

[Resolve]
DNS=223.5.5.5 223.6.6.6   #多个DNS地址使用空格分隔

systemctl restart systemd-resolved

5. 配置软件源

// 可能会导致 The following packages have unmet dependencies错误
sed -i "s/ports.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list

6. install go

curl -O https://gomirrors.org/dl/go/go1.12.9.linux-arm64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -zxf go1.12.9.linux-arm64.tar.gz -C /usr/local

echo "export GOPATH=/usr/local/gopath" >> /etc/profile;
echo "export PATH=/usr/local/go/bin:/usr/local/gopath/bin:$PATH" >> /etc/profile;
echo "export PATH=/usr/local/go/bin:$GOPATH/bin:\$PATH" > /etc/profile.d/go.env
echo "export GOPROXY=https://goproxy.io" >> /etc/profile.d/go.env

配置dns 旧方式

方式1. ~~失效~~
vi /etc/network/interfaces.d/eth0-static

auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameserver 223.5.5.5
dns-nameservers 8.8.8.8 8.8.4.4

systemctl restart networking

方式 2. 修改/etc/NetworkManager/NetworkManager.conf 文件,
将 managed 设置为 true

  1. apt install resolvconf
    设置 /etc/resolvconf/resolv.conf.d/base,增加
    nameserver 223.5.5.5
    nameserver 223.6.6.6
    因为机器在重启后,真正读取dns 的配置是在 /etc/resolv.conf,但是 /etc/resolv.conf 的数据来源于 /etc/resolvconf/resolv.conf.d/base


用户可以通过以下命令查看 /etc/resolvconf/resolv.conf.d/base 的值是否被刷到 /etc/resolv.conf 上
resolvconf -u

upload

vi /lib/systemd/system/upload.service

[Unit]
Description= upload

[Service]
ExecStart=/root/upload
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target

scp

vi /etc/frp/frpc.ini

[common]
server_addr = 118.190.210.143
server_port = 7000

[ssh]
type = tcp
local_ip = 192.168.0.108
local_port = 80
remote_port = 6661

vi /lib/systemd/system/frpc.service

[Unit]
Description=Frp Client Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini

[Install]
WantedBy=multi-user.target

`