Bug#367264: mapping clause now useless; please remove
Package: netcfg
Severity: normal
A bit of history for reference can be found in bug #340935 .
If the interface set up should be brought up upon detection by a
hotplugging mechanism, netcfg inserts the following clause into the
generated /etc/network/interfaces file:
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping eth0
script grep
map eth0
(This is written by netcfg_write_common() in netcfg-common.c.)
Now, I believe this is cruft code left over from the old hotplugging
system. I believe that the way it used to work was that you would have
something like...
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0
map eth2
Then, when the first network was hotplugged, hotplug would go
ifup eth0=hotplug
ifup would look through /etc/network/interfaces looking for the
definition of the logical interface hotplug. It would find the mapping
clause and would proceed to call the script named by the script
definition with the physical interface as the argument and it would send
the lines marked by map to its standard input. That is, it would see
hotplug was a mapping logical interface, it would call
grep eth0
and write to grep's standard input
eth0
eth2
At this point, grep would return the line
eth0
which ifup would use then as the logical interface to bring up the
physical eth0 as. (That is, ifup would transform ifup eth0=hotplug into
ifup eth0=eth0.)
Note that the same thing would be done for eth2.
Note however, that upon hotplugging the second network card, physical
interface eth1, ifup eth1=hotplug would get nothing back from grep. ifup
would take this as a sign that eth1 should not be brought up under the
current conditions.
(This is why the comment says that the mapping clause is there to
contain a list of hotpluggable interfaces.)
Unfortunately, all of this was lost in the fix to shift to allow-hotplug
to mark hotpluggable interfaces (see the bug referenced above). Now
we're left with netcfg putting a totally useless mapping clause with an
utterly confusing associated comment into the default installed
/etc/network/interfaces...
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Reply to: