Summary: | configure wireless options in /etc/conf.d/net | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Benoit Chesneau <bchesneau> |
Component: | [OLD] baselayout | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED DUPLICATE | ||
Severity: | enhancement | CC: | chadh, latexer, mholzer, mobile+disabled, radek, spb |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 16649, 66472 | ||
Attachments: |
Patch net.eth0 in /etc/init.d
Patch against net.eth0 to add wlan_IFACE and iwpriv_IFACE support. |
Description
Benoit Chesneau
2003-08-01 21:13:40 UTC
Created attachment 15355 [details, diff]
Patch net.eth0 in /etc/init.d
w-lan gets more and more popular how about this ? Possibly a more elegant solution: instead of seperate lines in /etc/conf.d/net for essid, key, etc., have two extra parameters: wlan_IFACE and iwpriv_IFACE, for options to be passed to iwconfig and iwpriv respectively. This also allows for driver-specific options to iwpriv to be set at boot. Created attachment 26324 [details, diff]
Patch against net.eth0 to add wlan_IFACE and iwpriv_IFACE support.
Comment on attachment 26324 [details, diff]
Patch against net.eth0 to add wlan_IFACE and iwpriv_IFACE support.
--- /etc/init.d/net.eth0 2004-02-25 14:40:52.000000000 +0000
+++ net.wlan0 2004-02-25 15:10:07.247461312 +0000
@@ -29,6 +29,8 @@
# No reason to check these multiple times in the file
iface="${1/\./_}"
iface_IFACE="$(eval echo \$\{iface_${iface}\})"
+ wlan_IFACE="$(eval echo \$\{wlan_${iface}\})"
+ iwpriv_IFACE="$(eval echo \$\{iwpriv_${iface}\})"
dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${iface}\})"
inet6_IFACE="$(eval echo \$\{inet6_${iface}\})"
alias_IFACE="$(eval echo \$\{alias_${iface}\})"
@@ -57,6 +59,50 @@
eend ${retval} "Failed to bring ${IFACE} up"
return ${retval}
}
+
+ # Deal with the wireless-specific parameters. Note that
+ # these don't need dealing with in stop().
+
+ # Are we dealing with a wlan interface?
+ if [ -n "${wlan_IFACE}" ]
+ then
+ ebegin "Setting wireless parameters for ${IFACE}"
+
+ # Do we have wireless-tools installed?
+ if [ ! -x /usr/sbin/iwconfig ]
+ then
+ eerror "wlan_${IFACE} was set, but iwconfig was
not found or not executable."
+ eerror "emerge wireless-tools to fix this."
+ eend 1 "Failed to set wireless parameters for
${
IFACE}"
+ return 1
+ fi
+
+ /usr/sbin/iwconfig ${IFACE} ${wlan_IFACE} || {
+ retval=$?
+ eend ${retval} "Failed to set wireless
parameter
s for ${IFACE}"
+ return ${retval}
+ }
+ fi
+
+ # Do we have to deal with iwpriv?
+ if [ -n "${iwpriv_IFACE}" ]
+ then
+ ebegin "Setting iwpriv parameters for ${IFACE}"
+
+ if [ ! -x /usr/sbin/iwpriv ]
+ then
+ eerror "iwpriv_${IFACE} was set, but iwpriv was
not found or not executable."
+ eerror "emerge wireless-tools to fix this."
+ eend 1 "Failed to set iwpriv parameters for
${IF
ACE}"
+ return 1
+ fi
+
+ /usr/sbin/iwpriv ${IFACE} ${iwpriv_IFACE} || {
+ retval=$?
+ eend ${retval} "Failed to set iwpriv parameters
for ${IFACE}"
+ return ${retval}
+ }
+ fi
else
# Check that eth0 was not brough up by the kernel ...
if [ "${status_IFACE}" != "up" ]
Sorry about that. I realised I left some debugging statements in that patch, and I'm still getting to grips with how Bugzilla works. |