diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2000-12-12 22:29:02 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2000-12-12 22:29:02 +0000 |
commit | 5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae (patch) | |
tree | 949b3db0333eb77755db60fbd212f1062a3ca28d /mdk-stage1/network.c | |
parent | b8a6765874054e3f3966896a8763f7352d9ff8f1 (diff) | |
download | drakx-5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae.tar drakx-5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae.tar.gz drakx-5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae.tar.bz2 drakx-5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae.tar.xz drakx-5f740e74b9e2f27b2f3d500c75d9b4986a0a53ae.zip |
network devices detection and insmod on user input
Diffstat (limited to 'mdk-stage1/network.c')
-rw-r--r-- | mdk-stage1/network.c | 40 |
1 files changed, 39 insertions, 1 deletions
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; } |