On Mar 15, 2012, at 9:02 AM, Bruce Dubbs wrote:

> Nathan Coulson wrote:
>> S30checkfs, we added
>> 
>>      # If any LVM based partitions are on the system, ensure they
>>      # are activated so they can be checked/used.
>>      if [ -x /sbin/vgchange ]; then
>>         /sbin/vgchange -a y >/dev/null
>>      fi
>> 
>> Normally, I would suggest that we keep non LFS packages out of the
>> bootscripts, but not sure if it's worth having it's own bootscript.
> 
> Having a complete bootscript for essentially one line is more effort 
> than it's worth.

When this came up before, I sent Bruce an LVM bootscript (which did nothing 
more than the vgchange).  In that iteration of this same discussion, Bruce 
asked if the script was necessary, rather than, e.g., putting the "one-liner" 
into something like checkfs.

Before making a decision this time, I think it's best to consider parallel, 
analogous, situations like the issues surrounding /sbin/ifup, 
/lib/lsb/ipv4-static, and /lib/lsb/bridge.  When I brought up including 
bridge-utils in LFS, I got a metric crap-ton of flak about how it was 
"unnecessary".  In the end, it wasn't that big a deal, and I could see the 
point being made about it being "outside the scope of the core LFS system."  I 
still disagree, but I understand the argument's merits--LVM is just more of the 
same: it's some ioctl-like userland code, some of which is used at system 
initialization, that provides ("optional") access to "optional" parts of the 
kernel.

So, if the userland never gets installed in LFS, why include code that's never 
runnable?  I realize that a "whole script" might seem sort of "unnecessary", 
but, frankly, most scripts in sysvinit are in exactly that same state: i.e., 
pretty much just one-liners, prettied up so they can be started, stopped, and 
"restarted".  They are almost *all* "unnecessary" from that perspective.  If 
that was the central argument, then we may as well revert to /etc/rc.local.  
Frankly, very few services really need a clean shutdown.  Notably examples 
include databases and hypervisor management software, but most things (e.g., 
NTP, BIND, even big ones like Apache) would probably see negligible effects--if 
any at all--from just getting a kill (even -9) from init.

It seems to me the point of sysvinit is to separate things and keep things 
clean from an administrative and maintenance perspective.  It also seems the 
arbiter of whether or not packages make it into LFS is their "necessity".  
Plus, it's quite conceivable that other block-device setups (e.g., dmcrypt, 
loopback devices) might be used, and might require more config.  It probably 
makes sense to separate out that initialization from other parts of the system.

>> I would like to suggest adding it earlier in the boot process though,
>> perhaps as part of S00mountvirtfs.  Just does not feel like it belongs
>> in the checkfs script.
> 
>> Moving it earlier would also allow us to mount lvm based swap partitions.
> 
> The order of scripts is udev, swap, checkfs.  I suppose we could move 
> the line to the end of the udev start sequence.  What do others think?

IMO, LVM and mdraid should be done super-early (whether embedded in some other 
script or separated into their own).  It should go right after modules are 
loaded (S05modules in rcS.d, so maybe S06LVM and S06md) for the people doing 
fancy initramfs boots with modules.  Started early, udev, swap, checkfs, and 
mountfs could all use mdraid and LVM devices.

        Q

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to