via -r opt, global.dhcp.retries or dhcp_retries
set the priority order;
This will allow to do not stay infinite loop if no dhcp available
for boot sequence as example
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This will allow to only update a var if recive a valid data.
This is need for hostname.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This way you can specify as previously set the dhcp parameter via global.dhcp.xxx
and get the result via global.dhcp.xxx
This is need for the defaultenv-2 to add the bootp suppport.
Use it on defaultenv too to have only one set of var.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
The following patch serie improve the complete support
by adding a complete framework to aalow commands complete support.
The add also car complete support for eval and setting and executable
file support
This also include an update of the stringlist API to support asprintf
API
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJPnohsAAoJEOrjwV5ZMRf2qeIQAIC7WrIao0mB2pIB+51MqeU+
sof7GLxUl0MWXFFc3OFEHDcY5grC867mBmB9+uDG1mvcxa/bUpw+jMRMrki5j4Kg
mjaHQ2UCvDjMHqQi7ISc/WTyJb09mtduFIceP0EftAmG8Mb5n9XOMaKwL9r/UQHB
ps9MijnI/QeFqbrmBZcuaCp59QsPvipYw8NMJITBu2VvWrpKTIox33qPfNATDuEV
SzMoLwz+uD7W7dEAM/A1uFdo4K5fLyZruDVGQoQ8CRS+zW3E6rr/EakpN5mhr/66
dVZYO1xWppBaefIJQ1RD6bvwlFvesuuvQmMtDxsCsp07fyBolEWfFzblrwdkbueY
NPwWExV5nzbRdAKKSyhU/nHiQ2edOQQZtHDAbnM4zh5e6lK7YLrzVklzT4Dfhzn0
GRdnjCmiQiaZdmAEHe8wte2nr3Lc01fTsj/EFVA+LYP3a9by1iG2Zn3/ChieVcN4
R+o/2lMBdhxsTszcmwMOemdqVPlt/0VmEXrKGtjTIZEViuQyyhY8ZtEaf4C0zeln
Jf60t0ZvkehAJc0Lo4UOygjzvErqcKoHMk7utAjP+bi1KcMgF3Q+HmtCnJJs2FHw
c40FZj1WcLPStEiS1way7miBakxOy2zPumKi1OXx+140L25C1nvQPYu8ilOZHEyU
opNlo+wQ8h5sG/054kYL
=rYfw
-----END PGP SIGNATURE-----
Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into next
improve complete support
The following patch serie improve the complete support
by adding a complete framework to allow commands complete support.
The add also car complete support for eval and setting and executable
file support
This also include an update of the stringlist API to support asprintf
API
The dhcp command starts with an unitialized start time. The start
time is often long in the past which results in an immediate timeout
and resend of the dhcp packet. Fix this by initializing the start time
correctly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
DHCP option 224 to 254 are for private use, so use one.
Export it via env dhcp_oftree_file.
E.g. the ISC dhcp server can be configured with
| option oftree-path code 224 = string
| class "at91sam9x5ek" {
| match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
|
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
| option tftp-server-name "192.168.200.98";
| option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
| option oftree-path "/tftpboot/atmel/at91sam9x5/sam9x5ek/sam9g25ek/dtb";
| }
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware,
a custom vendor id can be sent in dhcp discover/request messages.
E.g. the ISC dhcp server can be configured with
| option client-uuid code 97 = { unsigned integer 8, string };
| class "at91sam9x5ek" {
| match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
|
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
| if substring (option dhcp-client-identifier,0,7) = "ser2net" {
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
| }
| if substring (option client-uuid,0,7) = "test" {
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
| }
| if substring (option user-class,0,4) = "toto" {
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-toto";
| }
| option tftp-server-name "192.168.200.98";
| option option-150 192.168.200.98;
| next-server 192.168.200.98;
| option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
| }
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware,
a custom client uuid can be sent in dhcp discover/request messages.
E.g. the ISC dhcp server can be configured with
| option client-uuid code 97 = { unsigned integer 8, string };
| class "at91sam9x5ek" {
| match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
|
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
| if substring (option dhcp-client-identifier,0,7) = "ser2net" {
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
| }
| if substring (option client-uuid,0,7) = "test" {
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
| }
| option tftp-server-name "192.168.200.98";
| option option-150 192.168.200.98;
| next-server 192.168.200.98;
| option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
| }
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware,
a custom client id can be sent in dhcp discover/request messages.
E.g. the ISC dhcp server can be configured with
| class "at91sam9x5ek" {
| match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
|
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
| if substring (option dhcp-client-identifier,0,7) = "ser2net" {
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
| }
| option tftp-server-name "192.168.200.98";
| option option-150 192.168.200.98;
| next-server 192.168.200.98;
| option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
| }
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
if the DNS is enable resolve it. The server ip will be set if no server ip it
is set in the bootp.
Export it via env dhcp_tftp_server_name.
E.g. the ISC dhcp server can be configured with
| class "at91sam9x5ek" {
| match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x
|
| filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
| option tftp-server-name "192.168.200.98";
| option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
| }
| }
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Instead of using a static switch case the handle the received option
use an array of supported option.
This will allow to unset the env var without duplicating the code.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish barebox from e.g. pxe machines,
a custom vendor id can be sent in dhcp discover/request messages.
E.g. the ISC dhcp server can be configured with
| if substring(option vendor-class-identifier,0,8) = "barebox:" {
| next-server 192.168.3.24;
| server-name "192.168.3.24";
| option tftp-server-name "192.168.3.24";
| option root-path = concat("/srv/sysroots/by-mac/",
| binary-to-ascii (16, 8, "-", substring (hardware, 1, 6)));
| }
to sent boot params which are valid for barebox hosts only.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Jean-Christophe PLAGNIOL-VILLARD:
- update the use dhcp command option
- support to set the vendor via env dhcp_vendor_id
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This is not yet used, but with this the different network
commands can get rid of their global data.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
No need to check for maximum argument counts. The commands are
safe to be called with more arguments, so lets safe some bytes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>