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 1SCYNc-0002fU-4l for garchives@archives.gentoo.org; Tue, 27 Mar 2012 15:32:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95F40E085E; Tue, 27 Mar 2012 15:31:56 +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 DBB8CE064F for ; Tue, 27 Mar 2012 15:30:31 +0000 (UTC) X-Authority-Analysis: v=2.0 cv=bLSU0YCZ c=1 sm=0 a=xvUQ5II7JMRnhGkbsebX1A==:17 a=txVIi73YdL4A:10 a=90LHd8UXH9IA:10 a=6WvLBrxrMboA:10 a=wPDyFdB5xvgA:10 a=Uxmo08gEHq4A:10 a=kj9zAlcOel0A:10 a=FXl7oC_VRlZ2rj7uZO8A:9 a=d4N0oZqHqYNbljNox6QA:7 a=CjuIK1q_8ugA:10 a=knyxtoVKISQA:10 a=9cmi1Dz5wSCuIW5i:21 a=3jxt5x5bQN_gSxRB:21 a=xvUQ5II7JMRnhGkbsebX1A==:117 X-Cloudmark-Score: 0 X-Originating-IP: 97.102.250.187 Received: from [97.102.250.187] ([97.102.250.187:39592] helo=basement.kutulu.org) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id CF/F5-29249-71DD17F4; Tue, 27 Mar 2012 15:30:31 +0000 Received: from localhost (basement.kutulu.org [127.0.0.1]) by basement.kutulu.org (Postfix) with ESMTP id 1B8627D801C for ; Tue, 27 Mar 2012 11:30:31 -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 pMeSGnOv7b5o for ; Tue, 27 Mar 2012 11:30:30 -0400 (EDT) Received: from MIKEDESKTOP (173.221.47.98.nw.nuvox.net [173.221.47.98]) by basement.kutulu.org (Postfix) with ESMTPSA id 1E5717D801B for ; Tue, 27 Mar 2012 11:30:30 -0400 (EDT) From: "Mike Edenfield" To: References: <20120327133728.GA3754@acm.acm> <01c301cd0c22$2fac1300$8f043900$@kutulu.org> <20120327142646.GB3754@acm.acm> In-Reply-To: <20120327142646.GB3754@acm.acm> Subject: RE: [gentoo-user] After /usr conflation: why not copy booting software to /sbin rather than initramfs? Date: Tue, 27 Mar 2012 11:30:29 -0400 Message-ID: <01ed01cd0c2e$8af344c0$a0d9ce40$@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 Thread-Index: AQI/1jabVc9z4KztcH5BI3TVjfITpACvZDz7AkNeK7aVgQrYQA== Content-Language: en-us X-Archives-Salt: ad20943b-8841-4ce5-acda-d1abb344335e X-Archives-Hash: 8232df7bb2facdb3215b68aef4d35321 > From: Alan Mackenzie [mailto:acm@muc.de] > Sent: Tuesday, March 27, 2012 10:27 AM > > On Tue, Mar 27, 2012 at 10:02:02AM -0400, Mike Edenfield wrote: > > > From: Alan Mackenzie [mailto:acm@muc.de] > > > Sent: Tuesday, March 27, 2012 9:37 AM > > > > My question: what, technically, prevents me from copying the booting > > > software instead to /sbin and booting the system that way? > > > Nothing; in fact, this was the general solution to the problem of > > "something else in /usr/{sbin,bin,lib} is needed at boot" for a long > > time. More and more software was getting moved into /{s,}bin, and in > > particular into /lib, to make it available in the early boot stages. > > > There's nothing wrong with that, as long as you can ensure that any > > hard-coded paths to those binaries are updated properly. > > Surely this is the same, whether one copies the booting software to initramfs > or /sbin, isn't it? No, because very little of my booting software is on my initramfs; it contains the kernel modules for my SATA drive and a script to mount /usr before launching /sbin/init. You *could* build an initramfs that included all of those other items, including udev and fsck tools if you wanted to, but you don't have to. (You might want to, for example, to have a more fully-features rescue shell, but I have a LiveCD for that.) The difference is what part of the booting process you need the software for. Without an initramfs, your boot loader loads your kernel, your kernel launches /sbin/init, and /sbin/init starts running your startup scripts. Everything that needs to happen must happen in those startup scripts. The problems occur when script #1 (say, start udev) sometimes needs script #2 (mount /usr) to have run, but script #2 sometimes needs script #1 to have run. You can solve this in a number of ways: * Fix script #1 to never need script #2 (move everything you need off /usr) * Fix script #2 to never need script #1 (put /usr on the same partition as /sbin/init) * Adjust the order of the scripts on a case-by-case bases (move script #2 to an initrd when needed) Option one has traditionally been the way to solve these kinds of problems, but with dynamic linking and external hooks the reach of the boot-time software is getting overly broad. Option #2 is the simplest and lowest-risk option, but not everyone has a hardware configuration that makes that a viable choice. So option #3 is basically "you do whatever you have to do to get a /usr before /sbin/init runs." > > As you move more and more software off of /usr into / you start to > > realize that the idea of "tiny partition that contains just what I > > need to boot and mount /usr" is becoming "not so tiny" anymore. The > > distinction between what is "boot" software versus "user" software gets > less clear. > > Again, isn't this the same for an initramfs? This part is, true, but the point of an initramfs is that, once you switch over to init, the initramfs is out of the picture. With a traditional boot, the stuff you move into your rootfs to make booting work is there forever. With an initramfs, you don't need (for example) all of the udev rules and libraries and such; you just need enough statically linked binaries to mount /usr; when the init switch happens, your real, production binaries show up and the trimmed-down copies from your initramfs go away. > > Then it's just question of how far you take this process before you > > reach your personal threshold of questioning why you have two > > partitions at all. Whether you reach that point or not depends on how > > complex your boot process is, what you actually need running to boot, > > and how personally invested in a split /usr you happen to be :) > > I've decided that, if push comes to shove, I'm going to go for /usr on / rather > than a fragile initramfs system. I've got everything bar / on RAID 1/LVM at > the moment, but I don't really use LVM, so I could dismantle that too, losing > all the baggage that brings with it. I'm using both on most of my systems now, though admittedly on my laptop it's just to get the boot animation from plymouth :) > Having said that, my system (including Gnome) is working perfectly well with > mdev, and see no reason why that shouldn't continue. And that's a perfectly legitimate option; you're continuing to use a process that has worked for decades. The problem with that option is not that it doesn't work for plenty of people, it's that it doesn't *scale* very well. If you're writing the software that needs to work out-of-the-box for every Fedora/Debian/Gentoo/etc system installed from this point forward, you need to worry about scale. If you're setting up a few hundred nearly identical servers with much more limited hardware that is under your direct control, you can focus your solution to a much narrow scope.