Skip to content
Snippets Groups Projects
Commit fd7751b3 authored by Stefan Schmidt's avatar Stefan Schmidt
Browse files

networkmanager: Provide a static IP configuration file


In some network scenarios it might be better to have the device
configured with a static IP configuration instead of DHCP.

This commit introduces a nmconnection file which allows such a
configuration. The commit also introduces the nmcli command to
the image for on device changes.

Signed-off-by: default avatarStefan Schmidt <stefan.schmidt@huawei.com>
parent 45a5440b
No related branches found
No related tags found
1 merge request!130Draft: networkmanager: Provide a static IP configuration file
Pipeline #18295 passed
...@@ -55,3 +55,7 @@ RPI_EXTRA_CONFIG:raspberrypi4-64 = ' \n \ ...@@ -55,3 +55,7 @@ RPI_EXTRA_CONFIG:raspberrypi4-64 = ' \n \
dtoverlay=vc4-fkms-v3d \n \ dtoverlay=vc4-fkms-v3d \n \
' '
HDMI_FORCE_HOTPLUG:raspberrypi4-64 = "1" HDMI_FORCE_HOTPLUG:raspberrypi4-64 = "1"
# We use NetworkManager as the default network manager
PACKAGECONFIG:remove:pn-systemd = "networkd"
# 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
# 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/"
...@@ -13,3 +13,6 @@ IMAGE_INSTALL += "openharmony-standard" ...@@ -13,3 +13,6 @@ IMAGE_INSTALL += "openharmony-standard"
# Let's be friendly enough to provide a fully working interactive shell # Let's be friendly enough to provide a fully working interactive shell
IMAGE_INSTALL += "bash" IMAGE_INSTALL += "bash"
# Provide static IP configuration file
IMAGE_INSTALL += "networkmanager-nmcli networkmanager-static-ip-config"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment