Port PPPoE on Arm

Source: Internet
Author: User

With the popularity of embedded development, many protocol configurations can be moved to the Development Board. This time, let's share a netizen's experience of porting pppoe on the Arm board. Pppoe has been successfully transplanted on Arm, which has gone through many twists and turns. Therefore, we can write down the process and provide some reference for ourselves. If you want to talk less about it, take the following steps:

By the way, you must first select the options that contain ppp and pppoe when compiling the kernel, but I do not select all options that contain ppp. This depends on your situation.

1. Cross-compile libcap-0.9.1 <code from www.tcpdump.org>

. /Configure -- host = arm-linux -- prefix =/usr -- with-pcap = linux-2.4.10, however, it indicates that there will be a problem later. Because of this problem, someone forced the configuration section with-pcap to be deleted in configure. I am too lazy to delete it, so I will keep it first, haha)

Make: at this time the error is: No rule to make target 'pcap-linux-2.4.10 ', needed by 'libcap. '. This problem is caused by the configuration -- with-pcap in configure. I checked Makefile and found that only the PSRC = linux-2.4.10 item contained the pcap-linux-2.4.10.C keyword, so I changed it to PSRC = pcap. c. make again. The compilation is successful, but only libpcap is generated. a. Open Makefile and find libpcap. so: $ (OBJ )...... In that section, change ld to arm-linux-ld, execute: make libpcap. so, and finally report a pcap. o error. I think it's still because of the with-pcap issue. Then return to Makefile and set PSRC = pcap. c that line changed to PSRC = pcap-linux.c, re-make, then make libpcap. so, finally succeeded, haha! Copy libpcap. so to the lib directory under the arm board rootnewroot, and create two links: libpcap. so.0 and libpcap. so.0.9.1.

2. Cross-compiling ppp-2.4.1

Source code download: ftp://ftp.samba.org/pub/ppp

Extract, go to the ppp-2.4.1 directory, and perform the following two steps:

./Configure -- prefix =/usr

Make CC = arm-linux-gcc

Unfortunately, a lot of errors are all inexplicable. It is estimated that the cause is the tool chain. However, because I used to change the tool chain, library incompatibility caused a loss of segment errors, so I did not dare to change the tool chain easily this time. I haven't finished the change after several hours. No way, cainiao is like this. Had to compromise, for a arm-linux-gcc.3.3.2, a compilation, really through. Although I am fond of it, I am still a little worried.

Copy four executable programs, such as pppd and chat, to the usr/sbin directory under newroot, and copy several scripts under the scripts directory.

Go to dev under newroot and run mknod ppp c 108 0.

3. Cross-compile rp-pppoe. I use version 3.7.

./Configure -- host = arm-linux -- prefix =/usr

Make

Finally, copy pppd pppoe-setup pppoe-start pppoe-stop to/newroot/usr/sbin, or make install on your own.

Pppoe is an executable file and pppoe-xxx is a script.

Finally, burn the file system into flash, run pppoe-setup, and enter the user name, password, DNS, and other information according to your actual situation. Then run the pppoe-start script. If this step is normal, you can. Unfortunately, not only does the automatically generated pppoe-connect script have problems, but also does not have commands such as expr and printf in my file system, I had to change the script. The change will not be described in detail. However, because the pppoe-connect script is too interesting to be changed, the echo will be replaced with $ ECHO with a replacement command, and it will not be checked after the change, the echo contained in a parameter of pppd is also replaced. Later, we can see that the script from DEGBUG is still puzzled by the error for a long time. The script error is cleared, but it still cannot be successfully dial-up, and no output information is available, and no error information is available.

Then run pppd directly and Segmentation Default -- the segment is incorrect! At the beginning, I thought it was the cause of the toolchain. I had to use the original toolchain 3.2.1 for compilation. I referred to the one-person method on the Internet and used arm-linux/sys-include/route. replace h with the route under include. h. The re-compilation is successful, but it is still a segment error. After several days of being depressed, I went crazy about google and finally found the error. It turned out to be a problem with the mmap function, remove the-DHAVE_MMAP In The Makefile under the ppp-2.4.1/pppd and re-compile it to run.

I removed the mistake and breathed a sigh of relief, but I still couldn't connect to it. I was so angry. I encountered a problem that someone else encountered. I also encountered a problem that someone else did not! No way, you have to wait. Run DEBUG = 1 pppoe-start. Check the DEBUG report and find that the address family is not supported by the Protocol. Re-compile the kernel and select the option containing ipv6, but it still does not work. The error is described as follows ...... Socket: Session 0: Address Family not supported by protocol! The Socket word aroused my interest. I thought about it and re-compiled the kernel. I also selected the Socket options Packet Socket, Packet Socket: mmapped IO, and Socket Filtering, run pppoe-start again, ping www.baidu.com, and finally ping the server. You can use adsl to access the Internet and port pppoe.

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.