Hello Robert,

Yesterday I started going down the dhcpcd.conf route. 

Created a dhcpcd.conf
interface usb0
static ip_address=192.168.1.2/24
static routers=192.168.1.254
static domain_name_servers=10.10.17.117 10.10.19.117

I noticed from logcat that init was looking for a dhcpcd_usb service. I am not 
sure what all the options mean to dhcpcd. They are not descibed when you ask 
for help.

Possible init.rc change based on other device examples.
a. service dhcpcd_usb0 /system/bin/dhcpcd -ABKL
    class late_start
    disabled
    oneshot

b. service dhcpcd_usb0 /system/bin/dhcpcd -AL
    class late_start
    disabled
    oneshot

I am not sure these will work though since they specify the "disable" option. 
Although init is looking for "service dhcpcd_usb0" it doesn't appear to be 
starting it explicitly. Do I also need to implement a hook?

Can you point me to an example of configuring the interface as described using 
LinkProperties and ConnectivityService?

Best Regards,
Allen Curtis

On Aug 12, 2014, at 12:24 PM, Robert Greenwalt <[email protected]> wrote:

> Alot of stuff is continuing to get locked down via selinux security policies. 
>  I wouldn't be surprised if ndc is whitelisted but your app is not.
> 
> The normal way of configuring dns is having whatever android transport 
> communicate it's ip config to ConnectivityService via a LinkProperties 
> instance.  Android != Linux and various traditional scripts/tools may not be 
> supported.  The NDC tool is a way to hack stuff during device bringup and is 
> not intended for production use.
> 
> R
> 
> 
> On Mon, Aug 11, 2014 at 10:51 AM, Allen Curtis <[email protected]> 
> wrote:
> Robert,
> 
> If the setprop stuff is ignored, what is the proper way of configuring the 
> DNS? 
> 
> A weird problem I ran into is that calling the "ndc resolver" methods using 
> popen() in a C program crashes. Typing the exact same commands on the command 
> line works. Should I do this in a shell script as a service from init?
> 
> Best Regards,
> Allen Curtis
> 
> email:        [email protected]
> phone:        (949) 874-5566
> KeyID:        224003C35935A9EC
> 
> On Jul 16, 2014, at 9:47 AM, Robert Greenwalt <[email protected]> wrote:
> 
>> the ndc commands are required.  static/dynamic ip doesn't really affect this 
>> and the setprop stuff is ignored.
>> 
>> Are you able to ping the dns servers from the device?  I believe the google 
>> 8.8.8.8 servers are pingable, so you could use them for this test.  Once you 
>> find you can reach the servers, set them using ndc.  Note that the format 
>> for setifdns is:
>> setifdns <iface> <domains> <dns1> <dns2> ..."
>> If you don't have a search domain use two spaces between <iface> and <dns1>. 
>>  This could be the crux of your issue.
>> 
>> R
>> 
>> 
>> On Tue, Jul 15, 2014 at 11:05 PM, Allen Curtis <[email protected]> 
>> wrote:
>> Hello,
>> 
>> I am porting Android 4.3 to a device that does not have WiFi or a 
>> traditional Ethernet interface. We are using a Gadget CDC USB ethernet 
>> interface.
>> Getting general IP communications working was easy enough. I can ping using 
>> an IP address. It even works correctly with a gateway.
>> 
>> The current problem is getting named to resolve over the usb interface. 
>> Nothing seems to make a difference. Here is what has been tried:
>> 
>> 
>>      * - configuration of static IP using ifconfig
>>      * - configuration of default gateway with 'busybox route'
>>      * - setprop dhcp.usb0.dns1,dns2,ipaddress,gateway,....
>>      * - ndc resolver flushif usb0, ndc resolver flushdefaultif, ndc 
>> resolver setifdns usb0 <dnsip>, ndc resolver setdefaultif usb0
>>      * - cleared all the rules from iptables
>> 
>> It seems to be impossible to get named to use this interface. We even 
>> renamed tried renaming usb0 to eth0 in the kernel sources.
>> 
>> Help!?
>> 
>> Thanks
>> 
>> Allen
>> 
>> 
>> -- 
>> -- 
>> unsubscribe: [email protected]
>> website: http://groups.google.com/group/android-porting
>> 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "android-porting" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>> 
> 
> 

-- 
-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to