From 5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 12 Dec 2000 22:29:02 +0000 Subject: network devices detection and insmod on user input --- mdk-stage1/network.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'mdk-stage1/network.c') diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index 021a8d26a..de0e0070e 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -30,9 +30,47 @@ #include "network.h" +static char * interface_select(void) +{ + char ** interfaces, ** ptr; + char * choice; + int i, count = 0; + enum return_type results; + + interfaces = get_net_devices(); + + ptr = interfaces; + while (ptr && *ptr) { + count++; + ptr++; + } + + if (count == 0) { + error_message("No NET device found."); + i = ask_insmod(NETWORK_DEVICES); + if (i == RETURN_BACK) + return NULL; + return interface_select(); + } + + if (count == 1) + return *interfaces; + + results = ask_from_list("Please choose the NET device to use for the installation.", interfaces, &choice); + + if (results != RETURN_OK) + return NULL; + + return choice; +} + enum return_type nfs_prepare(void) { - pci_probing(NETWORK_DEVICES); + char * iface = interface_select(); + + if (iface == NULL) + return RETURN_BACK; + return RETURN_ERROR; } -- cgit v1.2.1