Matthew Burgess wrote: > On 05/08/2011 19:55, Bruce Dubbs wrote: > >> The first script to run is mountvirtfs. Perhaps we could have that >> create a /dev device like /dev/sda? and mount that as /var before udev >> ever starts. > > Yeah, I started thinking along the same lines, and was wondering whether > union mounts would work here. In effect, what it would mean is: > > 1) kernel mounts root device r/o > 2) mountvirtfs mounts a r/w tmpfs over /var > 3) udev bootscript runs
alsactl requires /var/lib/alsa/asound.state here, saved from the previous boot. :-( > 4) mountfs union mounts the real /var (if it's specified in fstab) over > the existing tmpfs /var. The only note we'd need to put in the book is > the need for the 'union' option in fstab for this to work correctly, I > believe. > > I have a suspicion though, that if one has a single OS partition (no > separate /usr or /var) it will break because under that configuration > steps 1-3 above remain the same, but then we get: > > 4) / is remounted r/w, and with /var on that FS it won't have been > 'unioned' with the tmpfs /var and will thus in effect hide it and any > files on it. This as well. > Maybe this is why initrd's are being encouraged so heavily? :-( Yeah. The comments on the freedesktop page are basically "the initramfs is the replacement for the old initial bootscripts". (The stuff up to and including mountfs. They even expect udevd to remain running and the /dev tmpfs to be "mount --move"d over to the real system.) The initramfs hint I put together a while back[1] will work for this (with some changes, though I can make them) since it does copy in the host's /etc/fstab. But it does mean that fstab changes will now require a rerun of mkinitramfs. :-( Although... hmm. I bet I could abuse chroot to run the mounts inside the real rootfs and return control to the initramfs. Heh. Terrible terrible hacks, but it would use the root's fstab directly at least... Anyway. The biggest advantage of writing that hint was that I figured out how an initramfs was supposed to work (and a lot about device mapper, RAID, and LVM as well). I'm not sure copying the package will have the same educational effect, so I'm not sure if I should propose using that package for this. But on the other hand the format of initramfs doesn't lend itself to easy editing either, so it's hard to experiment even if we didn't use a package. :-/ [1] http://www.linuxfromscratch.org/hints/downloads/files/Root_FS_on_RAID+encryption+LVM.txt
signature.asc
Description: OpenPGP digital signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page