ネットワーク

【無線LAN】組み込みボードで無線LANを動かしてみた(Intel N6300編)④クロスコンパイル環境(Yocto)でiwをビルド

【※ 当記事は2020年7月2日時点の情報です】

ペイヴメント(@pavement1234)です。

エンジニア
エンジニア

古いパソコンから抜き取ったN-6300というIntelの無線LANカードを例えばRaspberry Piみたいな組込デバイスに接続したい

こんな悩みを解決します。

今回やることは1つ。

  1. クロスコンパイル環境(Yocto)でiwをビルド

バージョン情報

Linux Kernel 3.14

 

クロスコンパイル環境(Yocto)でiwをビルド

①カーネルコンフィグに無線LANアクセスポイント設定を足す方法

$ MACHINE=nitrogen6x bitbake -f -c menuconfig virtual/kernel

menuconfig画面で、以下の項目を変更してExit(Save)します。

├ Networking support —>
└ Wireless —>
└ nl80211 testmode command [ ] → [*]

├ Device Drivers —>
└ Network device support
└ Wireless LAN
└ IEEE802.11 for Host AP(Prism2/2.5/3 and WEP/TKIP/CCMP) [ ] → [*]

②local.confへlibnlとiwを足す方法(失敗)

【組込Linuxボード】Boundary Devices社のSabre Liteボード(i.MX6)を動かしてみたの手順を参考に、Yoctoの追加パッケージにlibnlとiwを足してみましたが失敗。なお、iwの前に半角スペースを付けないと前のコンポーネントと文字列が連結されてしまいます。packagegroup-core-x11-sato-gamesiwみたいな感じに。

$ vi ~/fido/core-image-sato/conf/local.conf

MACHINE ??= ‘nitrogen6x’
DISTRO ?= ‘poky’
PACKAGE_CLASSES ?= “package_rpm”
EXTRA_IMAGE_FEATURES = “debug-tweaks”
USER_CLASSES ?= “buildstats image-mklibs image-prelink”
PATCHRESOLVE = “noop”
BB_DISKMON_DIRS = “\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K”
PACKAGECONFIG_append_pn-qemu-native = ” sdl”
PACKAGECONFIG_append_pn-nativesdk-qemu = ” sdl”
CONF_VERSION = “1”

BB_NUMBER_THREADS = ‘2’
PARALLEL_MAKE = ‘-j 2’

DL_DIR ?= “${BSPDIR}/downloads/”
ACCEPT_FSL_EULA = “”
IMAGE_INSTALL_append = ” iw libnl”
LICENSE_FLAGS_WHITELIST = ‘commercial’

ビルド時のエラーログ。

$ bitbake core-image-sato
Loading cache: 100% |###############################################################| ETA: 00:00:00
Loaded 2088 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
NOTE: multiple providers are available for jpeg (jpeg, libjpeg-turbo)
NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg
NOTE: multiple providers are available for jpeg-native (jpeg-native, libjpeg-turbo-native)
NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg-native

Build Configuration:
BB_VERSION = “1.26.0”
BUILD_SYS = “x86_64-linux”
NATIVELSBSTRING = “Ubuntu-14.04”
TARGET_SYS = “arm-poky-linux-gnueabi”
MACHINE = “nitrogen6x”
DISTRO = “poky”
DISTRO_VERSION = “1.8.2”
TUNE_FEATURES = “arm armv7a vfp thumb neon callconvention-hard cortexa9”
TARGET_FPU = “vfp-neon”
meta
meta-yocto = “(nobranch):87631919819b6f85f23f57689cd1065c64d7fb03”
meta-oe
meta-multimedia = “(nobranch):902964a4da26e46018d2a8d17dcdda1ac4627a39”
meta-fsl-arm = “(nobranch):c9f259a4bf8472dfa3ff75f1c3fcbe5e0ded7aaf”
meta-fsl-arm-extra = “(nobranch):b292f6204912ace18e30b7683748a311c5dfa780”
meta-fsl-demos = “(nobranch):17f9da65efb5c65c1d44b5cc18584034b29a742b”

