summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2008-03-31 22:38:15 +0200
committermaximilian attems <max@stro.at>2008-03-31 22:38:15 +0200
commit2506a84db53eb95e5616c5b572f82ef4760a773a (patch)
tree3db8a05807d32fcbd382eb3264cac6667ca423a1 /scripts
parent265ba0ac08d5cb33f7013c2820d9c8823165df54 (diff)
downloadinitramfs-tools-2506a84db53eb95e5616c5b572f82ef4760a773a.tar.gz
initramfs-tools-2506a84db53eb95e5616c5b572f82ef4760a773a.zip
scripts/functions: fix configure_networking() for multiple interfaces.
IPOPTS can be assumed to get passed :::::: and thus configure any possible interface. we have thus also to source the relevant ipconfig output :) based on a patch by Michal Sojka <sojkam1@fel.cvut.cz>: "If I want several computers to boot from the same ramdisk (with NFS root) and some computers have multiple network interfaces, the DEVICE variable can't be set to a specific value (e.g. eth0). Ipconfig from klibc supports a mode, where DHCP request is sent to all interfaces and the one receiving the first DHCP offer is used. This perfectly suits my needs, but it can't be used with initramfs scripts because the interface name in not known in advance and the DEVICE variable is set to something like ::::::."
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions
index 0648701..588e324 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -304,6 +304,12 @@ configure_networking()
;;
esac
- # source relevant ipconfig output
- . /tmp/net-${DEVICE}.conf
+ # source ipconfig output
+ if [ -n "${DEVICE}" ]; then
+ # source specific bootdevice
+ . /tmp/net-${DEVICE}.conf
+ else
+ # source any interface as not exaclty specified
+ . /tmp/net-*.conf
+ fi
}