[v2] device/linaro/beagleboard: Setup network environment during booting

Message ID AANLkTim7Vd6=qgQoEHY=7FGsmOKChLVh=ZJU_NDn5wUg@mail.gmail.com
State New
Headers show

Commit Message

Jeremy Chang Feb. 18, 2011, 3:19 p.m.
Try to enable network interface and fetch IP via DHCP in boot script.

This will give the network interface a shot to fetch IP via DHCP.

Signed-off-by: Jeremy Chang <jeremy.chang@linaro.org>
---
 init.omap3.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Jim Huang Feb. 18, 2011, 3:42 p.m. | #1
2011/2/18 Jeremy Chang <jeremy.chang@linaro.org>:
> Try to enable network interface and fetch IP via DHCP in boot script.
>
> This will give the network interface a shot to fetch IP via DHCP.

To be precise, this patch works with Beagleboard-xM only.

> --- a/init.omap3.sh
> +++ b/init.omap3.sh
> @@ -15,3 +15,5 @@ do
>             ;;
>     esac
>  done < /proc/cpuinfo
> +
> +netcfg usb0 dhcp

Beagleboard xM has one Ethernet port connected over USB, and the
driver model makes it usable
as a normal network device on device node, usb0. (Ethernet support for USB )

That is the reason why "usb0" is here.

Sincerely,
Jim Huang (jserv)
http://0xlab.org/
Alexander Sack Feb. 18, 2011, 4 p.m. | #2
On Fri, Feb 18, 2011 at 4:42 PM, Jim Huang <jserv@0xlab.org> wrote:
> 2011/2/18 Jeremy Chang <jeremy.chang@linaro.org>:
>> Try to enable network interface and fetch IP via DHCP in boot script.
>>
>> This will give the network interface a shot to fetch IP via DHCP.
>
> To be precise, this patch works with Beagleboard-xM only.
>
>> --- a/init.omap3.sh
>> +++ b/init.omap3.sh
>> @@ -15,3 +15,5 @@ do
>>             ;;
>>     esac
>>  done < /proc/cpuinfo
>> +
>> +netcfg usb0 dhcp
>
> Beagleboard xM has one Ethernet port connected over USB, and the
> driver model makes it usable
> as a normal network device on device node, usb0. (Ethernet support for USB )
>
> That is the reason why "usb0" is here.

is this fatal for beagle C4? maybe we can make this gracefully fail
and if you plug in a USBNET device it starts working?
Jim Huang Feb. 18, 2011, 4:15 p.m. | #3
2011/2/19 Alexander Sack <asac@linaro.org>:
> On Fri, Feb 18, 2011 at 4:42 PM, Jim Huang <jserv@0xlab.org> wrote:
[...]
>> To be precise, this patch works with Beagleboard-xM only.
>> Beagleboard xM has one Ethernet port connected over USB, and the
>> driver model makes it usable
>> as a normal network device on device node, usb0. (Ethernet support for USB )
>>
>> That is the reason why "usb0" is here.
>
> is this fatal for beagle C4? maybe we can make this gracefully fail
> and if you plug in a USBNET device it starts working?

hi Alexander,

For Beagleboard C4, file  init.omap3.sh _could_ be the same once you
already set up USB
networking in host side.  However, it is hard to assume every desktop
host provides DHCP
server.

Instead, people might expect to configure usbnet IP address manually.
I think there is no
technical problem of Jeremy's patch, and I just care about the usability.

Sincerely,
Jim Huang (jserv)
http://0xlab.org/
Alexander Sack Feb. 18, 2011, 7:53 p.m. | #4
On Fri, Feb 18, 2011 at 5:15 PM, Jim Huang <jserv@0xlab.org> wrote:
> 2011/2/19 Alexander Sack <asac@linaro.org>:
>> On Fri, Feb 18, 2011 at 4:42 PM, Jim Huang <jserv@0xlab.org> wrote:
> [...]
>>> To be precise, this patch works with Beagleboard-xM only.
>>> Beagleboard xM has one Ethernet port connected over USB, and the
>>> driver model makes it usable
>>> as a normal network device on device node, usb0. (Ethernet support for USB )
>>>
>>> That is the reason why "usb0" is here.
>>
>> is this fatal for beagle C4? maybe we can make this gracefully fail
>> and if you plug in a USBNET device it starts working?
>
> hi Alexander,
>
> For Beagleboard C4, file  init.omap3.sh _could_ be the same once you
> already set up USB
> networking in host side.  However, it is hard to assume every desktop
> host provides DHCP
> server.
>
> Instead, people might expect to configure usbnet IP address manually.
> I think there is no
> technical problem of Jeremy's patch, and I just care about the usability.

I think I used the wrong wording. What I really meant was whether

 a) this patch causes problems on boot if there is no network device
attached to beagleboard
 b) would it start working if I plug in a USB LAN adapter to my beagleboard ;).
Jeremy Chang Feb. 28, 2011, noon | #5
<inline...>
On Sat, Feb 19, 2011 at 3:53 AM, Alexander Sack <asac@linaro.org> wrote:
> On Fri, Feb 18, 2011 at 5:15 PM, Jim Huang <jserv@0xlab.org> wrote:
>> 2011/2/19 Alexander Sack <asac@linaro.org>:
>>> On Fri, Feb 18, 2011 at 4:42 PM, Jim Huang <jserv@0xlab.org> wrote:
>> [...]
>>>> To be precise, this patch works with Beagleboard-xM only.
>>>> Beagleboard xM has one Ethernet port connected over USB, and the
>>>> driver model makes it usable
>>>> as a normal network device on device node, usb0. (Ethernet support for USB )
>>>>
>>>> That is the reason why "usb0" is here.
>>>
>>> is this fatal for beagle C4? maybe we can make this gracefully fail
>>> and if you plug in a USBNET device it starts working?
>>
>> hi Alexander,
>>
>> For Beagleboard C4, file  init.omap3.sh _could_ be the same once you
>> already set up USB
>> networking in host side.  However, it is hard to assume every desktop
>> host provides DHCP
>> server.
>>
>> Instead, people might expect to configure usbnet IP address manually.
>> I think there is no
>> technical problem of Jeremy's patch, and I just care about the usability.
>
> I think I used the wrong wording. What I really meant was whether
>
>  a) this patch causes problems on boot if there is no network device
> attached to beagleboard
    If no such network device, it will have "No such device" ioctl
fail that should not cause problem on boot.

>  b) would it start working if I plug in a USB LAN adapter to my beagleboard ;).
    No. This is assuming that before booting the device the ethernet
cable is plugged in and the interface is usb0. assuming usb0 is
already there during the booting. or this still needs to be triggered
somehow later when plugging the cable or LAN adapter after the
booting.

>
> --
>
>  - Alexander
>
Alexander Sack Feb. 28, 2011, 12:33 p.m. | #6
On Mon, Feb 28, 2011 at 1:00 PM, Jeremy Chang <jeremy.chang@linaro.org> wrote:
> <inline...>
> On Sat, Feb 19, 2011 at 3:53 AM, Alexander Sack <asac@linaro.org> wrote:
>> On Fri, Feb 18, 2011 at 5:15 PM, Jim Huang <jserv@0xlab.org> wrote:
>>> 2011/2/19 Alexander Sack <asac@linaro.org>:
>>>> On Fri, Feb 18, 2011 at 4:42 PM, Jim Huang <jserv@0xlab.org> wrote:
>>> [...]
>>>>> To be precise, this patch works with Beagleboard-xM only.
>>>>> Beagleboard xM has one Ethernet port connected over USB, and the
>>>>> driver model makes it usable
>>>>> as a normal network device on device node, usb0. (Ethernet support for USB )
>>>>>
>>>>> That is the reason why "usb0" is here.
>>>>
>>>> is this fatal for beagle C4? maybe we can make this gracefully fail
>>>> and if you plug in a USBNET device it starts working?
>>>
>>> hi Alexander,
>>>
>>> For Beagleboard C4, file  init.omap3.sh _could_ be the same once you
>>> already set up USB
>>> networking in host side.  However, it is hard to assume every desktop
>>> host provides DHCP
>>> server.
>>>
>>> Instead, people might expect to configure usbnet IP address manually.
>>> I think there is no
>>> technical problem of Jeremy's patch, and I just care about the usability.
>>
>> I think I used the wrong wording. What I really meant was whether
>>
>>  a) this patch causes problems on boot if there is no network device
>> attached to beagleboard
>    If no such network device, it will have "No such device" ioctl
> fail that should not cause problem on boot.
>
>>  b) would it start working if I plug in a USB LAN adapter to my beagleboard ;).
>    No. This is assuming that before booting the device the ethernet
> cable is plugged in and the interface is usb0. assuming usb0 is
> already there during the booting. or this still needs to be triggered
> somehow later when plugging the cable or LAN adapter after the
> booting.

Is there something like a network management service/framework in
android that could be improved to also consider LAN to achieve
always-online? I assume it currently reacts on wifi or 3g signal
becoming available/going away.
Jim Huang Feb. 28, 2011, 2:10 p.m. | #7
On 28 February 2011 20:33, Alexander Sack <asac@linaro.org> wrote:
> Is there something like a network management service/framework in
> android that could be improved to also consider LAN to achieve
> always-online? I assume it currently reacts on wifi or 3g signal
> becoming available/going away.

hi Alexander,

I don't think Android has such LAN assumption in mind.  In fact, we
need extra patches to enable
Ethernet support in Android.  To make development friendly, the way
Jeremy took might be the most
straightforward.

'netcfg' could detect and apply related configurations for Beagleboard-xM.

Thanks,
-jserv

Patch

diff --git a/init.omap3.sh b/init.omap3.sh
index 997ee03..a740236 100755
--- a/init.omap3.sh
+++ b/init.omap3.sh
@@ -15,3 +15,5 @@  do
             ;;
     esac
 done < /proc/cpuinfo
+
+netcfg usb0 dhcp