NOTE: Preparing RunQueue
WARNING: /home/pavement1234/fido/sources/meta-fsl-arm-extra/recipes-kernel/linux/linux-boundary_3.14.28.bb.do_compile is tainted from a forced run
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: Failed to fetch URL http://libmpeg2.sourceforge.net/files/mpeg2dec-0.4.1.tar.gz, attempting MIRRORS if available
ERROR: Fetcher failure: Fetch command failed with exit code 4, no output
ERROR: Function failed: Fetcher failure for URL: ‘http://libmpeg2.sourceforge.net/files/mpeg2dec-0.4.1.tar.gz’. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/pavement1234/fido/core-image-sato/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/mpeg2dec/0.4.1-r2/temp/log.do_fetch.11185
ERROR: Task 4357 (/home/pavement1234/fido/sources/poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb, do_fetch) failed with exit code ‘1’
WARNING: Failed to fetch URL http://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz, attempting MIRRORS if available
ERROR: Fetcher failure: Fetch command failed with exit code 4, no output
ERROR: Function failed: Fetcher failure for URL: ‘http://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz’. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/pavement1234/fido/core-image-sato/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/libmad/0.15.1b-r3/temp/log.do_fetch.20289
ERROR: Task 4344 (/home/pavement1234/fido/sources/poky/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb, do_fetch) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 2716 tasks of which 2711 didn’t need to be rerun and 2 failed.
Waiting for 0 running tasks to finish:

Summary: 2 tasks failed:
/home/pavement1234/fido/sources/poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb, do_fetch
/home/pavement1234/fido/sources/poky/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb, do_fetch
Summary: There were 3 WARNING messages shown.
Summary: There were 4 ERROR messages shown, returning a non-zero exit code.

解決した

–hostで色々ハマったのですが救世主が降臨し無事解決しました。yoctoのSDKは良く出来ていて–hostにarm-angstrom-linux-gnueabiを指定すれば良いみたいです。

$ . /opt/poky/1.8.2/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
$ cd ~/libnl-3.4.0/
$ ./configure –host=arm-angstrom-linux-gnueabi
configure: loading site script /opt/poky/1.8.2/site-config-cortexa9hf-vfp-neon-poky-linux-gnueabi
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for arm-angstrom-linux-gnueabi-strip… arm-poky-linux-gnueabi-strip
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether make supports nested variables… (cached) yes
checking for style of include used by make… GNU
checking for arm-angstrom-linux-gnueabi-gcc… arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… yes
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi accepts -g… yes
checking for arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi option to accept ISO C89… none needed
checking whether arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi understands -c and -o together… yes
checking dependency style of arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi… gcc3
checking for arm-angstrom-linux-gnueabi-ar… arm-poky-linux-gnueabi-ar
checking the archiver (arm-poky-linux-gnueabi-ar) interface… ar
checking for arm-angstrom-linux-gnueabi-gcc… (cached) arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
checking whether we are using the GNU C compiler… (cached) yes
checking whether arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi accepts -g… (cached) yes
checking for arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi option to accept ISO C89… (cached) none needed
checking whether arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi understands -c and -o together… (cached) yes
checking dependency style of arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi… (cached) gcc3
checking build system type… x86_64-pc-linux-gnu
checking host system type… arm-angstrom-linux-gnueabi
checking how to print strings… printf
checking for a sed that does not truncate output… (cached) sed
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for fgrep… /bin/grep -F
checking for ld used by arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi… arm-poky-linux-gnueabi-ld –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
checking if the linker (arm-poky-linux-gnueabi-ld –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… arm-poky-linux-gnueabi-nm
checking the name lister (arm-poky-linux-gnueabi-nm) interface… BSD nm
checking whether ln -s works… yes
checking the maximum length of command line arguments… 1572864
checking how to convert x86_64-pc-linux-gnu file names to arm-angstrom-linux-gnueabi format… func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format… func_convert_file_noop
checking for arm-poky-linux-gnueabi-ld –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi option to reload object files… -r
checking for arm-angstrom-linux-gnueabi-objdump… arm-poky-linux-gnueabi-objdump
checking how to recognize dependent libraries… pass_all
checking for arm-angstrom-linux-gnueabi-dlltool… no
checking for dlltool… no
checking how to associate runtime and link libraries… printf %s\n
checking for arm-angstrom-linux-gnueabi-ar… (cached) arm-poky-linux-gnueabi-ar
checking for archiver @FILE support… @
checking for arm-angstrom-linux-gnueabi-strip… (cached) arm-poky-linux-gnueabi-strip
checking for arm-angstrom-linux-gnueabi-ranlib… arm-poky-linux-gnueabi-ranlib
checking command to parse arm-poky-linux-gnueabi-nm output from arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi object… ok
checking for sysroot… no
checking for a working dd… /bin/dd
checking how to truncate binary pipes… /bin/dd bs=4096 count=1
checking for arm-angstrom-linux-gnueabi-mt… no
checking for mt… mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool… no
checking how to run the C preprocessor… arm-poky-linux-gnueabi-gcc -E -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for dlfcn.h… yes
checking for objdir… .libs
checking if arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi supports -fno-rtti -fno-exceptions… no
checking for arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi option to produce PIC… -fPIC -DPIC
checking if arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi PIC flag -fPIC -DPIC works… yes
checking if arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi static flag -static works… no
checking if arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi supports -c -o file.o… yes
checking if arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi supports -c -o file.o… (cached) yes
checking whether the arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi linker (arm-poky-linux-gnueabi-ld –sysroot=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… yes
checking for flex… flex
checking for bison… bison -y
checking for an ANSI C-conforming const… yes
checking for inline… inline
checking for arm-angstrom-linux-gnueabi-pkg-config… no
checking for pkg-config… /opt/poky/1.8.2/sysroots/x86_64-pokysdk-linux/usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for CHECK… yes
checking for dlfcn.h… (cached) yes
checking for pthread_mutex_lock in -lpthread… yes
checking for strerror_l… yes
checking that generated files are newer than configure… done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libnl-3.0.pc
config.status: creating libnl-route-3.0.pc
config.status: creating libnl-genl-3.0.pc
config.status: creating libnl-nf-3.0.pc
config.status: creating libnl-cli-3.0.pc
config.status: creating libnl-xfrm-3.0.pc
config.status: creating libnl-idiag-3.0.pc
config.status: creating python/setup.py
config.status: creating include/netlink/version.h
config.status: creating lib/defs.h
config.status: lib/defs.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
——————————————————————————-
NOTE

There have been some changes starting with 3.2 regarding where and how libnl
is being installed on the system in order to allow multiple libnl versions
to be installed in parallel:

– Headers will be installed in ${prefix}/include/libnl3, therefore
you will need to add “-I/usr/include/libnl3” to CFLAGS

– The library basename was renamed to libnl-3, i.e. the SO names become
libnl-3.so., libnl-route-3.so, etc.

– libtool versioning was assumed, to ease detection of compatible library
versions.

If you are using pkg-config for detecting and linking against the library
things will continue magically as if nothing every happened. If you are
linking manually you need to adapt your Makefiles or switch to using
pkg-config files.

——————————————————————————-

 

iwも無事解決。スッキリ。

$ cd ~/iw
$ PKG_CONFIG_PATH=/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/pkgconfig
$ export PKG_CONFIG_PATH
$ make
CC ap.o
CC bitrate.o
bitrate.c: In function ‘handle_bitrates’:
bitrate.c:95:9: warning: missing initializer for field ‘mcs’ of ‘struct nl80211_txrate_vht’ [-Wmissing-field-initializers] struct nl80211_txrate_vht txrate_vht_24 = {};
^
In file included from bitrate.c:3:0:
nl80211.h:4562:8: note: ‘mcs’ declared here
__u16 mcs[NL80211_VHT_NSS_MAX];
^
bitrate.c:96:9: warning: missing initializer for field ‘mcs’ of ‘struct nl80211_txrate_vht’ [-Wmissing-field-initializers] struct nl80211_txrate_vht txrate_vht_5 = {};
^
In file included from bitrate.c:3:0:
nl80211.h:4562:8: note: ‘mcs’ declared here
__u16 mcs[NL80211_VHT_NSS_MAX];
^
CC bloom.o
CC coalesce.o
CC connect.o
connect.c: In function ‘iw_connect’:
connect.c:98:9: warning: missing initializer for field ‘ts’ of ‘struct print_event_args’ [-Wmissing-field-initializers] struct print_event_args printargs = { };
^
In file included from connect.c:10:0:
iw.h:166:17: note: ‘ts’ declared here
struct timeval ts; /* internal */
^
CC cqm.o
CC event.o
event.c: In function ‘parse_nan_term’:
event.c:303:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_NAN_FUNC_SERVICE_ID] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from iw.h:6,
from event.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
event.c:309:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from iw.h:6,
from event.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
event.c:312:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_NAN_FUNC_SERVICE_INFO] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from iw.h:6,
from event.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
event.c: In function ‘parse_nan_match’:
event.c:574:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_NAN_FUNC_SERVICE_ID] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from iw.h:6,
from event.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
event.c:580:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from iw.h:6,
from event.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
event.c:583:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_NAN_FUNC_SERVICE_INFO] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from iw.h:6,
from event.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
CC ftm.o
CC genl.o
CC hwsim.o
CC ibss.o
CC info.o
CC interface.o
CC iw.o
iw.c: In function ‘usage’:
iw.c:96:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < &__stop___cmd – __start___cmd; i++) \
^
iw.c:207:2: note: in expansion of macro ‘for_each_cmd’
for_each_cmd(section, i) {
^
iw.c:96:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < &__stop___cmd – __start___cmd; i++) \
^
iw.c:217:3: note: in expansion of macro ‘for_each_cmd’
for_each_cmd(cmd, j) {
^
iw.c: At top level:
iw.c:562:15: warning: missing initializer for field ‘name’ of ‘struct cmd’ [-Wmissing-field-initializers] static struct cmd sizer1 __attribute__((section(“__sizer”))) = {};
^
In file included from iw.c:25:0:
iw.h:69:14: note: ‘name’ declared here
const char *name;
^
iw.c:563:15: warning: missing initializer for field ‘name’ of ‘struct cmd’ [-Wmissing-field-initializers] static struct cmd sizer2 __attribute__((section(“__sizer”))) = {};
^
In file included from iw.c:25:0:
iw.h:69:14: note: ‘name’ declared here
const char *name;
^
CC link.o
link.c: In function ‘link_bss_handler’:
link.c:31:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_BSS_BSSID] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from link.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
link.c:34:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_BSS_INFORMATION_ELEMENTS] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from link.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
CC measurements.o
measurements.c: In function ‘handle_ftm_req’:
measurements.c:241:9: warning: missing initializer for field ‘ts’ of ‘struct print_event_args’ [-Wmissing-field-initializers] struct print_event_args printargs = { };
^
In file included from measurements.c:4:0:
iw.h:166:17: note: ‘ts’ declared here
struct timeval ts; /* internal */
^
CC mesh.o
CC mgmt.o
CC mpath.o
CC mpp.o
CC nan.o
CC ocb.o
CC offch.o
CC p2p.o
CC phy.o
CC ps.o
CC reason.o
CC reg.o
CC roc.o
CC scan.o
scan.c: In function ‘print_bss_handler’:
scan.c:2117:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_BSS_BSSID] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from scan.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
scan.c:2120:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_BSS_INFORMATION_ELEMENTS] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from scan.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
scan.c:2125:3: warning: missing initializer for field ‘type’ of ‘struct nla_policy’ [-Wmissing-field-initializers] [NL80211_BSS_BEACON_IES] = { },
^
In file included from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/msg.h:17:0,
from /opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/genl/genl.h:16,
from scan.c:6:
/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/libnl3/netlink/attr.h:62:11: note: ‘type’ declared here
uint16_t type;
^
CC sections.o
CC sha256.o
CC station.o
CC status.o
CC survey.o
CC util.o
CC vendor.o
CC wowlan.o
wowlan.c: In function ‘wowlan_parse_tcp_file’:
wowlan.c:110:11: warning: missing initializer for field ‘start’ of ‘struct nl80211_wowlan_tcp_data_seq’ [-Wmissing-field-initializers] struct nl80211_wowlan_tcp_data_seq seq = {};
^
In file included from wowlan.c:13:0:
nl80211.h:4886:8: note: ‘start’ declared here
__u32 start, offset, len;
^
GEN version.c
CC version.o
CC iw

とりあえずARM向けiwバイナリを生成できたので、基板にコピーしてiwを実行したら動いきました。

$ ./iw
Usage: ./iw [options] command
Options:
–debug enable netlink debugging
–version show version (5.3-3-g3708f61)
Commands:
dev <devname> ap stop
dev <devname> ap start
phy <phyname> coalesce show
phy <phyname> coalesce disable
phy <phyname> coalesce enable <config-file>
dev <devname> auth <SSID> <bssid> <type:open|shared> <freq in MHz> [key 0:abcde d:1:6162636465] dev <devname> connect [-w] <SSID> [<freq in MHz>] [<bssid>] [key 0:abcde d:1:6162636465] [mfp:req/opt/no] dev <devname> disconnect
dev <devname> cqm rssi <threshold|off> [<hysteresis>] event [-t|-r] [-f] dev <devname> ftm start_responder [lci=<lci buffer in hex>] [civic=<civic buffer in hex>] dev <devname> ftm get_stats
phy <phyname> hwsim wakequeues
phy <phyname> hwsim stopqueues
phy <phyname> hwsim setps <value>
phy <phyname> hwsim getps
dev <devname> ibss join <SSID> <freq in MHz> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [fixed-freq] [<fixed bssid>] [beacon-interval <TU>] [basic-rates <rate in Mbps,rate2,…>] [mcast-rate <rate in Mbps>] [key d:0:abcde] dev <devname> ibss leave
features
commands
phy
list
phy <phyname> info
dev <devname> switch channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx] dev <devname> switch freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons <count>] [block-tx] dev <devname> switch freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] [beacons <count>] [block-tx] dev
dev <devname> info
dev <devname> del
dev <devname> interface add <name> type <type> [mesh_id <meshid>] [4addr on|off] [flags <flag>*] [addr <mac-addr>] phy <phyname> interface add <name> type <type> [mesh_id <meshid>] [4addr on|off] [flags <flag>*] [addr <mac-addr>] help [command] dev <devname> link
dev <devname> measurement ftm_request <config-file> [timeout=<seconds>] [randomise[=<addr>/<mask>]] dev <devname> mesh leave
dev <devname> mesh join <mesh ID> [[freq <freq in MHz> <NOHT|HT20|HT40+|HT40-|80MHz>] [basic-rates <rate in Mbps,rate2,…>]], [mcast-rate <rate in Mbps>] [beacon-interval <time in TUs>] [dtim-period <value>] [vendor_sync on|off] [<param>=<value>]*
dev <devname> mgmt dump frame <type as hex ab> <pattern as hex ab:cd:..> [frame <type> <pattern>]* [count <frames>] dev <devname> mpath dump
dev <devname> mpath set <destination MAC address> next_hop <next hop MAC address>
dev <devname> mpath new <destination MAC address> next_hop <next hop MAC address>
dev <devname> mpath del <MAC address>
dev <devname> mpath get <MAC address>
dev <devname> mpath probe <destination MAC address> frame <frame>
dev <devname> mpp dump
dev <devname> mpp get <MAC address>
wdev <idx> nan add_func type <publish|subscribe|followup> [active] [solicited] [unsolicited] [bcast] [close_range] name <name> [info <info>] [flw_up_id <id> flw_up_req_id <id> flw_up_dest <mac>] [ttl <ttl>] [srf <include|exclude>  <bf|list> [bf_idx] [bf_len] <mac1;mac2…>] [rx_filter <str1:str2…>] [tx_filter <str1:str2…>] wdev <idx> nan rm_func cookie <cookie>
wdev <idx> nan config [pref <pref>] [bands [2GHz] [5GHz]] wdev <idx> nan stop
wdev <idx> nan start pref <pref> [bands [2GHz] [5GHz]] dev <devname> ocb leave
dev <devname> ocb join <freq in MHz> <5MHz|10MHz>
dev <devname> offchannel <freq> <duration>
wdev <idx> p2p stop
wdev <idx> p2p start
dev <devname> cac channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] dev <devname> cac freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] dev <devname> cac freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] dev <devname> cac trigger channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] dev <devname> cac trigger freq <frequency> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] dev <devname> cac trigger freq <frequency> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] phy <phyname> channels
reg reload
phy <phyname> reg get
reg get
reg set <ISO/IEC 3166-1 alpha2>
dev <devname> roc start <freq> <time in ms>
dev <devname> scan [-u] [freq <freq>*] [duration <dur>] [ies <hex as 00:11:..>] [meshid <meshid>] [lowpri,flush,ap-force,duration-mandatory] [randomise[=<addr>/<mask>]] [ssid <ssid>*|passive] dev <devname> scan sched_stop
dev <devname> scan sched_start [interval <in_msecs> | scan_plans [<interval_secs:iterations>*] <interval_secs>] [delay <in_secs>] [freqs <freq>+] [matches [ssid <ssid>]+]] [active [ssid <ssid>]+|passive] [randomise[=<addr>/<mask>]] dev <devname> scan abort
dev <devname> scan trigger [freq <freq>*] [duration <dur>] [ies <hex as 00:11:..>] [meshid <meshid>] [lowpri,flush,ap-force,duration-mandatory] [randomise[=<addr>/<mask>]] [ssid <ssid>*|passive] dev <devname> scan dump [-u] dev <devname> set bitrates [legacy-<2.4|5> <legacy rate in Mbps>*] [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> <NSS:MCSx,MCSy… | NSS:MCSx-MCSy>*] [sgi-2.4|lgi-2.4] [sgi-5|lgi-5] dev <devname> set mcast_rate <rate in Mbps>
dev <devname> set peer <MAC address>
dev <devname> set noack_map <map>
dev <devname> set 4addr <on|off>
dev <devname> set type <type>
dev <devname> set meshid <meshid>
dev <devname> set monitor <flag>*
dev <devname> set mesh_param <param>=<value> [<param>=<value>]*
phy <phyname> set txq limit <packets> | memory_limit <bytes> | quantum <bytes>
phy <phyname> set antenna <bitmap> | all | <tx bitmap> <rx bitmap>
dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>] phy <phyname> set txpower <auto|fixed|limit> [<tx power in mBm>] phy <phyname> set distance <auto|distance>
phy <phyname> set coverage <coverage class>
phy <phyname> set netns { <pid> | name <nsname> }
phy <phyname> set retry [short <limit>] [long <limit>] phy <phyname> set rts <rts threshold|off>
phy <phyname> set frag <fragmentation threshold|off>
dev <devname> set channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] phy <phyname> set channel <channel> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] dev <devname> set freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] dev <devname> set freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] phy <phyname> set freq <freq> [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] phy <phyname> set freq <control freq> [5|10|20|40|80|80+80|160] [<center1_freq> [<center2_freq>]] phy <phyname> set name <new name>
dev <devname> set power_save <on|off>
dev <devname> get mesh_param [<param>] phy <phyname> get txq
dev <devname> get power_save <param>
dev <devname> station dump [-v] dev <devname> station set <MAC address> txpwr <auto|limit> [<tx power dBm>] dev <devname> station set <MAC address> airtime_weight <weight>
dev <devname> station set <MAC address> mesh_power_mode <active|light|deep>
dev <devname> station set <MAC address> vlan <ifindex>
dev <devname> station set <MAC address> plink_action <open|block>
dev <devname> station del <MAC address> [subtype <subtype>] [reason-code <code>] dev <devname> station get <MAC address>
dev <devname> survey dump
dev <devname> vendor recvbin <oui> <subcmd> <filename|-|hex data>
dev <devname> vendor recv <oui> <subcmd> <filename|-|hex data>
dev <devname> vendor send <oui> <subcmd> <filename|-|hex data>
phy <phyname> wowlan show
phy <phyname> wowlan disable
phy <phyname> wowlan enable [any] [disconnect] [magic-packet] [gtk-rekey-failure] [eap-identity-request] [4way-handshake] [rfkill-release] [net-detect [interval <in_msecs> | scan_plans [<interval_secs:iterations>*] <interval_secs>] [delay <in_secs>] [freqs <freq>+] [matches [ssid <ssid>]+]] [active [ssid <ssid>]+|passive] [randomise[=<addr>/<mask>]]] [tcp <config-file>] [patterns [offset1+]<pattern1> …]

Commands that use the netdev (‘dev’) can also be given the
‘wdev’ instead to identify the device.

You can omit the ‘phy’ or ‘dev’ if the identification is unique,
e.g. “iw wlan0 info” or “iw phy0 info”. (Don’t when scripting.)

Do NOT screenscrape this tool, we don’t consider its output stable.

参考情報

configureのbuild、host、targetの違いを読みました。まず、この方は–build、–host、–targetの定義をこうしています。–hostとはmakeして作ったプログラムの実行環境とあります。

–build コンパイルPC
–host makeして作ったプログラムの実行環境
–target クロス開発におけるターゲット環境

まとめ

今回、クロスコンパイル環境(Yocto)でiwをビルドできて、実機で動きました。次回無線LANを初期化します。

 

ABOUT ME
ペイヴメント
ペイヴメントのエンジニア塾(当ブログ)では20年以上の経験から得られたプログラミング系ノウハウについてベテランにも満足して頂けるような内容の濃いコンテンツを初心者にも分かりやすい形で日々発信しています。【経歴】ベンチャーのソフトハウスで4年勤務後、精密機器メーカーのソフト開発部門に勤務し今に至ります。