[klibc] [PATCH 6/8] switch_root: Fix single file mounts
michal.suchanek at ruk.cuni.cz
Thu Jul 28 00:26:35 PDT 2011
Excerpts from maximilian attems's message of Wed Jul 27 21:42:32 +0200 2011:
> On Mon, 18 Jul 2011, Michal Suchanek wrote:
> > Hello,
> > Excerpts from maximilian attems's message of Wed Jul 13 15:48:31 +0200 2011:
> > > From: Michal Suchanek <michal.suchanek at ruk.cuni.cz>
> > >
> > > The root of the failure is that nuke cannot cope with file
> > > mounts (single files mounted, not directories). These are the result of
> > > using fuse to get to the root filesystem (httpfs, curlftpfs).
> > >
> > > This fixes
> > > http://bugs.debian.org/476268
> > thanks for looking into this.
> > Since this is a long-standing issue I wrapped the file mount in a tmpfs
> > mount as a workaround.
> > I hope this makes life easier for people trying to use klibc in the
> > future.
> after the post I'm less convinced of this patchset.
TBH I am not sure of it from the very start.
My issue was that a file cannot be removed which makes nuke_initramfs
fail and fails boot without any indication of the reason for the error
yet your patch changes something that returns ENOENT.
Either the whole nuke_initramfs is junk or I don't understand its code at
all or both.
> as you can read in the following post mikew also opted for the
> strict error http://www.zytor.com/pipermail/klibc/2011-July/003002.html
> handling as it is currently done in run-init.
> the util-linux switch_root is in contrary very lax, but that
> way dev errors can't be catched.
The errors in nuke_initramfs are a failure to adhere to initramfs layout
nuke_initramfs expects which is not documented. Failure to remove a file
from a filesystem later not accessible is not necessarily a boot error.
Even worse, these errors are given without any diagnostic so they are
useless. If you want strict error checking then produce meaningful error
messages. I attached a patch to the debian bug report which says what
files nuke_initramfs failed to remove so that you can move them away
before running it.
AFAICT nuke_initramfs cannot work if any mount is present as /some/mount
because it will then fail to remove /some and the system will fail to
boot without giving any reason.
More information about the klibc