discover: implement a periodic requery for network devices
authorJeremy Kerr <jk@ozlabs.org>
Tue, 3 Jul 2018 06:24:58 +0000 (16:24 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Mon, 9 Jul 2018 05:13:07 +0000 (15:13 +1000)
commit6fa0edfb029726968cbacad9d4e193a345956ff3
treef406c1621bb407b9affe4af522dbc6ec0e626524
parent13cc5c5d57318a6c2043168277862b3704a7d3d9
discover: implement a periodic requery for network devices

If we boot a machine before external (network) dependencies are properly
configured, it will have tried once to download configuration, and
possibly failed due to that configuration not being present.

This change introduces a periodic requery of network resources. After a
timeout, petitboot will either re-acquire its DHCP lease (causing any
downloads to be re-processed, possibly with different parameters from
the new lease), or re-download a statically defined URL.

This timeout defaults to five minutes (similar to pxelinux), and is
configurable by DHCP option 211, "reboot time".

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
[added test stub]
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/device-handler.c
discover/device-handler.h
discover/network.c
discover/network.h
test/parser/network.c
utils/pb-udhcpc