From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alexander E. Patrakov" Date: Sun, 25 Jun 2006 03:07:58 +0000 Subject: Re: swapping interface names (again) Message-Id: <449DFE0E.5090208@ums.usu.ru> List-Id: References: <449C9C3D.30601@bham.ac.uk> In-Reply-To: <449C9C3D.30601@bham.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org juuso.alasuutari@tamperelainen.org wrote: > I accidentally only sent my message to Marco. Here it is for the list also: > > Quoting Marco d'Itri : > >> On Jun 24, MS Colclough wrote: >> >>> imply that the whole process can be done by some udev rules that run >>> at boot time? If so, how please? >> Look at the Debian package for a simple script which generates rules on >> demand. > > It's of course easy to write a script that creates something like > z99-network.rules. But what should it contain? > > If I have eth0 and eth1, and want to swap their names, I first need to rename > them to e.g. tempeth0 and tempeth1, and then to eth1 and eth0. But what kind of > rule would recognise when all temporary names are created and apply the final > ones? Don't look at the Debian package. It is very likely to contain this problem, because for my single-card setup, Debian udev 0.093-1 writes: # This file was automatically generated by the /lib/udev/write_net_rules # program, probably run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single line. # PCI device 10ec:8139 (8139too) SUBSYSTEM="net", DRIVER="?*", SYSFS{address}="00:e0:4c:7c:4a:d3", NAME="eth0" Of course this will break if I a new card in such a way (read: PCI slot) so that without this rule it becomes eth0. Then this rule will attempt to rename my old card to eth0, and boom... there is already eth0. And I don't know any solution that allows eth%d as a final name. -- Alexander E. Patrakov Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel