Re: /usr (was: Re: Survey answers part 3: systemd is not portable and what this) means for our ports
On Tue, Jul 16, 2013 at 05:37:09PM +0200, Paul Wise wrote:
> On Sun, Jul 14, 2013 at 10:38 PM, Roger Leigh wrote:
> > I don't think that we agreed on merging /usr at all. I have written
> > some patches for initramfs-tools to permit fsck and mount of /usr
> > in the initramfs in addition to the rootfs, but that's as far as this
> > has gone. There's no merging here, just changing where /usr is
> > mounted in the boot process.
> Is this implemented by just mounting /usr, by discovering which
> partitions need mounting for each binary that is to be run from the
> initramfs or by copying stuff from /usr into the initramfs too?
Once the rootfs is mounted, we parse $root/etc/fstab and mount /usr
using that information. When init starts, /usr is therefore
available from the beginning. Note that the objective here isn't
to allow the initramfs to run binaries from /usr, but to ensure
that /usr is available at all times when the system is running--
this means that all programs, libraries, modules, datafiles etc.
are available before init starts.
There are some complicating details:
- we need to ensure that the modules needed to mount /usr are
available in the initramfs (copy the needed modules and
mount helpers into the initramfs)
- we can't fsck /usr when mounted, so this needs doing in the
initramfs (/ and /usr are fscked, with the appropriate
helpers copied into the initramfs)
- fsck's -R option updated to skip /usr as well as root.
- /etc/init.d/checkroot.sh updated to handle /usr as well
as root (e.g. remounting r/w).
- using the same infrastructure, it's also possible to
mount /etc in the initramfs so that you can have e.g. a
separately encrypted /etc filesystem. This is a separate
feature though and can be split out.
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools
`- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800