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