[debian rk3588]解决nmtui无法默认没有eth0和eth1配置信息的问题

diff --git a/debian/binary/etc/NetworkManager/system-connections/NetworkManager.conf b/debian/binary/etc/NetworkManager/system-connections/NetworkManager.conf
new file mode 100644
index 0000000000..06c5d59a66
--- /dev/null
+++ b/debian/binary/etc/NetworkManager/system-connections/NetworkManager.conf
@@ -0,0 +1,8 @@
+[main]
+plugins=ifupdown,keyfile
+
+[ifupdown]
+managed=true
+
+[device]
+wifi.scan-rand-mac-address=no
diff --git a/debian/binary/etc/NetworkManager/system-connections/eth0.nmconnection b/debian/binary/etc/NetworkManager/system-connections/eth0.nmconnection
new file mode 100644
index 0000000000..7d5d636d66
--- /dev/null
+++ b/debian/binary/etc/NetworkManager/system-connections/eth0.nmconnection
@@ -0,0 +1,22 @@
+[connection]
+id=eth0
+uuid=e97d1f49-174d-306a-9e42-df88e17a0d55
+type=ethernet
+autoconnect-priority=-999
+interface-name=eth0
+permissions=
+timestamp=1700099843
+
+[ethernet]
+mac-address-blacklist=
+
+[ipv4]
+dns-search=
+method=auto
+
+[ipv6]
+addr-gen-mode=stable-privacy
+dns-search=
+method=auto
+
+[proxy]
diff --git a/debian/binary/etc/NetworkManager/system-connections/eth1.nmconnection b/debian/binary/etc/NetworkManager/system-connections/eth1.nmconnection
new file mode 100644
index 0000000000..9457e08f45
--- /dev/null
+++ b/debian/binary/etc/NetworkManager/system-connections/eth1.nmconnection
@@ -0,0 +1,25 @@
+[connection]
+id=eth1
+uuid=840fa214-d156-4dad-8075-b3b4f909bfb9
+type=ethernet
+interface-name=eth1
+permissions=
+timestamp=1700099702
+
+[ethernet]
+mac-address=EC:D6:8A:D8:84:B9
+mac-address-blacklist=
+
+[ipv4]
+address1=172.16.0.100/16
+dns-priority=100
+dns-search=
+method=manual
+
+[ipv6]
+addr-gen-mode=stable-privacy
+dns-priority=100
+dns-search=
+method=link-local
+
+[proxy]
diff --git a/debian/binary/etc/rc.local.new b/debian/binary/etc/rc.local.new
new file mode 100755
index 0000000000..37119bdce6
--- /dev/null
+++ b/debian/binary/etc/rc.local.new
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+# Generate the SSH keys if non-existent
+if [ ! -f /etc/ssh/ssh_host_rsa_key ]
+then
+    # else ssh service start in dpkg-reconfigure will fail
+    systemctl stop ssh.socket||true
+    dpkg-reconfigure openssh-server
+fi
+
+nmcli device disconnect eth1
+nmcli device connect eth1
+
+exit 0
diff --git a/debian/overlay/etc/init.d/rockchip.sh b/debian/overlay/etc/init.d/rockchip.sh
index a0086f90f8..1badfdc634 100755
--- a/debian/overlay/etc/init.d/rockchip.sh
+++ b/debian/overlay/etc/init.d/rockchip.sh
@@ -45,19 +45,27 @@ then
        mkdir /data/dps/shadow
        mkdir /data/amp/config /data/amp/log /data/amp/logs /data/amp/report
 
-    echo export LC_ALL=en_US >> /home/linaro/.bashrc
+    #echo export LC_ALL=en_US >> /home/linaro/.bashrc
     echo export LANG=en_US >> /home/linaro/.bashrc
     echo export  LANGUAGE=en_US >> /home/linaro/.bashrc
     source /home/linaro/.bashrc
 
     sudo su
-    echo export LC_ALL=en_US >> /root/.bashrc
+    #echo export LC_ALL=en_US >> /root/.bashrc
     echo export LANG=en_US >> /root/.bashrc
     echo export LANGUAGE=en_US >> /root/.bashrc
     source /root/.bashrc
 
     chmod 600 /etc/ssh/ssh_host_rsa_key
 
+    rm /etc/NetworkManager/NetworkManager.conf
+    mv /etc/NetworkManager/system-connections/NetworkManager.conf /etc/NetworkManager/
+    systemctl restart NetworkManager
+
+    rm /etc/rc.local
+    mv /etc/rc.local.new /etc/rc.local
+    . /etc/rc.local
+
     exit
    
     touch /usr/local/first_boot_flag

  • 8
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值