1

我正在尝试使用 WiFi 加密狗从 Dart 卡(类似于带有 iMX6 CPU 的 Raspberry Pi)连接到无线网络。

我在这里遵循了接受的答案。当我尝试时:

wpa_supplicant -B -i wlan0 -c spark_wifi.conf -D nl80211 && dhclient wlan0

我有:

sh: dhclient: command not found

所以我为 ARM 寻找 dhclient,我发现最好的就是 按照说明进行操作,但无论我多么努力,我都无法编译它......

我正在使用yocto包含以下环境变量的交叉编译器:

export SDKTARGETSYSROOT=/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
export PATH=/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$PATH
export CCACHE_PATH=/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:$CCACHE_PATH
export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig
export CONFIG_SITE=/opt/poky/1.8/site-config-cortexa9hf-vfp-neon-poky-linux-gnueabi
export OECORE_NATIVE_SYSROOT="/opt/poky/1.8/sysroots/x86_64-pokysdk-linux"
export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
export OECORE_ACLOCAL_OPTS="-I /opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr/share/aclocal"
export PYTHONHOME=/opt/poky/1.8/sysroots/x86_64-pokysdk-linux/usr
export CC="arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export CXX="arm-poky-linux-gnueabi-g++  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export CPP="arm-poky-linux-gnueabi-gcc -E  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=$SDKTARGETSYSROOT"
export AS="arm-poky-linux-gnueabi-as "
export LD="arm-poky-linux-gnueabi-ld  --sysroot=$SDKTARGETSYSROOT"
export GDB=arm-poky-linux-gnueabi-gdb
export STRIP=arm-poky-linux-gnueabi-strip
export RANLIB=arm-poky-linux-gnueabi-ranlib
export OBJCOPY=arm-poky-linux-gnueabi-objcopy
export OBJDUMP=arm-poky-linux-gnueabi-objdump
export AR=arm-poky-linux-gnueabi-ar
export NM=arm-poky-linux-gnueabi-nm
export M4=m4
export TARGET_PREFIX=arm-poky-linux-gnueabi-
export CONFIGURE_FLAGS="--target=arm-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
export CPPFLAGS=""
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
export OECORE_DISTRO_VERSION="1.8"
export OECORE_SDK_VERSION="1.8"
export ARCH=arm
export CROSS_COMPILE=arm-poky-linux-gnueabi-

# Append environment subscripts
if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
    for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
        source $envfile
    done
fi
if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
    for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
        source $envfile
    done
fi

我正在运行: ./configure --host=arm-poky-linux-gnueabi --cache-file=config.cache

结果总结是这样的:

     ISC DHCP source configure results:
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Package:
  Name:          DHCP
  Version:       4.2.5-P1

C Compiler:      arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi

Flags:
  DEFS:          -DHAVE_CONFIG_H
  CFLAGS:         -O2 -pipe -g -feliminate-unused-debug-types  -I${top_srcdir}/bind/include

Features:
  debug:         no
  failover:      
  execute:       

Developer:
  ATF unittests : no


Now you can type make to build ISC DHCP

接下来要做的是make最终出现错误:

Making all in bind
make[1]: Entering directory `/home/user/workbench/dhcp/src/bind'
Configuring BIND Export libraries for DHCP.
configure: error: in `/home/user/workbench/dhcp/src/bind/bind-9.8.4-P2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/user/workbench/dhcp/src/bind'
make: *** [all-recursive] Error 1

我厌倦了调试,发现该configure文件包含以下检查:

# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used." >&2
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

echo $cross_compiling这部分给出之后maybe。我没有设法设置$host_alias$build_alias正确地使这件事起作用。更改cross_compiling=maybecross_compiling=yes也不起作用。

感觉就像我在给牦牛剃毛一样……我只想连接到 WiFi :)

如果有一个地方我可以下载编译到 ARM 的 dhclient 二进制文件,那将是非常好的消息。

4

0 回答 0