|
@@ -167,9 +167,15 @@ int boot_root_path ( const char *root_path ) {
|
167
|
167
|
* @ret rc Return status code
|
168
|
168
|
*/
|
169
|
169
|
static int netboot ( struct net_device *netdev ) {
|
170
|
|
- struct setting tmp_setting = { .name = NULL };
|
|
170
|
+ struct setting vendor_class_id_setting
|
|
171
|
+ = { .tag = DHCP_VENDOR_CLASS_ID };
|
|
172
|
+ struct setting pxe_discovery_control_setting
|
|
173
|
+ = { .tag = DHCP_PXE_DISCOVERY_CONTROL };
|
|
174
|
+ struct setting pxe_boot_menu_setting
|
|
175
|
+ = { .tag = DHCP_PXE_BOOT_MENU };
|
171
|
176
|
char buf[256];
|
172
|
177
|
struct in_addr next_server;
|
|
178
|
+ unsigned int pxe_discovery_control;
|
173
|
179
|
int rc;
|
174
|
180
|
|
175
|
181
|
/* Open device and display device status */
|
|
@@ -195,12 +201,15 @@ static int netboot ( struct net_device *netdev ) {
|
195
|
201
|
if ( rc != ENOENT )
|
196
|
202
|
return rc;
|
197
|
203
|
|
198
|
|
- /* Try PXE menu boot, if we have PXE menu options */
|
199
|
|
- tmp_setting.tag = DHCP_VENDOR_CLASS_ID;
|
200
|
|
- fetch_string_setting ( NULL, &tmp_setting, buf, sizeof ( buf ) );
|
201
|
|
- tmp_setting.tag = DHCP_PXE_BOOT_MENU;
|
|
204
|
+ /* Try PXE menu boot, if applicable */
|
|
205
|
+ fetch_string_setting ( NULL, &vendor_class_id_setting,
|
|
206
|
+ buf, sizeof ( buf ) );
|
|
207
|
+ pxe_discovery_control =
|
|
208
|
+ fetch_uintz_setting ( NULL, &pxe_discovery_control_setting );
|
202
|
209
|
if ( ( strcmp ( buf, "PXEClient" ) == 0 ) &&
|
203
|
|
- setting_exists ( NULL, &tmp_setting ) ) {
|
|
210
|
+ setting_exists ( NULL, &pxe_boot_menu_setting ) &&
|
|
211
|
+ ( ! ( ( pxe_discovery_control & PXEBS_SKIP ) &&
|
|
212
|
+ setting_exists ( NULL, &filename_setting ) ) ) ) {
|
204
|
213
|
printf ( "Booting from PXE menu\n" );
|
205
|
214
|
return pxe_menu_boot ( netdev );
|
206
|
215
|
}
|