The Wpa_supplicant of wireless tool transplant

Source: Internet
Author: User
Tags openssl openssl library
Wpa_supplicant Source Package Download Address: http://w1.fi/wpa_supplicant/

1, extract the source package:

TAR–XVF wpa_supplicant-2.5.tar.gz

CD Wpa_supplicant-2.5/wpa_supplicant 2, configuring cross compilation Parameters:

CP defconfig. config

Modify the. config file line 17th to add the path to the OpenSSL library you have compiled:

Cflags + +-i/work/ipcam_lib/openssllib_hi/include

LIBS + +-l/work/ipcam_lib/openssllib_hi/lib-lssl-lcrypto

To modify the makefile, specify the cross compiler:

cc=arm-hisiv100nptl-linux-gcc

Modify the path of the destination file (the default target file path is the/usr/local/directory, but we cross compile the generated target file best to specify a path to store, convenient for us to package the production of embedded file system, but also does not affect the PC system):

Export Libdir =/work/ipcam_lib/wireless/wpa_supplicant/lib/

Export Incdir =/work/ipcam_lib/wireless/wpa_supplicant/include/

Export BINDIR =/work/ipcam_lib/wireless/wpa_supplicant/sbin/

Cflags + +-i/work/ipcam_lib/openssllib_hi/include

LIBS + +-l/work/ipcam_lib/openssllib_hi/lib-lssl-lcrypto
3. Compile and generate target files:

Make

Make install

4, the compilation process encountered errors and solutions:

Error 1: File not found Des.h

.. /SRC/CRYPTO/CRYPTO_OPENSSL.C:18:25: Fatal error: openssl/des.h: no file or directory

Compilation interrupted.

Make: * * * * [...] /SRC/CRYPTO/CRYPTO_OPENSSL.O] Error 1

Solution:

sudo apt-get install Libssl-dev

Note: To update Ubuntu's software source.

Error 2: File not found genl.h

.. /SRC/DRIVERS/DRIVER_NL80211.C:17:31: Fatal error: netlink/genl/genl.h: no file or directory

Compilation interrupted.

Make: * * * * [...] /SRC/DRIVERS/DRIVER_NL80211.O] Error 1

View the. config file and know that the LIBNL tool needs to be installed in the system.

#Driver interface for Linux drivers using the nl80211 kernel interface

34#config_driver_nl80211=y

35

#driver_nl80211. c requires LIBNL. If you are compiling it yourself

#you may need to point HOSTAPD to your version of LIBNL.

38 #

39#cflags + +-i$<path to LIBNL include files>

40#libs + +-l$<path to LIBNL library files>

Solution:

sudo apt-get install Libnl-dev

Once the Libnl-dev is installed, it is not a mistake to compile again.

Error 3:

CC wpa_passphrase.c

/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/.. /LIB/GCC/ARM-HISIV100-LINUX-UCLIBCGNUEABI/4.4.1/.. /.. /.. /.. /arm-hisiv100-linux-uclibcgnueabi/bin/ld:cannot Find-lcrypto

Collect2:ld returned 1 exit status

Make: * * * * [wpa_passphrase] Error 1

Solution 1:

Modify the. config file and remove the Wpa_passphrase module.

Config_no_wpa_passphrase=y


Workaround 2: Add the Wpa_passphrase compile-time link OpenSSL library as follows:

Libs_p + +-l/work/ipcam_lib/openssllib_hi/lib-lssl-lcrypto


5. Note: During the compilation process, you may encounter other errors related to OpenSSL cropping, such as:

/work/ipcam_lib/openssllib_hi/lib/libcrypto.so:warning:gethostbyname is obsolescent, use Getnameinfo () instead.
.. /src/crypto/crypto_openssl.o:in function ' Md4_vector ':
/work/wireless_drivers/wpa_supplicant-2.5/wpa_supplicant/.. /src/crypto/crypto_openssl.c:99:undefined reference to ' EVP_MD4 '
Collect2:ld returned 1 exit status
Make: * * * * [wpa_supplicant] Error 1

This is because when the cropping OpenSSL is compiled, the NO-MD4 option was used last year to MD4 the encryption module, which caused Wpa_supplicant to not find the relevant definition of MD4 in the link. It's OK to turn on MD4 when recompiling OpenSSL.

The resulting catalog file is shown in the following illustration:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.