From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SDJrx-0004PX-Gr for garchives@archives.gentoo.org; Thu, 29 Mar 2012 18:14:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3B78E0CD8; Thu, 29 Mar 2012 18:14:06 +0000 (UTC) Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.120]) by pigeon.gentoo.org (Postfix) with ESMTP id 0DF52E0CB9 for ; Thu, 29 Mar 2012 18:10:40 +0000 (UTC) X-Authority-Analysis: v=2.0 cv=Hvb06jvS c=1 sm=0 a=xvUQ5II7JMRnhGkbsebX1A==:17 a=txVIi73YdL4A:10 a=dAWy6oC7cIwA:10 a=6WvLBrxrMboA:10 a=wPDyFdB5xvgA:10 a=Uxmo08gEHq4A:10 a=kj9zAlcOel0A:10 a=qpUN3CYCGdBXJrhvhBcA:9 a=YS9e0XbSkb9x89mR8LUA:7 a=CjuIK1q_8ugA:10 a=knyxtoVKISQA:10 a=xvUQ5II7JMRnhGkbsebX1A==:117 X-Cloudmark-Score: 0 X-Originating-IP: 97.102.250.187 Received: from [97.102.250.187] ([97.102.250.187:41865] helo=basement.kutulu.org) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id D6/F3-16302-B95A47F4; Thu, 29 Mar 2012 18:10:35 +0000 Received: from localhost (basement.kutulu.org [127.0.0.1]) by basement.kutulu.org (Postfix) with ESMTP id 3571C7D801C for ; Thu, 29 Mar 2012 14:10:35 -0400 (EDT) X-Virus-Scanned: amavisd-new at kutulu.org Received: from basement.kutulu.org ([127.0.0.1]) by localhost (basement.kutulu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dCQ_7UV-Ex-B for ; Thu, 29 Mar 2012 14:10:34 -0400 (EDT) Received: from MIKEDESKTOP (173.221.47.98.nw.nuvox.net [173.221.47.98]) by basement.kutulu.org (Postfix) with ESMTPSA id 290AD7D801B for ; Thu, 29 Mar 2012 14:10:34 -0400 (EDT) From: "Mike Edenfield" To: References: <20120327133728.GA3754@acm.acm> <01c301cd0c22$2fac1300$8f043900$@kutulu.org> <20120327142646.GB3754@acm.acm> <20120327154620.21440f87@digimed.co.uk> <86iphq0vza.fsf@jane.chrekh.se> <003e01cd0c53$a2e99b90$e8bcd2b0$@kutulu.org> <20120327212422.GA3437@acm.acm> <20120327234819.45111444@khamul.example.com> <20120327223544.GC3437@acm.acm> <01bf01cd0c9a$a2259000$e670b000$@kutulu.org> <20120329155628.GC2961@acm.acm> In-Reply-To: <20120329155628.GC2961@acm.acm> Subject: RE: [gentoo-user] Re: After /usr conflation: why not copy booting software to /sbin rather than initramfs? Date: Thu, 29 Mar 2012 14:10:32 -0400 Message-ID: <004c01cd0dd7$3c15be00$b4413a00$@kutulu.org> 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Content-Language: en-us Thread-Index: AQI/1jabVc9z4KztcH5BI3TVjfITpACvZDz7AkNeK7YBmHYhQgIbZbNhAhkYx3wCePxdQQHO769eAkmaZGoB13NcvwEzZI/nlQkblgA= X-Archives-Salt: 6527ed0a-0e16-40bd-bd56-e78187a1b0fa X-Archives-Hash: bed33b690aa82417d36e146a4e425a0e > From: Alan Mackenzie [mailto:acm@muc.de] > Hi, Mike. > > On Wed, Mar 28, 2012 at 12:24:14AM -0400, Mike Edenfield wrote: > > > From: Alan Mackenzie [mailto:acm@muc.de] > > > > Hi, Alan. > > > > On Tue, Mar 27, 2012 at 11:48:19PM +0200, Alan McKinnon wrote: > > > > On Tue, 27 Mar 2012 21:24:22 +0000 Alan Mackenzie > > > > wrote: > > > > Why is nobody else on this thread willing to take up its main point, > > > the exact equivalence between the known, ugly, initramfs solution > > > and the as yet half-baked idea of putting the same binaries into /sbin? > > > Well, for one, the initramfs solution is not generally considered "ugly" > > except by a select vocal few who object to it on vague, unarticulated > > grounds. > > I'll articulate a few. (i) The initramfs involves having two copies of lots of > software around. (ii) What's more, these two copies are often different, one > being built with static libraries, the other with dynamic ones. (iii) This > situation is not (as far as I know) yet handled by Portage, which means in > building such software statically, you've got to save the dynamic version > somewhere else whilst you're doing it. (iv) The initramfs requires a > potentially long script to make it work. > My idea was for /sbin to vanish from $PATH just as soon as the boot had > been completed; PATH gets set anyway on the initialisation of something or > other, so this would happen automatically, just like the initramfs disappears > when the switch_root is done. The criticisms you made about an initramfs are valid, and your basic point is correct: the ugliness of having a "shadow /sbin" is no worse than the ugliness of an initramfs. I admit that much of my criticism here is not of the idea but of trying to come up with a working implementation. The major benefit of an initramfs solution is that it fits into the existing Linux boot process with minimal impact: all of the ugliness you pointed out vanishes as soon as it has completed its work, and the existing /sbin/init startup code is launched exactly as it would be without an initramfs. Your process would require either changing that existing /sbin/init process, or changing the steps the kernel takes on startup, in ways that I can't articulate because I haven't gone through the exercise of making it work. Taking /sbin out of the path, though works for me. As I understand it, /sbin *used* to be for "static binaries", and only later did it retroactively become "system binaries", which is silly. That's what DAC is for. The only benefit of a separate /bin and /sbin is to have different binaries with the same name in both places, which is just begging for trouble. Your approach actually seems to be bringing /sbin back to its roots. :) I can think of a few useful options, though; perhaps what you're calling /sbin is actually /boot/bin; like now, /boot is rarely mounted once the live system comes up. Perhaps the kernel is configured to look for and run a /boot/bin/init before it tries to mount it's rootfs. You are basically replicating the initramfs solution, just on the boot partition, as this is almost exactly what happens now. Alternatively, perhaps /sbin/init can get smarter; much of this problems with getting /usr mounted at the right time stems from difficulties in expressing the required order and dependency information in the init scripts. If /sbin/init could be explicitly told "this is the 'mount my /usr' script" and knew to run it or not, based on the existence of a /usr mount point, that could happen very early in the boot process. > > [ more criticism, a lot of which I accept. ] > > I think I have the elegant solution: that would be for the kernel to be able to > mount several partitions at system initialisation rather than just the root > partition. With this, all the issues we've been discussing simply wouldn't > arise. That's one possible solution; I think there are several places where the kernel could potentially be made "smarter" about what is going on in the userland environment; for example, if udev always received block device events first, *it* could be tasked with mounting /usr when it saw that /dev/sda3 was available and in /etc/fstab, then it could happily run alsaconf or bluetoothd or whatever else when those devices popped up. I also admit I don't really understand autofs too much, but it seems like automounter support should be able to do something like this as well. Keep in mind, though, that the point of an initramfs is not to get /usr mounted. It's to get / mounted; if your rootfs happens to be on some hardware, network, or logical block device that needs special handling before it can be used, you need *somewhere* to put those utilities that the kernel can find them. The fact that you can also use an initramfs for all of these other pre-init steps is just added benefit. --Mike