hostapd-0.8-snapshot移植到arm板子上

來源:互聯網
上載者:User
 

平台介紹:主機端—ubuntu11.04

                     開發板核心—linux-2.6.30

          Hostapd版本—0.8-snapshot

移植過程:

         在移植hostapd之前需要先移植openssl和libnl兩個庫,經過嘗試,發現openssl-0.9.8g和libnl-1.1兩個版本比較好編譯通過,於是選擇這兩個版本。關於他們的移植在本文中不再介紹,因為有專門關於它們移植過程的文章。

         下載並解壓hostapd-0.8-snapshot原始碼,進入其目錄。

root@xtx:~/hostapd-0.8-snapshot/hostapd# pwd

/root/hostapd-0.8-snapshot/hostapd

(1)     進入hostapd目錄修改Makefile檔案中的CC

把CC=gcc修改為交叉編譯器CC=arm-linux-gcc

(2)     把defconfig拷貝為 .config

cp defconfig .config

                   修改.config檔案

把下面一段

CONFIG_DRIVER_HOSTAP=y

#CONFIG_DRIVER_NL80211=y

#LIBNL=/usr/src/libnl

#CFLAGS += -I$(LIBNL)/include

#LIBS += -L$(LIBNL)/lib

   

         修改為

#CONFIG_DRIVER_HOSTAP=y

CONFIG_DRIVER_NL80211=y  //我的hostapd使用這個驅動

LIBNL=/opt/arm/lib/libnl   //移植的libnl庫所在位置

CFLAGS += -I$(LIBNL)/include

LIBS += -L$(LIBNL)/lib

LIBSSL=/opt/arm/lib/ssl    //移植的openssl庫所在位置

CFLAGS += -I$(LIBSSL)/include

LIBS += -L$(LIBSSL)/lib                                                                               

 

為檔案src\crypto\tls_openssl.c添加標頭檔

         #include <openssl/evp.h>  //openssl裡面的標頭檔

為檔案src\drivers\driver_nl80211.c添加標頭檔

         #include <linux/genetlink.h>

修改完畢,現在開始編譯

回到hostapd目錄下運行make目錄執行makefile檔案,編譯完畢後在目前的目錄為產生hostapd和hostapd_cli兩個可執行檔,這個就是我們需要的,拷貝到板子上即可,當然別忘了把openssl和libnl拷貝到板子上。

root@xtx:~/hostapd-0.8-snapshot/hostapd# file hostapd hostapd_cli

hostapd:     ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.4.3, not stripped

hostapd_cli: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.4.3, not stripped

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.