android4.0.4 增加ethernet

來源:互聯網
上載者:User

這個是對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]      /* 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(HOSTNAME_PROP_NAME, prop_value, NULL) && (prop_value[0] != '\0'))          snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:-h %s %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 %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);  把原來的注釋掉,然後改成上面那樣。同時在init.rc中加上這個服務:[html]  service dhcpcd_eth0 /system/bin/dhcpcd -o domain_name_servers -dd -ABKL eth0      class main      disabled      oneshot  現在有線和無線就都能正常串連了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.