mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [RFC 11/12] sandbox_defconfig: switch to picotcp
Date: Wed, 15 Jul 2015 23:13:49 +0300	[thread overview]
Message-ID: <1436991230-14251-12-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1436991230-14251-1-git-send-email-antonynpavlov@gmail.com>

Picotcp sandbox barebox howto
=============================

Compile sandbox barebox:

  $ cd barebox.git
  $ unset ARCH
  $ unset CROSS_COMPILE
  $ make sandbox_defconfig
  ...
  $ make

Run barebox:

  $ su
  # ./barebox

Testing ping
------------

While sandbox barebox is running setup a IP-address
for your host 'barebox' network interface, e.g.:

  # ifconfig barebox 192.168.1.1

Next, in sandbox barebox console setup network interface
and try to ping host:

  barebox:/ ifconfig eth 192.168.1.2 255.255.255.0
  Assigned ipv4 192.168.1.2 to device eth
  barebox:/ picoping 192.168.1.1
  48 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=1 ms
  ...
  48 bytes from 192.168.1.1: icmp_req=10 ttl=64 time=0 ms

Testing domain name resolving
-----------------------------

Install simple maradns name server on the host.

Edit /etc/maradns/mararc config file, add these lines:

  csv2 = {}
  csv2["example.com."] = "db.example.com"

  bind_address = "192.168.1.1"

Edit /etc/maradns/db.example.com, add these lines:

  example.com. 192.168.1.1 ~
  www.example.com. 192.168.1.1 ~
  barebox.example.com. 192.168.1.2 ~

Run sandbox barebox and setup the www.example.com IP-address
for your host 'barebox' network interface, e.g.:

  # ifconfig barebox 192.168.1.1

Restart maradns:

  $ /etc/init.d/maradns restart

Check name resolution:

  barebox@barebox sandbox:/ ifconfig eth 192.168.1.2 255.255.255.0
  Assigned ipv4 192.168.1.2 to device eth
  barebox@barebox sandbox:/ net.nameserver=192.168.1.1
  barebox@barebox sandbox:/ host barebox.example.com
  barebox.example.com is at 192.168.1.2
  barebox@barebox sandbox:/ host www.example.com
  www.example.com is at 192.168.1.1

The same checks for barebox legacy network stack:

  barebox@barebox sandbox:/ eth0.ipaddr=192.168.1.2
  barebox@barebox sandbox:/ eth0.serverip=192.168.1.1
  barebox@barebox sandbox:/ net.domainname=example.com
  barebox@barebox sandbox:/ net.nameserver=192.168.1.1
  barebox@barebox sandbox:/ host barebox.example.com
  warning: No MAC address set. Using random address 9a:a1:86:31:05:1e
  barebox.example.com is at 192.168.1.2
  barebox@barebox sandbox:/ host www.example.com
  www.example.com is at 192.168.1.1

Testing dhcp (ad memorandum)
----------------------------

Configure your host dhcp server, e.g. add this
to your /etc/dhcp/dhcpd.conf:

  subnet 192.168.1.0 netmask 255.255.255.0 {
    range dynamic-bootp 192.168.1.26 192.168.1.29;
    option routers 192.168.1.1;
    option broadcast-address 192.168.1.255;
    default-lease-time 600;
    max-lease-time 7200;
  }

While sandbox barebox is running setup a IP-address
for your host 'barebox' network interface and restart
your host dhcp server, e.g.:

  # ifconfig barebox 192.168.1.1
  # /etc/init.d/isc-dhcp-server restart

Next, in your sandbox barebox console run 'dhclient':

  barebox:/ dhclient eth
  Assigned ipv4 0.0.0.0 to device eth
  Assigned ipv4 192.168.1.26 to device eth
  DHCP client: renewal time (T1) 300
  DHCP client: rebinding time (T2) 525
  DHCP client: lease time 496
  DHCP client: IP assigned by the server: 192.168.1.26

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/sandbox/configs/sandbox_defconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/sandbox/configs/sandbox_defconfig b/arch/sandbox/configs/sandbox_defconfig
index ec045f7..909969a 100644
--- a/arch/sandbox/configs/sandbox_defconfig
+++ b/arch/sandbox/configs/sandbox_defconfig
@@ -31,6 +31,13 @@ CONFIG_CMD_OF_PROPERTY=y
 CONFIG_CMD_OF_DISPLAY_TIMINGS=y
 CONFIG_CMD_OFTREE=y
 CONFIG_NET=y
+CONFIG_NET_PICOTCP=y
+CONFIG_NET_NFS=y
+CONFIG_NET_RESOLV=y
+CONFIG_CMD_PICOTCP_TEST_IPV4=y
+CONFIG_CMD_PICOTCP_IFCONFIG=y
+CONFIG_CMD_PICOTCP_PING=y
+CONFIG_CMD_PICOTCP_ROUTE=y
 CONFIG_OFDEVICE=y
 CONFIG_OF_BAREBOX_DRIVERS=y
 CONFIG_DRIVER_NET_TAP=y
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-07-15 20:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 20:13 [RFC 00/12] barebox picotcp integration (2015.07.15) Antony Pavlov
2015-07-15 20:13 ` [RFC 01/12] picotcp: add barebox target support Antony Pavlov
2015-07-15 20:13 ` [RFC 02/12] picotcp: switch to Kbuild Antony Pavlov
2015-07-15 20:13 ` [RFC 03/12] net: add initial picotcp support Antony Pavlov
2015-07-15 20:13 ` [RFC 04/12] WIP: fs/nfs.c: convert to picotcp Antony Pavlov
2015-07-16 19:51   ` Sascha Hauer
2015-07-17  7:18     ` Antony Pavlov
2015-07-15 20:13 ` [RFC 05/12] WIP: fs/tftp.c: " Antony Pavlov
2015-07-15 20:13 ` [RFC 06/12] WIP: net/dns: " Antony Pavlov
2015-07-15 20:13 ` [RFC 07/12] net: picotcp: add test_picotcp command Antony Pavlov
2015-07-15 20:13 ` [RFC 08/12] net: picotcp: add ifconfig command Antony Pavlov
2015-07-15 20:13 ` [RFC 09/12] net: picotcp: add ping command Antony Pavlov
2015-07-15 20:13 ` [RFC 10/12] net: picotcp: add route command Antony Pavlov
2015-07-15 20:13 ` Antony Pavlov [this message]
2015-07-15 20:13 ` [RFC 12/12] WIP: sandbox_defconfig: enable network testing-related stuff Antony Pavlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436991230-14251-12-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox