Linux

【無線LAN】BD-SABRE-LITEでNIT6X_PCIEを動かす

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

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

エンジニア
エンジニア

BD-SABRE-LITEでNIT6X_PCIEを動かしたい

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

バージョン情報

Linux Kernel 3.14

BD-SABRE-LITEでNIT6X_PCIEを動かす

【組込Linuxボード】Boundary Devices社のSabre Liteボード(i.MX6)を動かしてみたを読みながら起動。大丈夫そうです。

①NIT6X_PCIEが到着した

こんな感じです。

なんか長いネジが付いてまして、こんな感じに使います。

②認識させてみた

TeraTermでUART接続し、root(パスワードなし)でログイン PCIデバイスを一覧表示させるコマンドlspciを打ってみましたが…。何も表示されませんでした。

root@nitrogen6x:~# lspci

当たり前だがインストールされたドライバを一覧表示させるコマンドlsmodを打ってみてもWLANモジュールは出てこない。

root@nitrogen6x:~# lsmod
Module Size Used by
ov5640_camera_mipi 53880 0
mxc_v4l2_capture 25411 1 ov5640_camera_mipi
ipu_bg_overlay_sdc 4303 1 mxc_v4l2_capture
ipu_still 1811 1 mxc_v4l2_capture
ipu_prp_enc 4919 1 mxc_v4l2_capture
ipu_csi_enc 3097 1 mxc_v4l2_capture
adv7180_tvin 8599 0
ipu_fg_overlay_sdc 5199 1 mxc_v4l2_capture
v4l2_int_device 1936 3 ov5640_camera_mipi,adv7180_tvin,mxc_v4l2_capture
snd_soc_fsl_asrc 24344 0

接触不良かもしれません。シャットダウンして電源OFF。ネジを外し、N-6300を深く挿して再びネジ止め。再び電源ON。

再びlspciを打ったらPCI bridgeとN-6300を認識しました。

root@nitrogen6x:~# lspci
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01)
01:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35)

lsmodも打つと、iwlwifi、cfg80211も出てきました。もうちょっとハマると思ったのでやや拍子抜けでした(もうちょっと試行錯誤したかった…)。

root@nitrogen6x:~# lsmod
Module Size Used by
ov5640_camera_mipi 53880 0
mxc_v4l2_capture 25411 1 ov5640_camera_mipi
ipu_bg_overlay_sdc 4303 1 mxc_v4l2_capture
ipu_still 1811 1 mxc_v4l2_capture
ipu_prp_enc 4919 1 mxc_v4l2_capture
ipu_csi_enc 3097 1 mxc_v4l2_capture
adv7180_tvin 8599 0
ipu_fg_overlay_sdc 5199 1 mxc_v4l2_capture
v4l2_int_device 1936 3 ov5640_camera_mipi,adv7180_tvin,mxc_v4l2_capture
iwlwifi 70357 0
cfg80211 376620 1 iwlwifi
snd_soc_fsl_asrc 24344 0

③N-6300を無線ルータに繋いでみる

さて、N-6300がPCIeデバイスとして認識され、無線LANドライバのインストールまではできました。しかしこいつはまだ赤ちゃんみたいなもので、無線LAN子機(STA)として動かすためにはIPアドレスを設定したり、無線LAN親機(AP)に繋いだりする必要があります。

cfg80211が認識されているようなのでnetlink系です(こんど詳しく説明します)。netlink系の無線LAN設定ツールiwを打ち込んでみましたが、コマンドが入ってません。ubuntuじゃないのでapt-getが使えないため、iwをクロスコンパイルする感じ。無線LANルータに繋がってないので当然インターネットにもつながってません。楽しくなってきました。

root@nitrogen6x:~# iw
-sh: iw: not found

ネットワークインタフェースの設定ツールifconfigを打つと、eth0は見えていますがwlan0はいません。

root@nitrogen6x:~# ifconfig
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

(WPA2接続を行うための)IEEE802.11iサプリカントwpa_supplicantは…。居ますが、iwが使えないので無線LAN初期化ができません。ハードルが高い。

root@nitrogen6x:~# wpa_supplicant
Successfully initialized wpa_supplicant
wpa_supplicant v2.3
Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.

