[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hotplug and ifup



At Mon, 3 Mar 2003 16:43:35 +1000,
Anthony Towns wrote:

> > I've uploaded new hotplug yesterday.
> > Anthony Towns wrote:
> > > That aside, hotplug could quite easily call "ifup eth0=hotplug"; allowing
> > > you to have "mapping hotplug" to handle any further details.
> > I modified net.agent like this, but how do we configure 
> > /etc/network/interfaces?  I can't find any documentation
> > about eth0=hotplug for iface in ifupdown manuals.
> 
> Wow, that's dodgy. "ifup eth0=hotplug" sets the physical interface
> to eth0 and the logical interface to "hotplug", then runs the mapping
> scripts in the usual manner. Doing:
> 
> 	mapping hotplug
> 		script /usr/lib/hotplug/deal-with-hotplug-devs.sh
> 		map eth0 eth0
> 
> as the first thing in your /e/n/interfaces, and:
> 
> 	$ cat /usr/lib/hotplug/deal-with-hotplug-devs.sh
> 	#!/bin/sh
> 
> 	if="$1"
> 	out=""
> 	while read phys log; do
> 		if [ "$phys" = "$if" ]; then out="$log"; fi
> 	done
> 	if [ "" = "$out" ]; then
> 		exit 1
> 	else
> 		echo "$out"
> 		exit 0
> 	fi
> 
> then eth0 will be treated normally when hotplugged, and other devices will
> fail when hotplugged (because there's no "iface hotplug ..." line for them
> to be configured as).
> 
> That's probably not terribly comprehensible.

Thanks,  I'll add this information to hotplug's README.Debian
and provide this script in hotplug.

Regards,
Fumitoshi UKAI



Reply to: