diff --git a/conf/distro/oniro-openharmony-linux.conf b/conf/distro/oniro-openharmony-linux.conf index eacb12b57479641838e71cece599609612918b9c..f688947c9cf5a76db402e32a22dbfd271285d457 100644 --- a/conf/distro/oniro-openharmony-linux.conf +++ b/conf/distro/oniro-openharmony-linux.conf @@ -55,3 +55,7 @@ RPI_EXTRA_CONFIG:raspberrypi4-64 = ' \n \ dtoverlay=vc4-fkms-v3d \n \ ' HDMI_FORCE_HOTPLUG:raspberrypi4-64 = "1" + +# We use NetworkManager as the default network manager +PACKAGECONFIG:remove:pn-systemd = "networkd" + diff --git a/recipes-connectivity/networkmanager/networkmanager-static-ip-config/static-ip.nmconnection b/recipes-connectivity/networkmanager/networkmanager-static-ip-config/static-ip.nmconnection new file mode 100644 index 0000000000000000000000000000000000000000..cb21f0bb6047509b9e122abb03c9df70c79c536d --- /dev/null +++ b/recipes-connectivity/networkmanager/networkmanager-static-ip-config/static-ip.nmconnection @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: MIT + +[connection] +id=StaticIP +uuid=6e6ac8b6-b2d5-4f01-a25d-5a4191e5e897 +type=802-3-ethernet +autoconnect=true +interface-name=eth0 +permissions= + +[ipv4] +address1=192.168.2.199/24,192.168.2.1 +dns=192.168.2.1;8.8.8.8; +dns-search= +method=manual diff --git a/recipes-connectivity/networkmanager/networkmanager-static-ip-config_git.bb b/recipes-connectivity/networkmanager/networkmanager-static-ip-config_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..1719379c25cdfac7bdd28a699b5bc36f5a4c67a9 --- /dev/null +++ b/recipes-connectivity/networkmanager/networkmanager-static-ip-config_git.bb @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: MIT + +LICENSE = "MIT" +#LIC_FILES_CHKSUM = "file://static-ip.nmconnection;beginline=1;endline=3;md5=a1537856660cf2c8e36079c007b35bec" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://static-ip.nmconnection" + +do_install:append() { + install -D -m0600 ${WORKDIR}/static-ip.nmconnection ${D}${libdir}/NetworkManager/system-connections/static-ip.nmconnection +} + +FILES:${PN} += "${libdir}/NetworkManager/system-connections/" diff --git a/recipes-openharmony/images/openharmony-standard-image.bb b/recipes-openharmony/images/openharmony-standard-image.bb index 2cb597a6b3936be9ad8a6d6813eaa5b47d01585d..dcfe486c9966b34b74ea819dec21068180042a6b 100644 --- a/recipes-openharmony/images/openharmony-standard-image.bb +++ b/recipes-openharmony/images/openharmony-standard-image.bb @@ -13,3 +13,6 @@ IMAGE_INSTALL += "openharmony-standard" # Let's be friendly enough to provide a fully working interactive shell IMAGE_INSTALL += "bash" + +# Provide static IP configuration file +IMAGE_INSTALL += "networkmanager-nmcli networkmanager-static-ip-config"