Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support different dhcp client in Linux #9490

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

TE-N-ElvenWang
Copy link
Contributor

Some Linux environment like Yocto has no dhclient tool set.
So add a macro named CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD to config
the command which used to query the IP address from the DHCP server.

The macro didn't added into CHIPDeviceConfig.h due it is only used for Linux and by default the command is reset to using "dhclient".

For example in Yocto arm64 cross compile :
#Yocto using udhcpc to fetch IP and DNS info
PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME="mlan0"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD="udhcpc -b -i %s & "'
PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}
PKG_CONFIG_LIBDIR=${PKG_CONFIG_PATH}
gn gen out/aarch64 --args="target_os="linux" target_cpu="arm64" arm_arch="armv8-a"
import("//build_overrides/build.gni")
target_cflags=[ "--sysroot=${SDKTARGETSYSROOT}", "${PLATFORM_CFLAGS}" ]
target_ldflags = [ "--sysroot=${SDKTARGETSYSROOT}" ]
custom_toolchain="${build_root}/toolchain/custom"
target_cc="${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc"
target_cxx="${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++"
target_ar="${OECORE_NATIVE_SYSROOT}/usr/bin/aarch64-poky-linux/aarch64-poky-linux-ar""

Signed-off-by: Haoran Wang [email protected]

@CLAassistant
Copy link

CLAassistant commented Sep 6, 2021

CLA assistant check
All committers have signed the CLA.

Some Linux environment like Yocto has no dhclient tools.
So add a macro named CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD to config
the command which used to query the IP address from the DHCP server.

For example in Yocto cross compile :
PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME=\"mlan0\"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD=\"udhcpc -b -i %s & \"'

Signed-off-by: Haoran Wang <[email protected]>
@woody-apple
Copy link
Contributor

@saurabhst ?

@woody-apple woody-apple merged commit cb5d39e into project-chip:master Sep 7, 2021
@cecille cecille mentioned this pull request Sep 8, 2021
kpschoedel pushed a commit to kpschoedel/connectedhomeip that referenced this pull request Sep 9, 2021
Some Linux environment like Yocto has no dhclient tools.
So add a macro named CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD to config
the command which used to query the IP address from the DHCP server.

For example in Yocto cross compile :
PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME=\"mlan0\"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD=\"udhcpc -b -i %s & \"'

Signed-off-by: Haoran Wang <[email protected]>
TE-N-ElvenWang added a commit to TE-N-ElvenWang/connectedhomeip that referenced this pull request Sep 24, 2021
Some Linux environment like Yocto has no dhclient tools.
So add a macro named CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD to config
the command which used to query the IP address from the DHCP server.

For example in Yocto cross compile :
PLATFORM_CFLAGS='-DCHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME=\"mlan0\"", "-DCHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD=\"udhcpc -b -i %s & \"'

Signed-off-by: Haoran Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants