Add ethernet to android4.0.4

Source: Internet
Author: User

This is to add ethernet to android4.0.3. I just picked it and added it to android4.0.4. The process is somewhat different and the error is easier to solve. Here I will not detail it here. Only one of them needs to be modified here: 2. in the dhcp_do_request function of system \ core \ libnetutils \ dhcp_utils.c, change snprintf (daemon_cmd, sizeof (daemon_cmd), "% s", "Expiration") to snprintf (daemon_cmd, sizeof (daemon_cmd), "% s", "dhcpcd_eth0"); if it is changed to this wireless network, so I slightly changed [java]/* Erase any previous setting of the dhcp result property */property_set (result_prop_name ,""); # if 0/* Start the daemon and wait until it's ready */if (property_get (HO STNAME_PROP_NAME, prop_value, NULL) & (prop_value [0]! = '\ 0') snprintf (daemon_cmd, sizeof (daemon_cmd), "% s _ % s:-h % s", DAEMON_NAME, daemon_suffix, prop_value, interface ); else snprintf (daemon_cmd, sizeof (daemon_cmd), "% s _ % s: % s", DAEMON_NAME, daemon_suffix, interface ); /// // modfiy by dao ////////////////////////// /// // snprintf (daemon_cmd, sizeof (daemon_cmd), "% s", "dhcpcd_wlan0"); snprintf (daemon_cmd, sizeof (daemon_cmd), "% s", "dhcpcd_wlan0" ); //////////////////////////////////////// //// // # Else # if 1/* Start the daemon and wait until it's ready * /if (property_get (HOSTNAME_PROP_NAME, prop_value, NULL) & (prop_value [0]! = '\ 0') // snprintf (daemon_cmd, sizeof (daemon_cmd), "% s:-h % s", DAEMON_NAME, // prop_value, interface ); snprintf (daemon_cmd, sizeof (daemon_cmd), "% s _ % s", DAEMON_NAME, interface); else # endif snprintf (daemon_cmd, sizeof (daemon_cmd ), "% s _ % s", DAEMON_NAME, interface); # endif memset (prop_value, '\ 0', PROPERTY_VALUE_MAX); comment out the original one and change it to the above one. At the same time in init. add this service to rc: [html] service dhcpcd_eth0/system/bin/dhcpcd-o domain_name_servers-dd-ABKL eth0 class main disabled oneshot. Now both wired and wireless connections are normal.

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.