From 0b64bbc5f60bceb112434e6b5b800495220ce6de Mon Sep 17 00:00:00 2001 From: hehaoyang Date: Wed, 15 May 2024 22:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9C=E4=BF=AE=E5=A4=8D=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84BUG=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../files/network-config.sh} | 14 +++++++------- .../files/network-config}/enP1p17s0.address | 0 .../files/network-config}/enP1p17s0.dhcp | 0 .../files/network-config}/enP1p17s0.metric | 0 .../files/network-config}/eth0.address | 0 .../files/network-config}/eth0.dhcp | 0 .../files/network-config}/eth0.metric | 0 .../network-config-tvis.bb} | 10 +++++----- .../recipes/packagegroups/packagegroup-tvis-app.bb | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration.sh => network-config-tvis/files/network-config.sh} (85%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration => network-config-tvis/files/network-config}/enP1p17s0.address (100%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration => network-config-tvis/files/network-config}/enP1p17s0.dhcp (100%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration => network-config-tvis/files/network-config}/enP1p17s0.metric (100%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration => network-config-tvis/files/network-config}/eth0.address (100%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration => network-config-tvis/files/network-config}/eth0.dhcp (100%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/files/networkd-configuration => network-config-tvis/files/network-config}/eth0.metric (100%) rename yocto/meta-tvis-app/recipes/{networkd-configuration-tvis/networkd-configuration-tvis.bb => network-config-tvis/network-config-tvis.bb} (51%) diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration.sh b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config.sh similarity index 85% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration.sh rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config.sh index c134e6bb80..ceae61b226 100644 --- a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration.sh +++ b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config.sh @@ -25,13 +25,13 @@ if [ $STATUS = "up" ]; then # 判断是哪一张网卡 if [ $INTERFACE = "eth0" ]; then - dhcp=`cat /etc/networkd-configuration/eth0.dhcp` - metric=`cat /etc/networkd-configuration/eth0.metric` - address=`cat /etc/networkd-configuration/eth0.address` + dhcp=`cat /etc/network-config/eth0.dhcp` + metric=`cat /etc/network-config/eth0.metric` + address=`cat /etc/network-config/eth0.address` elif [ $INTERFACE = "enP1p17s0" ]; then - dhcp=`cat /etc/networkd-configuration/enP1p17s0.dhcp` - metric=`cat /etc/networkd-configuration/enP1p17s0.metric` - address=`cat /etc/networkd-configuration/enP1p17s0.address` + dhcp=`cat /etc/network-config/enP1p17s0.dhcp` + metric=`cat /etc/network-config/enP1p17s0.metric` + address=`cat /etc/network-config/enP1p17s0.address` fi gateway=${address/${address##*.}/"1"} @@ -66,7 +66,7 @@ if [ $STATUS = "up" ]; then # 检查 ipv4.address 配置是否一致,不一致需要重新设置并重启网卡 str1=`nmcli connection show $INTERFACE | grep ipv4.method` str2=`nmcli connection show $INTERFACE | grep ipv4.addresses` - if [${str1##*:} != "manual" ] || [${str2##*:} != $address ]; then + if [${str1##*:} != "manual" ] || [${str2##*:} != "$address/24" ]; then nmcli connection modify $INTERFACE ipv4.addresses $address/24 ipv4.gateway $gateway ipv4.dns $gateway ipv4.method manual echo "nmcli connection modify $INTERFACE ipv4.addresses $address/24 ipv4.gateway $gateway ipv4.dns $gateway ipv4.method manual" # 启动网卡 diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/enP1p17s0.address b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/enP1p17s0.address similarity index 100% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/enP1p17s0.address rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/enP1p17s0.address diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/enP1p17s0.dhcp b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/enP1p17s0.dhcp similarity index 100% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/enP1p17s0.dhcp rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/enP1p17s0.dhcp diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/enP1p17s0.metric b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/enP1p17s0.metric similarity index 100% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/enP1p17s0.metric rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/enP1p17s0.metric diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/eth0.address b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/eth0.address similarity index 100% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/eth0.address rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/eth0.address diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/eth0.dhcp b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/eth0.dhcp similarity index 100% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/eth0.dhcp rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/eth0.dhcp diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/eth0.metric b/yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/eth0.metric similarity index 100% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/files/networkd-configuration/eth0.metric rename to yocto/meta-tvis-app/recipes/network-config-tvis/files/network-config/eth0.metric diff --git a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/networkd-configuration-tvis.bb b/yocto/meta-tvis-app/recipes/network-config-tvis/network-config-tvis.bb similarity index 51% rename from yocto/meta-tvis-app/recipes/networkd-configuration-tvis/networkd-configuration-tvis.bb rename to yocto/meta-tvis-app/recipes/network-config-tvis/network-config-tvis.bb index d42c521ab4..478b6222c6 100644 --- a/yocto/meta-tvis-app/recipes/networkd-configuration-tvis/networkd-configuration-tvis.bb +++ b/yocto/meta-tvis-app/recipes/network-config-tvis/network-config-tvis.bb @@ -3,8 +3,8 @@ SECTION = "network-configuration-tvis" DEPENDS = "" LICENSE = "CLOSED" -SRC_URI += "file://networkd-configuration" -SRC_URI += "file://networkd-configuration.sh" +SRC_URI += "file://network-config" +SRC_URI += "file://network-config.sh" S = "${WORKDIR}" @@ -14,11 +14,11 @@ do_compile[noexec] = "1" do_package_qa[noexec] = "1" do_install() { - install -d ${D}/etc/networkd-configuration - cp -rf ${WORKDIR}/networkd-configuration/* ${D}/etc/networkd-configuration/ + install -d ${D}/etc/network-config + cp -rf ${WORKDIR}/network-config/* ${D}/etc/network-config/ install -d ${D}/etc/NetworkManager/dispatcher.d/ - install -m 0755 ${WORKDIR}/networkd-configuration.sh -D ${D}/etc/NetworkManager/dispatcher.d/10-networkd-configuration.sh + install -m 0755 ${WORKDIR}/network-config.sh -D ${D}/etc/NetworkManager/dispatcher.d/10-network-config.sh } FILES_${PN} += "/etc/*" \ No newline at end of file diff --git a/yocto/meta-tvis-app/recipes/packagegroups/packagegroup-tvis-app.bb b/yocto/meta-tvis-app/recipes/packagegroups/packagegroup-tvis-app.bb index c43b533907..8e274e50b1 100755 --- a/yocto/meta-tvis-app/recipes/packagegroups/packagegroup-tvis-app.bb +++ b/yocto/meta-tvis-app/recipes/packagegroups/packagegroup-tvis-app.bb @@ -10,6 +10,6 @@ RDEPENDS:${PN} = "\ motovis-tvis \ netcore-tvis \ opencv-tvis \ - networkd-configuration-tvis \ + network-config-tvis \ rtsp-server-tvis \ " \ No newline at end of file