[settings] Make "netX" settings block function as a symbolic link

Add a facility for settings blocks to act as symbolic links to other
settings blocks, and reimplement the "netX" virtual settings block
using this facility.

The primary advantage of this approach is that unscoped settings such
as ${mac} and ${filename} will now reflect the settings obtained from
the most recently opened network device: in most cases, this will mean
the settings obtained from the most recent DHCP attempt.  This should
improve conformance to the principle of least astonishment.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-07-13 15:06:20 +02:00
parent dbfa13ff2c
commit 66ea458125
4 changed files with 107 additions and 24 deletions

View File

@@ -441,7 +441,7 @@ static void reveal_setting_row ( struct setting_widget *widget,
static void init_widget ( struct setting_widget *widget,
struct settings *settings ) {
widget->settings = settings;
widget->settings = settings_target ( settings );
widget->num_rows = select_setting_row ( widget, 0 );
widget->first_visible = SETTINGS_LIST_ROWS;
draw_title_row ( widget );