From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E25231381F3 for ; Fri, 7 Jun 2013 08:08:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C43B3E09F6; Fri, 7 Jun 2013 08:07:57 +0000 (UTC) Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com [209.85.215.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2DE26E09DA for ; Fri, 7 Jun 2013 08:07:55 +0000 (UTC) Received: by mail-ea0-f181.google.com with SMTP id a15so882051eae.12 for ; Fri, 07 Jun 2013 01:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=y6vTSQounohSjfhJx7HaNmu1+hFHMJckUhiomZCPAbM=; b=umMPdcZWbH8GNrhlDSu/7jqPXB8Z4L/SQWr3L2BBedZCwXMZjNb+pIVy68SXnfUeRo qFzwp9vsybHDZ5rSnTybOhVXrAWg1KKeCTyjRCychH4P0yP4U8ov53twG+EJOy2kAZ7Q svr8lpURtvfRPrfte95WmRefWj5G65lJOUe2hi0nk+SoV0piBKsshCJ0xVAGAeic99uT kd/oX/6AlvxxSe877ytlX5xGSu1fb4k488023akexZHN6fVWRdRNNerVOM4XIem8tfrY k1tALpsbMDi3XoX3jyn3ACDMb9ejatQtyr1Tp470H5t0RGhqqPtRM5oQGSw85RZD8I8N xXBg== X-Received: by 10.14.109.133 with SMTP id s5mr37510935eeg.127.1370592474462; Fri, 07 Jun 2013 01:07:54 -0700 (PDT) Received: from [10.1.20.205] (dustpuppy.is.co.za. [196.14.169.11]) by mx.google.com with ESMTPSA id cf47sm7808991eeb.17.2013.06.07.01.07.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Jun 2013 01:07:53 -0700 (PDT) Message-ID: <51B19497.9080108@gmail.com> Date: Fri, 07 Jun 2013 10:06:47 +0200 From: Alan McKinnon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130518 Thunderbird/17.0.6 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Without udev, who/what names ethernet devices? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 6ddaf4b3-bba2-42bb-b39e-c55f0c0e20b1 X-Archives-Hash: b48d9b2c9a9500baec00690efb9f5cf8 On 07/06/2013 06:12, Chris Stankevitz wrote: > Hello, > > A USB serial device is identified by the characters "/dev/ttyUSB0". > One might call this string a "device on your filesystem" and it can be > opened/closed just like any other entry in the filesystem. > > An ethernet device is sometimes represented by the string "eth0". > Regarding this string "eth0": > > 1. What does this string represent? Is it a file on a filesystem? > (no!) Is it okay for me to call it an "ethernet *device*" It's just a name. Your name is Chris, mine is Alan and it's is eth0. We usually just call it an interface > > 2. Assuming udev is not running, who/what comes up with the name > "eth0"? How does that person/thing know how many ethernet devices > there are and in what order to enumerate them? What happens if > ethernet devices are dynamically added (e.g. a USB ethernet device or > a driver being loaded/unloaded)? The kernel driver gives it that name based on what it finds when it probes your hardware. Kernel drivers strives for some form of consistency in picking names, but the order they are found in is somewhat random-ish. This means you cannot guarantee that the number on the end is always going to be the same every boot - hardware just does not work that way When you hotplug a device, the driver does what it's coded to do - usually assign the next available number. There is no guarantee all drivers will always do this always - it's by convention > > 3. How does (2) change when udev is running? Depends. If you like the kernel naming scheme and want to keep it, just tell udev to not fiddle with names and keep them as they are. If you like the way udev does things and want to go with it's scheme, follow recent recommendations on this list. udev will rename the interfaces to it's own scheme based on the rules you set up. What you CANNOT do with udev is eg switch the names eth0 and eth1 around after the kernel has named them. That was tried for years, it doesn't work. So now udev never interferes with kernel namespace, it create it's own namespace For more info, research this list going back about 4 months. The whole topic was discussed at length. Search for "udev persistent names". A word of warning - it wasn't pretty at the time and nothing changed just becuase those mails are now archived :-) -- Alan McKinnon alan.mckinnon@gmail.com