usage:
wpa_supplicant [-BddhKLqqtuvW] [-P<pid file>] [-g<global ctrl>] \
[-G<group>] \
-i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
[-b<br_ifname>] [-e<entropy file>] \
[-o<override driver>] [-O<override ctrl>] \
[-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
[-p<driver_param>] [-b<br_ifname>] [-I<config file>] …]

drivers:
nl80211 = Linux nl80211/cfg80211
wext = Linux wireless extensions (generic)
hostap = Host AP driver (Intersil Prism2/2.5/3)
wired = Wired Ethernet driver
options:
-b = optional bridge interface name
-B = run daemon in the background
-c = Configuration file
-C = ctrl_interface parameter (only used if -c is not)
-i = interface name
-I = additional configuration file
-d = increase debugging verbosity (-dd even more)
-D = driver name (can be multiple drivers: nl80211,wext)
-e = entropy file
-g = global ctrl_interface
-G = global ctrl_interface group
-K = include keys (passwords, etc.) in debug output
-t = include timestamp in debug messages
-h = show this help text
-L = show license (BSD)
-o = override driver parameter for new interfaces
-O = override ctrl_interface parameter for new interfaces
-p = driver parameters
-P = PID file
-q = decrease debugging verbosity (-qq even less)
-u = enable DBus control interface
-v = show version
-W = wait for a control interface monitor before starting
-N = start describing new interface
example:
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf

iwをPCで動かしてみた

BD-SABRE-LITE向けLinuxイメージ(Yocto)に無線LANの設定ツールiwが入っていなかったため初期化できませんでした。iwを組み込みデバイスにインストールのは追々やるとして、そもそも無線LANドライバの初期化ってどうやるのか。

とりあえずLinuxの無線LANについて俯瞰すべくワイヤレス設定を読みました。

まず、ip linkというコマンドを打ってwlan0が生成されているか確認せよ、と書いてあるのですぐにip linkと打ってみたら…。wlan0ありません。

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: can0: <NOARP40000> mtu 16 qdisc noop qlen 10
link/[280]
3: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:19:b8:06:ca:7f brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0

wlan0が無いときは、dmesgでiwlwifiのファームが読み込まれてるか?iwlwifiのエラーが発生してないか?調べてみろと書いてあるので実行してみると…。”iwlwifi-6000-4.ucode”というファームがなくて、ファームの読み込みが失敗していることが分かりました。

# dmesg | grep firmware
imx-sdma 20ec000.sdma: loaded firmware 3.1
usbserial: USB Serial support registered for Keyspan – (without firmware)
egalax_ts 2-0004: Failed to read firmware version
ili210x_i2c 2-0041: Failed to get firmware version, err: -5

# dmesg | grep iwlwifi
iwlwifi 0000:01:00.0: request for firmware file ‘iwlwifi-6000-4.ucode’ failed.
iwlwifi 0000:01:00.0: no suitable firmware found!

思いついた入手方法は以下の2つ どっちも454608バイトでバイナリ比較結果も一致 今回は②を使いました。

①BD-SABRE-LITEをYoctoでビルドしたときのSDKに含まれる/lib/firmware

/opt/poky/1.8.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/lib/firmware/iwlwifi-6000-4.ucode

②Ubuntu14(開発PC)の/lib/firmware

/lib/firmware/iwlwifi-6000-4.ucode

②の/lib/firmware/iwlwifi-6000-4.ucodeはTeraTermのメニューから「ファイル」「SSH SCP」をクリック。

画面下半分の「From」と「To」を指定して「Receive」をクリック。無事c:\tmp\iwlwifi-6000-4.ucodeをゲット。

iwlwifi-6000-4.ucodeをコピーするためUSBメモリ(FAT32で初期化したもの)をBD-SABRE-LITEに挿したら、こんなメッセージが出ました。

/dev/sdaとして認識されたようです。

usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
usb-storage 1-1.1:1.0: USB Mass Storage device detected
scsi1 : usb-storage 1-1.1:1.0
scsi 1:0:0:0: Direct-Access BUFFALO USB Flash Disk 4000 PQ: 0 ANSI: 4
sd 1:0:0:0: [sda] 15950592 512-byte logical blocks: (8.16 GB/7.60 GiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write through
sda:
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] Attached SCSI removable disk
FAT-fs (sda): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

しかしながら/mediaに自動マウントされなかったので

# ls /media

というコマンドを打ち、手動マウントして、/lib/firmwareにコピーしてreboot。

# mount /dev/sda /mnt
root@nitrogen6x:~# ls /mnt
System Volume Information iwlwifi-6000-4.ucode

# cp /mnt/iwlwifi-6000-4.ucode /lib/firmware/

# reboot

♯ reboot

リブート後、無事認識されました。

# dmesg | grep iwlwifi
iwlwifi 0000:01:00.0: loaded firmware version 9.221.4.1 build 25532 op_mode iwldvm
iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEBUG disabled
iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEBUGFS disabled
iwlwifi 0000:01:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
iwlwifi 0000:01:00.0: Detected Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74
iwlwifi 0000:01:00.0: L1 Disabled – LTR Disabled

再びip linkを打つと、無事wlan0が出てきました。

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: can0: <NOARP40000> mtu 16 qdisc noop qlen 10
link/[280]
3: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:19:b8:06:ca:7f brd ff:ff:ff:ff:ff:ff
4: sit0@NONE: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
5: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 3c:a9:f4:8b:fe:d0 brd ff:ff:ff:ff:ff:ff

インタフェース有効化まで行けたので、いよいよiwを動かします。

iwって何?

iw(Linux)を読みました。IEEE 802.11規格の無線LANネットワークの設定を行うためのコマンドラインユーティリティとあります。私がLinuxの無線LANドライバを始めて触ったのはカーネル2.4から2.6への過渡期で、net_device(WIRELESS_EXT)に依存するwireless-toolsが一般的でしたが、最近はnetlinkに依存するiwに置き換わっています。

iwは、IEEE 802.11規格の無線LANネットワークの設定を行うためのコマンドラインユーティリティです。wireless-toolsの置き換えを目標に開発が行われています。

iwは、ISCライセンスの下で配布されているフリーソフトウェアで、iwlwifiなど多くの無線ドライバに対応しています。WPAで暗号化された無線ネットワークに接続する場合は、wpa_supplicantの使用が必要になります。

Ubuntu14(開発PC)でiwと打つとヘルプが表示されます。which iwと打ち、/sbin/iwにインストールされていることが確認できました。

$ which iw
/sbin/iw

共有ライブラリの依存関係を表示するlddコマンドを打ってみました。/lib/x86_64-linux-gnu/にライブラリがインストールされてるようです。

$ ldd /sbin/iw
linux-vdso.so.1 => (0x00007ffebdeb9000)
libnl-genl-3.so.200 => /lib/x86_64-linux-gnu/libnl-genl-3.so.200 (0x00007f79be756000)
libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200 (0x00007f79be53b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f79be172000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f79bdf54000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f79bdc4e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f79be95c000)

ライブラリってどうやって検索されるのか?共有ライブラリへパスを通すを読みました。

①LD_LIBRARY_PATHにパスを通す
②システム全体にパスを通す

の2種類あるみたいです。まず①のLD_LIBRARY_PATHをechoしてみたところ、何も表示されません(設定されてない様子)ウチの環境は②であると考えました。

$ echo $LD_LIBRARY_PATH

②のシステム全体にライブラリパスを通すには/etc/ld.so.confという設定ファイルに登録するようなので、/etc/ld.so.confを開いたところ他の*.confをインクルードしてるみたい 階層が深いです。

$ sudo vi /etc/ld.so.conf

(/etc/ld.so.confの中身)

include /etc/ld.so.conf.d/*.conf

他の*.confをリスト表示しました。

$ ls /etc/ld.so.conf.d
合計 20
-rw-rw-r– 1 root root 38 3月 24 2014 fakeroot-x86_64-linux-gnu.conf
-rw-r–r– 1 root root 44 8月 10 2009 libc.conf
-rw-r–r– 1 root root 68 4月 12 2014 x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 43 2月 17 2019 x86_64-linux-gnu_EGL.conf -> /etc/alternatives/x86_64-linux-gnu_egl_conf
lrwxrwxrwx 1 root root 42 2月 17 2019 x86_64-linux-gnu_GL.conf -> /etc/alternatives/x86_64-linux-gnu_gl_conf
-rw-r–r– 1 root root 56 1月 16 2018 zz_i386-biarch-compat.conf
-rw-r–r– 1 root root 58 1月 16 2018 zz_x32-biarch-compat.conf

/etc/ld.so.conf.d/x86_64-linux-gnu.confを開いてみたところ、libnl-3.so.200libnl-3.so.200 が居る/lib/x86_64-linux-gnu/が書かれていました。この仕組みでライブラリが探せるわけですね。

$ sudo vi /etc/ld.so.conf.d/x86_64-linux-gnu.conf
# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

iwをUbuntu14(開発PC)で練習ビルドする

さて、iwをまずUbuntu14(x86_64の開発PC)で練習ビルドすることにしました。まずソースコードを入手するためiw(Linux)を調べたところ、iw(Linux)にgitのリポジトリも書いてありました。

さらに参照先のgitリポジトリにgitのクローンURLが書いてありました(最近はURLじゃなくてURIって言うんですよね。でもなんか慣れなくてついついURLって言ってしまう私です)。

git://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git

Ubuntu14(開発PC)でiwをgit clone。

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git
Cloning into ‘iw’…
remote: Counting objects: 2984, done.
remote: Compressing objects: 100% (219/219), done.
remote: Total 2984 (delta 127), reused 0 (delta 0)
Receiving objects: 100% (2984/2984), 734.38 KiB | 657.00 KiB/s, done.
Resolving deltas: 100% (1989/1989), done.
Checking connectivity… done.

カレントディレクトリにiwというディレクトリが出来ましたのでlsしてみました。

$ ls -l ./iw
合計 768
-rw-rw-r– 1 pavement1234 pavement1234 491 9月 21 23:26 Android.mk
-rw-rw-r– 1 pavement1234 pavement1234 1871 9月 21 23:26 CONTRIBUTING
-rw-rw-r– 1 pavement1234 pavement1234 849 9月 21 23:26 COPYING
-rw-rw-r– 1 pavement1234 pavement1234 2915 9月 21 23:26 Makefile
-rw-rw-r– 1 pavement1234 pavement1234 464 9月 21 23:26 README
-rw-rw-r– 1 pavement1234 pavement1234 3246 9月 21 23:26 ap.c
-rw-rw-r– 1 pavement1234 pavement1234 6708 9月 21 23:26 bitrate.c
-rw-rw-r– 1 pavement1234 pavement1234 3796 9月 21 23:26 bloom.c
-rw-rw-r– 1 pavement1234 pavement1234 7241 9月 21 23:26 coalesce.c
-rw-rw-r– 1 pavement1234 pavement1234 5146 9月 21 23:26 connect.c
-rw-rw-r– 1 pavement1234 pavement1234 1199 9月 21 23:26 cqm.c
-rw-rw-r– 1 pavement1234 pavement1234 33273 9月 21 23:26 event.c
-rw-rw-r– 1 pavement1234 pavement1234 4715 9月 21 23:26 ftm.c
-rw-rw-r– 1 pavement1234 pavement1234 2445 9月 21 23:26 genl.c
-rw-rw-r– 1 pavement1234 pavement1234 3507 9月 21 23:26 hwsim.c
-rw-rw-r– 1 pavement1234 pavement1234 3206 9月 21 23:26 ibss.c
-rw-rw-r– 1 pavement1234 pavement1234 1594 9月 21 23:26 ieee80211.h
-rw-rw-r– 1 pavement1234 pavement1234 28980 9月 21 23:26 info.c
-rw-rw-r– 1 pavement1234 pavement1234 17900 9月 21 23:26 interface.c
-rw-rw-r– 1 pavement1234 pavement1234 1117 9月 21 23:26 iw.8
-rw-rw-r– 1 pavement1234 pavement1234 13970 9月 21 23:26 iw.c
-rw-rw-r– 1 pavement1234 pavement1234 7725 9月 21 23:26 iw.h
-rw-rw-r– 1 pavement1234 pavement1234 7874 9月 21 23:26 link.c
-rw-rw-r– 1 pavement1234 pavement1234 8476 9月 21 23:26 measurements.c
-rw-rw-r– 1 pavement1234 pavement1234 14303 9月 21 23:26 mesh.c
-rw-rw-r– 1 pavement1234 pavement1234 3662 9月 21 23:26 mgmt.c
-rw-rw-r– 1 pavement1234 pavement1234 6048 9月 21 23:26 mpath.c
-rw-rw-r– 1 pavement1234 pavement1234 1941 9月 21 23:26 mpp.c
-rw-rw-r– 1 pavement1234 pavement1234 11089 9月 21 23:26 nan.c
-rw-rw-r– 1 pavement1234 pavement1234 280715 9月 21 23:26 nl80211.h
-rw-rw-r– 1 pavement1234 pavement1234 851 9月 21 23:26 ocb.c
-rw-rw-r– 1 pavement1234 pavement1234 904 9月 21 23:26 offch.c
-rw-rw-r– 1 pavement1234 pavement1234 669 9月 21 23:26 p2p.c
-rw-rw-r– 1 pavement1234 pavement1234 22269 9月 21 23:26 phy.c
-rw-rw-r– 1 pavement1234 pavement1234 1693 9月 21 23:26 ps.c
-rw-rw-r– 1 pavement1234 pavement1234 2893 9月 21 23:26 reason.c
-rw-rw-r– 1 pavement1234 pavement1234 7553 9月 21 23:26 reg.c
-rw-rw-r– 1 pavement1234 pavement1234 825 9月 21 23:26 roc.c
-rw-rw-r– 1 pavement1234 pavement1234 59949 9月 21 23:26 scan.c
-rw-rw-r– 1 pavement1234 pavement1234 45 9月 21 23:26 sections.c
-rw-rw-r– 1 pavement1234 pavement1234 5601 9月 21 23:26 sha256.c
-rw-rw-r– 1 pavement1234 pavement1234 1709 9月 21 23:26 sha256.h
-rw-rw-r– 1 pavement1234 pavement1234 28210 9月 21 23:26 station.c
-rw-rw-r– 1 pavement1234 pavement1234 3732 9月 21 23:26 status.c
-rw-rw-r– 1 pavement1234 pavement1234 2751 9月 21 23:26 survey.c
-rw-rw-r– 1 pavement1234 pavement1234 38669 9月 21 23:26 util.c
-rw-rw-r– 1 pavement1234 pavement1234 3262 9月 21 23:26 vendor.c
-rwxrwxr-x 1 pavement1234 pavement1234 1103 9月 21 23:26 version.sh
-rw-rw-r– 1 pavement1234 pavement1234 12793 9月 21 23:26 wowlan.c

とりあえずmakeしてみたのですがエラーで瞬殺。libnlが見つからないと言っています。

$ cd iw
$ make
Makefile:75: *** Cannot find development files for any supported version of libnl. 中止.

READMEを開きました。えーと、makeが失敗したらlibnlが見つかるように環境変数PKG_CONFIG_PATHを設定してください、みたいな感じのことが書いてあります。

This is ‘iw’, a tool to use nl80211.

To build iw, just enter ‘make’. If that fails, set the
PKG_CONFIG_PATH environment variable to allow the Makefile
to find libnl.

‘iw’ is currently maintained at http://git.sipsolutions.net/iw.git/,
some more documentation is available at
http://wireless.kernel.org/en/users/Documentation/iw.

Please send all patches to Johannes Berg <johannes@sipsolutions.net>
and CC linux-wireless@vger.kernel.org for community review.

(Google和訳)

これは、nl80211を使用するツールである「iw」です

iwをビルドするには、「make」と入力します それが失敗した場合、設定
Makefileを許可するPKG_CONFIG_PATH環境変数
libnlを見つけます

「iw」は現在http://git.sipsolutions.net/iw.git/で管理されています
さらにいくつかのドキュメントが利用可能です
http://wireless.kernel.org/en/users/Documentation/iw

すべてのパッチをJohannes Berg <johannes@sipsolutions.net>に送信してください
コミュニティレビュー用のCC linux-wireless@vger.kernel.org

$PKG_CONFIG_PATHをechoしたが、何も出てきません(=設定されてません)。が、そもそもPKG_CONFIG_PATHって何かよくわかってません。PKG_CONFIG_PATHで検索かけたところpkg-configという単語が出てきました。さらにpkg-configを調べてみたところ、PKG_CONFIG_PATHには*.pcというファイルを置かなきゃならないみたいです。

pkg-configは、環境変数PKG_CONFIG_PATHのパスに存在する *.pc ファイルに記録された情報を元に、ビルドの際に必要な文字列を返します。

一般的には/usr/lib/pkgconfig/に*.pcファイルを置くみたいですね。

独り言

*.pcは普通は/usr/lib/pkgconfig/以下に作成されます。pkg-config が読みにいくデフォルトのパスもここですがが、/usr/share/pkgconfigの場合もあるみたいです

*.pcの作り方を知りたくなりました

取り急ぎ、pkg-configに対応するを読んでみました。さらにpkg-config をクロス開発で使うも読んだのですが、イマイチ書き方がわかりません。さらに/usr/lib/pkgconfig/*.pcも読みましたが、それぞれ微妙に書き方が異なっていて、標準的な書き方が見いだせません。段々ハマり始めた感じ。ズブズブ…。

ちょっと一歩引いて整理してみよう

iwのREADMEにはこんなことが書いてありました。

「iw」は現在http://git.sipsolutions.net/iw.git/で管理されています
さらにいくつかのドキュメントが利用可能です
http://wireless.kernel.org/en/users/Documentation/iw

https://wireless.wiki.kernel.org/en/users/documentation/iwを開いたところ、Linux Wirelessというサイトのabout iwというページでした。ここにiwのビルドに関するヒントらしきものが書いてあり、更にヒントとなりそうなURLリンクが書いてあります

Build requirements

libnl >= libnl1
libnl-dev >= libnl-dev-1
pkg-config Using iw requires you to have libnl, the first working version is 1.0 pre8 as this release introduced genl, Generic Netlink, which nl80211 relies on. If your distribution’s libnl is a wrong version then you’ll have to download and compile libnl yourself for now (http://www.infradead.org/~tgr/libnl/).

(Google和訳)
ビルド要件

libnl> = libnl1
libnl-dev> = libnl-dev-1
pkg-config iwを使用するにはlibnlが必要です。このリリースでは、nl80211が依存するgenl、Generic Netlinkが導入されたため、最初の作業バージョンは1.0 pre8です。ディストリビューションのlibnlのバージョンが間違っている場合は、今のところlibnlをダウンロードしてコンパイルする必要があります(http://www.infradead.org/~tgr/libnl/)

http://www.infradead.org/~tgr/libnl/を開いたところ、Netlink Protocol Library Suite (libnl)というページでした。SWの階層構造が説明されており、めちゃめちゃわかりやすいのですがpkg-configを解決できそうな記載はありませんでした(pkg-configでページ内を検索しただけですが)。

iwのビルドにハマり始めなかなか突破口が開けません。こういうときは、一旦寝るに限りますね…。

iwのビルド失敗の振り返り

Ubuntu14(開発PC:x86_64)でまずiwのビルドを試みました。pkg-configにハマって抜け出せなくなりましたが、libnlをビルドして*.pcを生成すればいいのではないか?と考えました。

さらに、とりあえず組込Linuxボードでiwが動けばよいという話もあるので、深く考えずにYoctoの追加パッケージにiwを入れればよいのではないか?とも考えました。

次の項で色々試してみようと思います。ちなみに調べる過程で役に立ちそうなページを2つ見つけました。

①Cross Compiling iw wpa supplicant hostapd rfkill for ARM – BeyondLogic

ここにiwのクロスコンパイル方法が書いてあります。しかし私のYocto(SDK)環境の/libにはpkgconfigがなかったので、もう1ひねり必要なのでしょう。

iw

With the Netlink Protocol Library Suite prerequisite installed, download and build the iw nl80211 based CLI configuration utility:

wget https://www.kernel.org/pub/software/network/iw/iw-3.15.tar.gz
tar -xzf iw-3.15.tar.gz
cd iw-3.15/
export PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig
export CC=arm-linux-gnueabi-gcc
make

②iwlwifi Gentoo Wiki

iwlwifiを使う場合のカーネルコンフィグが書いてあります。nl80211、cfg80211、mac80211などnetinkの基本ライブラリをインストールする方法、無線LANチップのファームウェアをインストール方法(ちょっと前にファームのダウンロードで失敗しました。この記事があったらハマらなかったかも)など。

まずはlibnlをビルドしてみる

①libnlのソースをダウンロードして解凍する(自分のアカウントのhome直下で実行してる)

$ wget https://github.com/thom311/libnl/releases/download/libnl3_4_0/libnl-3.4.0.tar.gz
$ tar xvf libnl-3.4.0.tar.gz

②libnlのソースがあるディレクトリに移動して./configureを実行する

$ cd libnl-3.4.0
$ ./configure
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes

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.

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

③makeする

$ make
CC lib/lib_libnl_3_la-addr.lo
CC lib/lib_libnl_3_la-attr.lo

CC src/src_nl_util_addr-nl-util-addr.o
CCLD src/nl-util-addr

④管理者権限でmake installする

$ sudo make install
make[ 1 ]: ディレクトリ /home/pavement1234/libnl-3.4.0' に入ります
/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c lib/libnl-3.la lib/libnl-route-3.la lib/libnl-idiag-3.la lib/libnl-genl-3.la lib/libnl-nf-3.la lib/libnl-xfrm-3.la src/lib/libnl-cli-3.la '/usr/local/lib'
ldconfig -n /usr/local/lib
…(省略)
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/bin'
…(省略)
ldconfig -n /usr/local/lib/libnl/cli/cls
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib/libnl/cli/cls

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/lib/libnl/cli/qdisc'
…(省略)
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib/libnl/cli/qdisc
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib/libnl/cli/qdisc

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/etc/libnl'
/usr/bin/install -c -m 644 etc/pktloc etc/classid '/usr/local/etc/libnl'
make[ 1 ]: ディレクトリ
/home/pavement1234/libnl-3.4.0′ から出ます

⑦インストール先を見てみる

ビルドログを見ると、こんな感じのファイルがインストールされているようです。pkgconfigも(/usr/local/lib/pkgconfig)にインストールされます。

/usr/local/bin/genl-ctrl-list
/usr/local/bin/idiag-socket-details
/usr/local/bin/nl-*
/usr/local/etc/libnl/classid
/usr/local/etc/libnl/pktloc
/usr/local/man/man8/*
/usr/local/share/man/man8/*
/usr/local/include/libnl3/netlink/*
/usr/local/lib/libnl
/usr/local/lib/libnl-*.a
/usr/local/lib/libnl-*.la
/usr/local/lib/libnl-*.so
/usr/local/lib/libnl-*.so.200
/usr/local/lib/pkgconfig

iwもビルドしてみる

①PKG_CONFIG_PATHに/usr/local/lib/pkgconfigを指定する

$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

②iwをビルドする(成功)

初めてiwのビルドが通りました。

$ cd ~/iw
$ make
CC ap.o
CC bitrate.o
bitrate.c: In function ‘handle_bitrates’:
…(省略)
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

③ビルドしたiwを動かしてみる(成功)

エラーなど出ずusageが出てきました。OKですね。

$ cd ~/iw
$ ./iw
./iw: /lib/x86_64-linux-gnu/libnl-genl-3.so.200: no version information available (required by ./iw)
./iw: /lib/x86_64-linux-gnu/libnl-3.so.200: no version information available (required by ./iw)
Usage: ./iw [options] command
Options:
–debug enable netlink debugging
–version show version (5.3-3-g3708f61)
Commands:
dev <devname> ap stop
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.

④iwが参照するライブラリを見てみる

自作libnl(/usr/local/lib/libnl-*.so.200)は参照されません。

$ ldd ~/iw/iw
./iw: /lib/x86_64-linux-gnu/libnl-genl-3.so.200: no version information available (required by ./iw)
./iw: /lib/x86_64-linux-gnu/libnl-3.so.200: no version information available (required by ./iw)
linux-vdso.so.1 => (0x00007ffe6d9ac000)
libnl-genl-3.so.200 => /lib/x86_64-linux-gnu/libnl-genl-3.so.200 (0x00007fa74ca86000)
libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200 (0x00007fa74c86b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa74c4a2000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa74c284000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa74bf7e000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa74cc8c000)

自作libnl(/usr/local/lib/libnl-*.so.200)にライブラリ参照パスを通して、再びlddしてみると自作libnlが参照されました。

$ LD_LIBRARY_PATH=/usr/local/lib
$ export LD_LIBRARY_PATH
$ ldd ~/iw/iw
linux-vdso.so.1 => (0x00007fff51b6c000)
libnl-genl-3.so.200 => /usr/local/lib/libnl-genl-3.so.200 (0x00007f334e35d000)
libnl-3.so.200 => /usr/local/lib/libnl-3.so.200 (0x00007f334e13c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f334dd73000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f334db55000)
/lib64/ld-linux-x86-64.so.2 (0x00007f334e563000)

とりあえず、Ubuntu14(開発PC)でx86_64ビルドが出来たので、次はクロスコンパイル環境(Yocto)でiwをビルドしてみます。

クロスコンパイル環境(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をビルドできて、BD-SABRE-LITEでNIT6X_PCIEを動かすことができました。次回無線LANを初期化します。

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