android4.0.4 增加ethernet

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
android4.0.4 增加ethernet 这个是对android4.0.3增加ethernet我是直接拿过来对android4.0.4增加,过程中有些是不同的,错误比较容 易解决这里我就不作具体说明了。只是其中有一点需要修改的在这个地方: 2. system\core\libnetutils\dhcp_utils.c的 dhcp_do_request函数中,把 snprintf(daemon_cmd,sizeof (daemon_cmd),"%s","dhcpcd_wlan0");改成 snprintf(daemon_cmd,sizeof(daemon_cmd),"% s","dhcpcd_eth0"); 要是改成这样无线网络就用不了,所以我稍微改了下 [java] n n n /* Erase any previous setting of the dhcp result property */ n n n property_set(result_prop_name, ""); n #if 0 n n n /* Start the daemon and wait until it's ready */ n n n if (property_get(HOSTNAME_PROP_NAME, prop_value, NULL) && (prop_value[0] != '\0')) n n n n n snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-h %s %s", DAEMON_NAME, daemon_suffix, n n n n n n n n n nprop_value, interface); n n n else n n n n n snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME, daemon_suffix, interface); n /////////// modfiy by dao n/////////////////////////////////// n n n //snprintf (daemon_cmd,sizeof(daemon_cmd),"%s","dhcpcd_wlan0"); n n n n snprintf(daemon_cmd,sizeof (daemon_cmd),"%s","dhcpcd_wlan0"); n ////////////////////////////////////////////////////////////// n #else n #if 1 n n n /* Start the daemon and wait until it's ready */ n n n if (property_get(HOSTNAME_PROP_NAME, prop_value, NULL) && (prop_value[0] != '\0')) n n n n n //snprintf(daemon_cmd, sizeof(daemon_cmd), "%s:-h %s %s", DAEMON_NAME, n n n n n n n n n // prop_value, interface); n n n snprintf(daemon_cmd, sizeof (daemon_cmd), "%s_%s", DAEMON_NAME, interface); n n n else n #endif n n n n n snprintf (daemon_cmd, sizeof(daemon_cmd), "%s_%s", DAEMON_NAME, interface); n #endif n n n memset (prop_value, '\0', PROPERTY_VALUE_MAX); n 把原来的注释掉,然后改成上面那样。同时在init.rc中加上这 个服务: [html] n service dhcpcd_eth0 /system/bin/dhcpcd -o domain_name_servers -dd -ABKL eth0 n n n class main n n n disabled n n n oneshot n
相关文档
最新文档