[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#810860: usrmerge: System cannot be rebooted after partial usrmerge installation



On Sun, 2016-01-17 at 12:10 -0500, Jason Rhinelander wrote:
> On 16/01/16 09:16 PM, Ben Hutchings wrote:
> > On Thu, 2016-01-14 at 11:18 +0100, Marco d'Itri wrote:
> > > initramfs-tools needs this patch to be able to resolve recursive
> > > symlinks, or else the system will not boot while in the middle of
> > > a merged /usr transition.
> > > Then I will add a versioned conflict to the usrmerge package.
> > [...]
> > > > Taking a quick look at it, it looks like validate_init will only handle a
> > > > *single* absolute symlink, but in this particular case there are two
> > > > (absolute) symlinks:
> > > > 
> > > > /sbin/init -> /usr/sbin/init
> > > > /usr/sbin/init -> /lib/systemd/systemd
> > [...]
> > 
> > We can't resolve the second symlink until /usr is already mounted, so
> > recursively reading symlinks is not going to help.
> > 
> > But clearly if /sbin/init is a symlink to somewhere under /usr then we
> > need to mount it!
> > 
> > Ben.
> > 
> 
> That seems a separate (if related) issue: this non-bootable problem 
> comes up up even when /usr is on the same partition as /sbin (and it 
> isn't really specific to /usr).
> 
> To reformulate slightly (taking /usr out of the equation entirely), the 
> following symlink setup currently fails to boot with initramfs-tools:
> 
> /sbin/init -> /sbin/blah
> /sbin/blah -> /sbin/real.init
> 
> with error "Target filesystem doesn't have requested /sbin/init"

That's true.

Also, if /sbin is a link to '/usr/sbin' then the recursive reading of
symlinks still doesn't work, whereas if it's a link to 'usr/sbin' then
we're OK.

So I think what I'm going to do is to delegate this to the run-init
program that we currently use to invoke the real init.  Currently
there's no way out if it fails (since it must be pid 1) but I can add a
dry-run mode which would do a much better job of validation since it
can chroot without depending on any other files in the real root
filesystem.

Ben.

> An in-progress usrmerge installation (without any of the added 
> complexity of a separate /usr mount) is simply exposing this by creating 
> such a symlink chain.


-- 
Ben Hutchings
Theory and practice are closer in theory than in practice.
                                - John Levine, moderator of comp.compilers

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: