Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116352 - bash-3.1-r1 breaks net.lo baselayout-1.12.0_pre12
Summary: bash-3.1-r1 breaks net.lo baselayout-1.12.0_pre12
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords:
: 116361 117736 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-21 23:14 UTC by Jory A. Pratt
Modified: 2006-01-05 11:23 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
essidnet-expand.patch (essidnet-expand.patch,651 bytes, patch)
2006-01-05 11:23 UTC, Thomas Bettler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jory A. Pratt 2005-12-21 23:14:47 UTC
modules are not found when using 3.1-r1 causing gnome apps and everything to fails with no loopback device to talk on.

downgrading to 3.0-r14 works fine once again.

Only filing as critical as so many applications depend on a loopback to work properly, i.e gnome
Comment 1 Felix Braun 2005-12-22 03:31:24 UTC
The new bash can't parse (or find) any network device configuration in /etc/conf.d/net. eth0 works only if the dropback default (dhcp) is correct. All custom setups won't work at all. So this is at _least_ critical, if not blocker!
Comment 2 Roy Marples (RETIRED) gentoo-dev 2005-12-22 03:36:31 UTC
bash-3.1-r1 has now been packaged.masked
Comment 3 Jory A. Pratt 2005-12-22 06:59:05 UTC
re-opening until bash-3.1 is completely fixed.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2005-12-22 07:39:22 UTC
*** Bug 116361 has been marked as a duplicate of this bug. ***
Comment 5 SpanKY gentoo-dev 2005-12-22 17:27:58 UTC
cant fix the bug without any real info

post a test case, saying 'net.lo' doesnt work doesnt help

the only proposed test case works fine:
$ foo() { local -a bar=( "$@" ) ; echo ${bar[0]} ; }
$ foo a b c
a
Comment 6 Ulrich Müller gentoo-dev 2005-12-22 23:03:25 UTC
Could someone please change the subject so that this bug will appear as a search result? The package is named "baselayout" and not "basesystem".
Comment 7 Matteo Settenvini 2005-12-23 02:43:22 UTC
In fact, _none_ of my interfaces went up, since starting the init script tried to default to ``dhcp'' for every of those (not finding it, btw). Thus I suspect it is something that has to do with the configuration in /etc/conf.d/net not being correctly ``imported''/splitted in variables in the init script.
Comment 8 Daniel Seyffer 2005-12-23 12:47:45 UTC
Maybe this helps. 

/etc/init.d/net.lo start
* Starting service net.lo
 Cannot default to dhcp as there is no dhcp module loaded
 No configuration for lo                                                                                           [ !! ]
 * FAILED to start service net.lo!
------------------------------------------

sh -x /etc/init.d/net.lo start
+ MODULES_DIR=/net.modules.d
+ background=no
+ source /net.modules.d/helpers.d/functions
/etc/init.d/net.lo: line 32: /net.modules.d/helpers.d/functions: No such file or directory
------------------------------------------

head -n35 /etc/init.d/net.lo
[...]
# Define where our modules are
MODULES_DIR="${svclib}/net.modules.d"
[...]
# Load some functions shared between ourselves and our dhcp helpers
source "${MODULES_DIR}/helpers.d/functions"
[...]
-------------------------------------------
Basically this kills networking and half of the box until I do a manual ifconfig for lo0 (just try starting KDE if DCOP can't access "localhost"... :-/).
Do you need an emerge info?
Comment 9 SpanKY gentoo-dev 2005-12-23 19:49:37 UTC
no, that doesnt help, but i talked with Roy earlier today about it
Comment 10 Martin von Gagern 2006-01-03 08:24:41 UTC
Glad I found this one, I was already starting to write a new bug report...

Problem seems to be that bash executes the steps in the wrong order. For example in expand_parameters:
 1: + b=($( expand_parameters "${a[i]}" ))
 2: ++ expand_parameters '192.168.71.1 netmask 255.255.255.0'
 3: +++ eval echo 192.168.71.1_netmask_255.255.255.0
 4: ++++ echo 192.168.71.1_netmask_255.255.255.0
 5: ++ local x=192.168.71.1_netmask_255.255.255.0
 6: ++ a=(${x})
 7: ++ local -a a
 8: ++ a=("${a[@]/#/\"}")
 9: ++ a=("${a[@]/%/\"}")
10: ++ echo ''

Note that line 6 and 7 would be expected the other way round.
As a workaround, I found out you could first declare the thing and then assign to ist.

--- /lib/rcscripts/net.modules.d/helpers.d/functions~
+++ /lib/rcscripts/net.modules.d/helpers.d/functions
@@ -546,3 +546,4 @@
        local x="$( eval echo ${@// /_} )"
-       local -a a=( ${x} )
+       local -a a
+       a=( ${x} )


By experimenting with wat I first thought was only a problem with expand_parameters, I found another problem. The result from expand_parameters was word split without regard to quotes; I had to eval the result to get the right behaviour:

--- /etc/init.d/net.eth0~
+++ /etc/init.d/net.lo
@@ -539,3 +553,4 @@
        for (( i=0; i<${#a[@]}; i++ )); do 
-               local -a b=( $( expand_parameters "${a[i]}" ) )
+               local -a b
+               eval "b=( $( expand_parameters "${a[i]}" ) )"
                fallback=( "${fallback[@]}" "${b[@]}" )

As for comment #5: Experiments show that there has to be an outer declaration of this variable for the error to show:

$ foo() { local -a bar=( "$@" ) ; echo ${bar[0]} ; }
$ declare -a bar
$ bar=(x y z)
$ foo a b c

$ echo "${bar[*]}"
a b c

I'll now downgrade to bash-3.0*, hope everything will work again then.
Comment 11 Martin von Gagern 2006-01-03 10:31:24 UTC
I just noticed the URL of this bug, which is rather useful.
Obviousely someone already made that observation about the issue with quotes.
I wrote a test case for that myself:

$ foo=( $( echo '"a b" c' ) ); echo ${foo[0]}

Strangely, this line always prints '"a' no matter whether you use bash 3.0 or 3.1. I tweaked the example from the news group and found out, that the behaviour for bash 3.0 (!!) changed depending on whether you used an initializer in the declaration or an assignment later on:

$ declare -a foo=( $( echo '"a b" c' ) ); echo ${foo[0]}
a b
$ declare -a foo; foo=( $( echo '"a b" c' ) ); echo ${foo[0]}
"a

So in this respect the 3.1 way to always ignore quotes is at least consistent, and changing to always split declaration and initialisation and always use eval for the initialisation would result in a version that would work for both 3.0 and 3.1.
Comment 12 SpanKY gentoo-dev 2006-01-03 21:47:01 UTC
bash-3.1-r2 in portage

i'll wait to unmask once Roy has released a baselayout-1.12.0_pre13
Comment 13 Roy Marples (RETIRED) gentoo-dev 2006-01-04 00:20:51 UTC
pre13 is now out
Comment 14 SpanKY gentoo-dev 2006-01-04 07:31:48 UTC
*** Bug 117736 has been marked as a duplicate of this bug. ***
Comment 15 Patrick Fourniols 2006-01-04 10:34:40 UTC
baselayout-1.12.0_pre13 and bash-3.1-r2 problem: on reboot unable to start net.eth0
( gentoo-sources-2.6.14-r6 on 2 PC athlon 32, work on athlon 64 with gentoo-sources-2.6.15 ?! ;) )
workaround: rmmod <module for eth0 8139too for me>
modprobe 8139too ( net.eth0 start with this very well ?! )
start the stopped services manualy...

will look further this evening ;)

for info ;) :
Portage 2.1_pre3-r1 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.5-r3, 2.6.14-gentoo-r6 i686)
=================================================================
System uname: 2.6.14-gentoo-r6 i686 AMD Athlon(tm) XP 1900+
Gentoo Base System version 1.12.0_pre13
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r4
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe"
DISTDIR="/mnt/portage/distfiles"
FEATURES="autoconfig distlocks fixpackages sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="fr_FR.iso885915@euro"
LC_ALL="fr_FR.utf8"
LINGUAS="fr"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/mnt/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowex 3dnowext X Xaw3d a52 aalib acl acpi alsa apache2 apm arts audiofile bash-completion bdf berkdb bitmap-fonts bluetooth bonobo bzip2 cdr clamav crypt cups curl dga dv dvd dvdr dvdread eds emboss encode esd exif expat fam fame ffmpeg flac font-server foomaticdb fortran gd gdbm gecko-sdk gif gimpprint glep glut gmp gnome gnomedb gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal idn imagemagick imap imlib innodb ipalias ipv6 jack java jikes joystick jpeg junit kde krb4 lcms ldap libcaca libg++ libwww lzo mad maildir mailwrapper mdb mhash mikmod mjpeg mmx mmxext mng motif mozilla mp3 mpeg mysql nas ncurses network nls odbc offensive ogg oggvorbis openal opengl oss pam pcre pdflib perl pic png postgres ppds pvm python qt quicktime readline recode samba sasl scanner sdl slang slp speex spell sqlite sse ssl svga tcltk tcpd tetex theora tiff truetype truetype-fonts type1-fonts udev unicode usb v4l vorbis wmf xine xml xml2 xmms xv xvid zlib elibc_glibc kernel_linux linguas_fr userland_GNU"
Unset:  ASFLAGS, CTARGET, LDFLAGS
Comment 16 Martin von Gagern 2006-01-04 10:48:16 UTC
(In reply to comment #15)
> baselayout-1.12.0_pre13 and bash-3.1-r2 problem: on reboot unable to start
> net.eth0

Did you etc-update your net.lo?
What is the output from the init script?
Do you get the same output when manually calling /etc/init.d/net.eth0 start?
What does your /etc/conf.d/net look like?
Comment 17 Patrick Fourniols 2006-01-04 12:14:39 UTC
yes etc-update was run and net-lo start well, just net.eth0 doesn't
/etc/init.d/net.eth0 don't start and say: 
RTNETLINK answers: File exists
same on boot and 'ifconfig -a' show eth0 and so 'ifconfig eth0 up' work also but the script needed by other services is not and prevent others to start ( when a need for eth0 is ;) )

my /etc/conf/net:

##############################################################################
# QUICK-START
#
# The quickest start is if you want to use DHCP.
# In that case, everything should work out of the box, no configuration
# necessary, though the startup script will warn you that you haven't
# specified anything.

#
# WARNING :- some examples have a mixture of IPv4 (ie 192.168.0.1) and IPv6
# (ie 4321:0:1:2:3:4:567:89ab) internet addresses. They only work if you have
# the relevant kernel option enabled. So if you don't have an IPv6 enabled
# kernel then remove the IPv6 address from your config.
#

#
# If you want to use a static address or use DHCP explicitly, jump
# down to the section labelled INTERFACE HANDLERS.
#
# If you want to do anything more fancy, you should take the time to
# read through the rest of this file.

##############################################################################
# DEFAULTS
#
# hotplug_eth0="yes"
# Do we allow hotplug to bring up interfaces or not? The default is we do,
# otherwise put no in the above value.
# NOTE: hotplug just has to be installed for hotplugging to work - it does
# not matter if it's in any runlevel or not.

##############################################################################
# MODULES
#
# We now support modular networking scripts which means we can easily
# add support for new interface types and modules while keeping
# compatability with existing ones.
# 
# Modules load by default if the package they need is installed.  If
# you specify a module here that doesn't have it's package installed
# then you get an error stating which package you need to install.
# Ideally, you only use the modules setting when you have two or more
# packages installed that supply the same service.
#
# In other words, you probably should DO NOTHING HERE...

# Prefer ifconfig over iproute2
#modules=( "iproute2" )

# You can also specify other modules for an interface
# In this case we prefer udhcpc over dhcpcd
#modules_eth0=( "udhcpc" )

# You can also specify which modules not to use - for example you may be
# using a supplicant or linux-wlan-ng to control wireless configuration but
# you still want to configure network settings per ESSID associated with.
#modules=( "!iwconfig" "!wpa_supplicant" )
# IMPORTANT: If you need the above, please disable modules in that order


##############################################################################
# INTERFACE HANDLERS
# 
# We provide two interface handlers presently: ifconfig and iproute2.
# You need one of these to do any kind of network configuration.
# For ifconfig support, emerge sys-apps/net-tools
# For iproute2 support, emerge sys-apps/iproute2

# If you don't specify an interface then we prefer iproute2 if it's installed
# To prefer ifconfig over iproute2
#modules=( "ifconfig" )

# For a static configuration, use something like this
# (They all do exactly the same thing btw)
#config_eth0=( "192.168.0.2/24" )
#config_eth0=( "192.168.0.2 netmask 255.255.255.0" )
config_eth0=( "192.168.3.2/24" )

# We can also specify a broadcast
#config_eth0=( "192.168.0.2/24 brd 192.168.0.255" )
#config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" )

# If you need more than one address, you can use something like this
# NOTE: ifconfig creates an aliased device for each extra IPv4 address
#       (eth0:1, eth0:2, etc)
#       iproute2 does not do this as there is no need to
#config_eth0=(
#	"192.168.0.2/24"
#	"192.168.0.3/24"
#	"192.168.0.4/24"
#)
# Or you can use sequence expresions
#config_eth0=( "192.168.0.{2..4}/24" )
# which does the same as above. Be careful though as if you use this and
# fallbacks, you have to ensure that both end up with the same number of
# values otherwise your fallback won't work correctly.

# You can also use IPv6 addresses
# (you should always specficy a prefix length with IPv6 here)
#config_eth0=(
#	"192.168.0.2/24"
#	"4321:0:1:2:3:4:567:89ab/64"
#	"4321:0:1:2:3:4:567:89ac/64"
#)

# If you wish to keep existing addresses + routing and the interface is up,
# you can specify a noop (no operation). If the interface is down or there
# are no addresses assigned, then we move onto the next step (default dhcp)
# This is useful when configuring your interface with a kernel command line
# or similar
#config_eth0=( "noop" "192.168.0.2/24" )

# If you don't want ANY address (only useful when calling for advanced stuff)
#config_eth0=( "null" )

# Here's how todo routing if you need it
#routes_eth0=(
#	"default via 192.168.0.1"		# IPv4 default route
#	"10.0.0.0/8 via 192.168.0.1"		# IPv4 subnet route
#	"::/0"					# IPv6 unicast
#)
routes_eth0=(
	"default via 192.168.3.1"
)

# If a specified module fails (like dhcp - see below), you can specify a
# fallback like so
#fallback_eth0=( "192.168.0.2 netmask 255.255.255.0" )
#fallback_route_eth0=( "default via 192.168.0.1" )

# NOTE: fallback entry must match the entry location in config_eth0
# As such you can only have one fallback route.

# Some users may need to alter the MTU - here's how
#mtu_eth0="1500"

##############################################################################
# OPTIONAL MODULES

# INTERFACE RENAMING
# There is no consistent device renaming scheme for Linux.
# The preferred way of naming devices is via the kernel module directly or
# by using udev (http://www.reactivated.net/udevrules.php)

# If you are unable to write udev rules, then we do provide a way of renaming
# the interface based on it's MAC address, but it is not optimal.
# Here is how to rename an interface whose MAC address is 00:11:22:33:44:55
# to foo1
#rename_001122334455="foo1"

# You can also do this based on current device name - although this is not
# recommended. Here we rename eth1 to foo2.
#rename_eth1="foo2"

#-----------------------------------------------------------------------------
# WIRELESS (802.11 support)
# Wireless can be provided by iwconfig or wpa_supplicant

# iwconfig
# emerge net-wireless/wireless-tools
# Wireless options are held in /etc/conf.d/wireless - but could be here too
# Consult the sample file /etc/conf.d/wireless.example for instructions
# iwconfig is the default

# wpa_supplicant
# emerge net-wireless/wpa-supplicant
# Wireless options are held in /etc/wpa_supplicant.conf
# Consult the sample file /etc/wpa_supplicant.conf.example for instructions
# To choose wpa_supplicant over iwconfig
#modules=( "wpa_supplicant" )
# To configure wpa_supplicant
#wpa_supplicant_eth0="-Dprism54" # For Prism54 based cards
#wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards
# Consult wpa_supplicant for more drivers
# By default don't wait for wpa_suppliant to associate and authenticate.
# If you would like to, so can specify how long in seconds
#associate_timeout_eth0=60
# A value of 0 means wait forever.

# GENERIC WIRELESS OPTIONS
# PLEASE READ THE INSTRUCTIONS IN /etc/conf.d/wireless.example FOR
# HOW TO USE THIS ESSID VARIABLE
# You can also override any settings found here per ESSID - which is very
# handy if you use different networks a lot
#config_ESSID=( "dhcp" )
#dhcpcd_ESSID="-t 5"

# Setting name/domain server causes /etc/resolv.conf to be overwritten
# Note that if DHCP is used, and you want this to take precedence then
# set dhcp_ESSID="nodns"
#dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" )
#dns_domain_ESSID="some.domain"
#dns_search_ESSID="search.this.domain search.that.domain"
# Please check the man page for resolv.conf for more information
# as domain and search are mutually exclusive.

# You can also override any settings found here per MAC address of the AP
# incase you use Access Points with the same ESSID but need different
# networking configs. Below is an example - of course you use the same
# method with other variables
#mac_config_001122334455=( "dhcp" )
#mac_dhcpcd_001122334455="-t 10"
#mac_dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" )

# When an interface has been associated with an Access Point, a global
# variable called ESSID is set to the Access Point's ESSID for use in the
# pre/post user functions below (although it's not available in preup as you
# won't have associated then)

# If you're using anything else to configure wireless on your interface AND
# you have installed any of the above packages, you need to disable them
#modules=( "!iwconfig" "!wpa_supplicant" )

#-----------------------------------------------------------------------------
# DHCP
# DHCP can be provided by dhcpcd, dhclient, udhcpc or pump
#
# dhclient: emerge net-misc/dhcp
# dhcpcd:   emerge net-misc/dhcpcd
# pump:     emerge net-misc/pump
# udhcpc:   emerge net-misc/udhcp

# If you have more than one DHCP client installed, you need to specify which
# one to use - otherwise we default to dhcpcd if available
#modules=( "udhcpc" ) # to select udhcpc over dhcpcd
#
# Notes:
# - dhcpcd, udhcpc and pump send the current hostname
#   to the DHCP server by default
#   pump always sends the current hostname - see below to disable
#   udhcpc and dhcpcd from doing this
# - dhcpcd does not daemonize when the lease time is infinite
# - udhcp-0.9.3-r3 and earlier does not support getting NTP servers 
# - dhclient does not support getting NTP servers 
# - pump does not support getting NIS servers
# - DHCP tends to erase any existing device information - so add
#   static addresses after dhcp if you need them
# - dhclient and udhcpc can set other resolv.conf options such as "option"
#   and "sortlist"- see the System module for more details

# Regardless of which DHCP client you prefer, you configure them the
# same way using one of following depending on which interface modules
# you're using.
#config_eth0=( "dhcp" )

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.
#dhcpcd_eth0="-t 10"

# dhclient, udhcpc and pump don't have many runtime options
# You can pass options to them in a similar manner to dhcpcd though
#dhclient_eth0="..."
#udhcpc_eth0="..."
#pump_eth0="..."

# To set options for dhclient, you need to have an /etc/dhclient.conf file
# See the dhclient man page for details

# GENERIC DHCP OPTIONS
# Set generic DHCP options like so
#dhcp_eth0="release nodns nontp nonis nogateway nosendhost"

# This tells the dhcp client to release it's lease when it stops, not to
# overwrite dns, ntp and nis settings, not to set a default route and not to
# send the current hostname to the dhcp server and when it starts.
# You can use any combination of the above options - the default is not to
# use any of them.

# DHCLIENT
# dhclient can modify /etc/dhclient.conf (or the file specified by the -cf
# option) with the current hostname and to strip any script lines. To enable
# this, add dhclient_edit_config="yes" to /etc/conf.d/net

#-----------------------------------------------------------------------------
# For APIPA support, emerge net-misc/iputils or net-analyzer/arping

# APIPA is a module that tries to find a free address in the range
# 169.254.0.0-169.254.255.255 by arping a random address in that range on the
# interface. If no reply is found then we assign that address to the interface

# This is only useful for LANs where there is no DHCP server and you don't
# connect directly to the internet.
#config_eth0=( "dhcp" )
#fallback_eth0=( "apipa" )

#-----------------------------------------------------------------------------
# ARPING Gateway configuration 
# and
# Automatic Private IP Addressing (APIPA)
# For arpingnet / apipa support, emerge net-misc/iputils or net-analyzer/arping
#
# This is a module that tries to find a gateway IP. If it exists then we use
# that gateways configuration for our own. For the configuration variables
# simply ensure that each ocet is zero padded and the dots are removed.
# Below is an example.
#
#gateways_eth0="192.168.0.1 10.0.0.1"
#config_192168000001=( "192.168.0.2/24" )
#routes_192168000001=( "default via 192.168.0.1" )
#dns_servers_192168000001=( "192.168.0.1" )
#config_010000000001=( "10.0.0.254/8" )
#routes_010000000001=( "default via 10.0.0.1" )
#dns_servers_010000000001=( "10.0.0.1" )

# If we don't find any gateways (or there are none configured) then we try and
# use APIPA to find a free address in the range 169.254.0.0-169.254.255.255
# by arping a random address in that range on the interface. If no reply is
# found then we assign that address to the interface.

# This is only useful for LANs where there is no DHCP server.
#config_eth0=( "arping" )

# or if no DHCP server can be found
#config_eth0=( "dhcp" )
#fallback_eth0=( "arping" )

#-----------------------------------------------------------------------------
# VLAN (802.1q support)
# For VLAN support, emerge net-misc/vconfig

# Specify the VLAN numbers for the interface like so
# Please ensure your VLAN IDs are NOT zero-padded
#vlans_eth0="1 2"

# You may not want to assign an IP the the physical interface, but we still
# need it up.
#config_eth0=( "null" )

# You can also configure the VLAN - see for vconfig man page for more details
#vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" )
#vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" )
#config_vlan1=( "172.16.3.1 netmask 255.255.254.0" )
#config_vlan2=( "172.16.2.1 netmask 255.255.254.0" )

# NOTE: Vlans can be configured with a . in their interface names
# When configuring vlans with this name type, you need to replace . with a _
#config_eth0.1=( "dhcp" ) - does not work
#config_eth0_1=( "dhcp" ) - does work

# NOTE: Vlans are controlled by their physical interface and not per vlan
# This means you do not need to create init scripts in /etc/init.d for each
# vlan, you must need to create one for the physical interface.

#-----------------------------------------------------------------------------
# Bonding
# For link bonding/trunking emerge net-misc/ifenslave

# To bond interfaces together
#slaves_bond0="eth0 eth1 eth2"
#config_bond0=( "null" ) # You may not want to assign an IP the the bond

# If any of the slaves require extra configuration - for example wireless or
# ppp devices - we need to write a depend function for the bond so they get
# configured correctly.
# This is exactly the same as a depend() function in our init scripts
#depend_br0() {
#       need net.eth0 net.eth1
#}


#-----------------------------------------------------------------------------
# PPP
# For PPP support, emerge net-dialup/ppp
# PPP is used for most dialup connections, including ADSL.
# The older ADSL module is documented below, but you are encouraged to try
# this module first.
#
# You need to create the PPP net script yourself. Make it like so
#cd /etc/init.d
#ln -s net.lo net.ppp0
#
# We have to instruct ppp0 to actually use ppp
#config_ppp0=( "ppp" )
#
# Each PPP interface requires an interface to use as a "Link"
#link_ppp0="/dev/ttyS0" 		# Most PPP links will use a serial port
#link_ppp0="eth0"       		# PPPoE requires an ethernet interface
#link_ppp0="/dev/null"			# PPPoA and ISDN links should have this
#link_ppp0="pty $(your_link_command)"	# PPP links over ssh, rsh, etc
#
# Here you should specify what pppd plugins you want to use
# Available plugins are: pppoe, pppoa, capi, dhcpc, minconn, radius,
#			 radattr, radrealms and winbind 
#plugins_ppp0=(
#	"pppoe"	# Required plugin for PPPoE
#	"pppoa"	# Required plugin for PPPoA
#	"capi"	# Required plugin for ISDN
#)
#
# PPP requires at least a username. You can optionally set a password here too
# If you don't, then it will use the password specified in /etc/ppp/*-secrets
# against the specified username
#username_ppp0='user'
#password_ppp0='password'
#
# The PPP daemon has many options you can specify - although there are many
# and may seem daunting, it is recommended that you read the pppd man page
# before enabling any of them
#pppd_ppp0=(
#	"updetach" 	# WARNING: If you don't specify this then we will
#			# not wait for the actual PPP link to go up
#	"debug" 	# Enables syslog debugging
#	"noauth"	# Do not require the peer to authenticate itself
#	"defaultroute"	# Make this PPP interface the default route
#	"usepeerdns"	# Use the DNS settings provided by PPP
#
# On demand options
#	"demand"		# Enable dial on demand
#	"idle 30"		# Link goes down after 30 seconds of inactivity
#	"10.112.112.112:10.112.112.113"	# Phony IP addresses
#	"ipcp-accept-remote"	# Accept the peers idea of remote address
#	"ipcp-accept-local"	# Accept the peers idea of local address
#	"holdoff 3" 	# Wait 3 seconds after link dies before re-starting
#
# Dead peer detection
#	"lcp-echo-interval 15"	# Send a LCP echo every 15 seconds
#	"lcp-echo-failure 3"	# Make peer dead after 3 consective
#				# echo-requests
#	
# Compression options - use these to completely disable compression
#	noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp
#
# Dial-up settings
#	"lock"				# Lock serial port
#	"115200"			# Set the serial port baud rate
#	"modem crtscts"			# Enable hardware flow control
#	"192.168.0.1:192.168.0.2"	# Local and remote IP addresses
#)
#
# Dial-up PPP users need to specify at least one telephone number
#phone_number_ppp0=( "12345689" ) # Maximum 2 phone numbers are supported
# They will also need a chat script - here's a good one
#chat_ppp0=(
#	'ABORT' 'BUSY'
#	'ABORT' 'ERROR'
#	'ABORT' 'NO ANSWER'
#	'ABORT' 'NO CARRIER'
#	'ABORT' 'NO DIALTONE'
#	'ABORT' 'Invalid Login'
#	'ABORT' 'Login incorrect'
#	'TIMEOUT' '5'
#	'' 'ATZ'
#	'OK' 'AT' # Put your modem initialization string here
#	'OK' 'ATDT\T'
#	'TIMEOUT' '60'
#	'CONNECT' ''
#	'TIMEOUT' '5'
#	'~--' ''
#)

#-----------------------------------------------------------------------------
# ADSL
# For ADSL support, emerge net-dialup/rp-pppoe
# WARNING: This ADSL module is being deprecated in favour of the PPP module
# above.
# You should make the following settings and also put your
# username/password information in /etc/ppp/pap-secrets

# Configure the interface to use ADSL
#config_eth0=( "adsl" )

# You probably won't need to edit /etc/ppp/pppoe.conf if you set this
#adsl_user_eth0="my-adsl-username"

#-----------------------------------------------------------------------------
# ISDN
# For ISDN support, emerge net-dialup/isdn4k-utils
# You should make the following settings and also put your
# username/password information in /etc/ppp/pap-secrets

# Configure the interface to use ISDN
#config_ippp0=( "dhcp" )
# It's important to specify dhcp if you need it!
#config_ippp0=( "192.168.0.1/24" )
# Otherwise, you can use a static IP

# NOTE: The interface name must be either ippp or isdn followed by a number

# You may need this option to set the default route
#ipppd_eth0="defaultroute"

#-----------------------------------------------------------------------------
# MAC changer
# To set a specific MAC address
#mac_eth0="00:11:22:33:44:55"

# For changing MAC addresses using the below, emerge net-analyzer/macchanger
# - to randomize the last 3 bytes only
#mac_eth0="random-ending"
# - to randomize between the same physical type of connection (eg fibre,
# copper, wireless) , all vendors
#mac_eth0="random-samekind"
# - to randomize between any physical type of connection (eg fibre, copper,
# wireless) , all vendors
#mac_eth0="random-anykind"
# - full randomization - WARNING: some MAC addresses generated by this may NOT
# act as expected
#mac_eth0="random-full"
# custom - passes all parameters directly to net-analyzer/macchanger
#mac_eth0="some custom set of parameters"

# You can also set other options based on the MAC address of your network card
# Handy if you use different docking stations with laptops
#config_001122334455=( "dhcp" )

#-----------------------------------------------------------------------------
# TUN/TAP
# For TUN/TAP support emerge sys-apps/usermode-utilities
#
# NOTE: The interface name must be either tun or tap followed by a number
#config_tun1=( "192.168.0.1/24")

# For passing custom options to tunctl use something like the following.  This
# example sets the owner to adm
#tunctl_tun1="-u adm"

#-----------------------------------------------------------------------------
# Bridging (802.1d)
# For bridging support emerge net-misc/bridge-utils

# To add ports to bridge br0
#bridge_br0="eth0 eth1"
# or dynamically add them when the interface comes up
#bridge_add_eth0="br0"
#bridge_add_eth1="br0"

# You need to configure the ports to null values so dhcp does not get started 
#config_eth0=( "null" )
#config_eth1=( "null" )

# Finally give the bridge an address - dhcp or a static IP
#config_br0=( "dhcp" ) # may not work when adding ports dynamically
#config_br0=( "192.168.0.1/24" )

# If any of the ports require extra configuration - for example wireless or
# ppp devices - we need to write a depend function for the bridge so they get
# configured correctly.
# This is exactly the same as a depend() function in our init scripts
#depend_br0() {
#	need net.eth0 net.eth1
#}

# NOTE: This creates an interface called br0 - you can give the interface
# any name you like

# Below is an example of configuring the bridge
# Consult "man brctl" for more details
#brctl_br0=( "setfd 0" "sethello 0" "stp off" )

#-----------------------------------------------------------------------------
# Tunnelling
# For GRE tunnels
#iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255"

# For IPIP tunnels
#iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255"

# To configure the interface
#config_vpn0=( "192.168.0.2 pointopoint 192.168.1.2" )	# ifconfig style
#config_vpn0=( "192.168.0.2 peer 192.168.1.1" )		# iproute2 style

#-----------------------------------------------------------------------------
# System
# For configuring system specifics such as domain, dns, ntp and nis servers
# It's rare that you would need todo this, but you can anyway.
# This is most benefit to wireless users who don't use DHCP so they can change
# their configs based on ESSID. See wireless.example for more details

# To use dns settings such as these, dns_servers_eth0 must be set!
# If you omit the _eth0 suffix, then it applies to all interfaces unless
# overridden by the interface suffix.
#dns_domain_eth0="your.domain"
#dns_servers_eth0="192.168.0.2 192.168.0.3"
#dns_search_eth0="this.domain that.domain"
#dns_options_eth0=( "timeout 1" "rotate" )
#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"
# See the man page for resolv.conf for details about the options and sortlist
# directives

#ntp_servers_eth0="192.168.0.2 192.168.0.3"

#nis_domain_eth0="domain"
#nis_servers_eth0="192.168.0.2 192.168.0.3"

#-----------------------------------------------------------------------------
# Cable in/out detection
# Sometimes the cable is in, others it's out. Obviously you don't want to
# restart net.eth0 every time when you plug it in either.
#
# netplug is a package that detects this and requires no extra configuration
# on your part.
# emerge sys-apps/netplug
# or
# emerge sys-apps/ifplugd
# and you're done :)

# By default we don't wait for netplug/ifplugd to configure the interface.
# If you would like it to wait so that other services now that network is up
# then you can specify a timeout here.
#plug_timeout="10"
# A value of 0 means wait forever.

# If you don't want to use netplug on a specific interface but you have it
# installed, you can disable it for that interface via the modules statement
#modules_eth0=( "!netplug" )
# You can do the same for ifplugd
#
# You can disable them both with the generic plug
#modules_eth0=( "!plug" )

# To use specific ifplugd options, fex specifying wiress mode
#ifplugd_eth0="--api-mode wlan"
# man ifplugd for more options

##############################################################################
# ADVANCED CONFIGURATION
# 
# Four functions can be defined which will be called surrounding the
# start/stop operations.  The functions are called with the interface
# name first so that one function can control multiple adapters. An extra two
# functions can be defined when an interface fails to start or stop.
#
# The return values for the preup and predown functions should be 0
# (success) to indicate that configuration or deconfiguration of the
# interface can continue.  If preup returns a non-zero value, then
# interface configuration will be aborted.  If predown returns a
# non-zero value, then the interface will not be allowed to continue
# deconfiguration.
#
# The return values for the postup, postdown, failup and faildown functions are
# ignored since there's nothing to do if they indicate failure.
#
# ${IFACE} is set to the interface being brought up/down
# ${IFVAR} is ${IFACE} converted to variable name bash allows

#preup() {
#	# Test for link on the interface prior to bringing it up.  This
#	# only works on some network adapters and requires the mii-diag
#	# package to be installed.
#	if mii-tool "${IFACE}" 2> /dev/null | grep -q 'no link'; then
#		ewarn "No link on ${IFACE}, aborting configuration"
#		return 1
#	fi 
#
#	# Test for link on the interface prior to bringing it up.  This
#	# only works on some network adapters and requires the ethtool
#	# package to be installed.
#	if ethtool "${IFACE}" | grep -q 'Link detected: no'; then
#		ewarn "No link on ${IFACE}, aborting configuration"
#		return 1
#	fi
#
#
#	# Remember to return 0 on success
#	return 0
#}

#predown() {
#	# The default in the script is to test for NFS root and disallow
#	# downing interfaces in that case.  Note that if you specify a
#	# predown() function you will override that logic.  Here it is, in
#	# case you still want it...
#	if is_net_fs /; then
#		eerror "root filesystem is network mounted -- can't stop ${IFACE}"
#		return 1
#	fi
#
#	# Remember to return 0 on success
#	return 0
#}

#postup() {
#	# This function could be used, for example, to register with a
#	# dynamic DNS service.  Another possibility would be to
#	# send/receive mail once the interface is brought up.
#	return 0
#}

#postdown() {
#	# Enable Wake-On-LAN for every interface except for lo
#	# Probably a good idea to set RC_DOWN_INTERFACE="no" in /etc/conf.d/rc
#	# as well ;)
#	[[ ${IFACE} != "lo" ]] && ethtool -s "${IFACE}" wol g
#
#	# Return 0 always
#	return 0
#}

#failup() {
#       # This function is mostly here for completeness... I haven't
#       # thought of anything nifty to do with it yet ;-)
#}

#faildown() {
#       # This function is mostly here for completeness... I haven't
#       # thought of anything nifty to do with it yet ;-)
#}

##############################################################################
# FORCING MODULES
# The Big Fat Warning :- If you use module forcing do not complain to us or
# file bugs about it not working!
#
# Loading modules is a slow afair - we have to check each one for the following
# 1) Code sanity
# 2) Has the required package been emerged?
# 3) Has it modified anything?
# 4) Have all the dependant modules been loaded?

# Then we have to strip out the conflicting modules based on user preference
# and default configuration and sort them into the correct order.
# Finally we check the end result for dependancies.

# This, of course, takes valuable CPU time so we provide module forcing as a
# means to speed things up. We still do *some* checking but not much.

# It is essential that you force modules in the correct order and supply all
# the modules you need. You must always supply an interface module - we
# supply ifconfig or iproute2.

# The Big Fat Warning :- If you use module forcing do not complain to us or
# file bugs about it not working!

# Now that we've warned you twice, here's how to do it
#modules_force=( "ifconfig" )
#modules_force=( "iproute2" "dhcpcd" )

# We can also apply this to a specific interface
#modules_force_eth1=( "iproute2" )

# The below will not work
#modules_force=( "dhcpcd" )
# No interface (ifconfig/iproute2)
#modules_force=( "ifconfig" "essidnet" "iwconfig" )
# Although it will not crash, essidnet will not work as it has to come after
# iwconfig
#modules_force=( "iproute2" "ifconfig" )
# The interface will be setup twice which will cause problems
Comment 18 Patrick Fourniols 2006-01-04 12:19:03 UTC
in fact net.eth0 breaks lan when starting, something brings eth0 up before it, but not by the script will reboot another time to see if i could figure what, have nothing in system logs ;)
Comment 19 Patrick Fourniols 2006-01-04 12:41:06 UTC
yes that is ;)
rc-update del net.eth0
reboot and all works fine... but
'/etc/init.d/net.eth0 status' say "stopped"
ifconfig and route are very well configured... amasing not? ;)
Comment 20 Patrick Fourniols 2006-01-04 13:41:37 UTC
sorry for all this :(
putting hotplug_eth0="no" to /etc/conf.d/net and re-adding net.eth0 to defaults
all works very fine after a reboot
i will read slower next time, i promise ;)
and for athlon x64 coldplug not installed so... ;)
Comment 21 Patrick Fourniols 2006-01-04 14:21:15 UTC
putting coldplug in boot runlevel and not in default one do better than putting
hotplug_eth0="no" in /etc/conf.net :(
sorry for all this :(
Comment 22 Thomas Bettler 2006-01-05 11:23:01 UTC
Created attachment 76255 [details, diff]
essidnet-expand.patch

Hmm, I still get not working connection, because /etc/resolv.conf contains broken values due to an expansion error in essidnet module.