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

Bug#791794: UUID not found for root



On Thu, 2015-07-30 at 12:02 -0400, Martin Michlmayr wrote:
* Ian Campbell <ijc@debian.org> [2015-07-22 09:10]:
> I think it is the DEBIAN_FRONTEND which is supposed to work for the
> installer case, which you added back in 2008. in-target appears to have
> set DEBIAN_FRONTEND=passthrough since 2005, but perhaps something has
> gotten into (or out of) the middle in the meantime?
> 
> Or perhaps something has changed to using in-target which wasn't
> before?
> 
> In any case, perhaps the answer is to check for DEBIAN_FRONTEND either
> noninteractive or passthrough? Or maybe even just for it being set at
> all, since even if it were =text or =newt or whatever echo+read doesn't
> seem like the right answer...


I've no idea what would be best.  I was hoping Colin would comment.

Unless someone has an alternative suggestion I think I'll make the
flash-kernel initramfs-hook gate its waiting for Ctrl-C on failure
behaviour on either DEBIAN_FRONTEND or DEBIAN_HAS_FRONTEND being non
-empty. Today the DEBIAN_FRONTEND check is explicitly for
"noninteractive" which omits at least "passthrough" as another
problematic case. It seems to me that few of the other possible options
would benefit from being made to wait here (graphical ones surely not,
likewise newt, maybe text would be ok, but lets not bother special
casing it).

I found an old branch where I tried to get the initramfs-hook to use
debconf if it appears to be already running. I don't think I ever got
it working, and it looks like I was having trouble arranging for flash
-kernel's templates to be loaded (since we are running in the context
of some other packages debconf invocation), which matches my vague
recollection.

I've pasted the key hunk below in case any one has any ideas how to
make this work correctly.

Ian.

        # Script is called from update-initramfs which in term can be
        # called manually by the admin from the CLI or via various
        # postinst and trigger hooks or from the installer.
        #
-       # If debconf appears to be running then it is important that
-       # we do not block on stdin since this would hang the
-       # installer.
+       # If debconf appears to be running then use it to notify the
+       # user. This is particularly important if the error occurs
+       # during the installer.
        if [ "$DEBIAN_HAS_FRONTEND" ]; then
                echo "Unable to abort; system will probably be broken!" >&2
+               # No need to worry about confmodule re-execing the
+               # script since we check $DEBIAN_HAS_FRONTEND
+               # immediately above
+               . /usr/share/debconf/confmodule
+               # Make sure our templates are loaded
+               db_x_loadtemplatefile $(dpkg-query --control-path flash-kernel templates) flash-kernel
+               db_title flash-kernel
+               db_subst flash-kernel/$template ROOTDEV $rootdev
+               db_input critical flash-kernel/$template
+               db_go
+               #db_get flash-kernel/$template
        else
+               echo "" >&2
                echo "Press Ctrl-C to abort build, or Enter to continue" >&2
                read _ignored
        fi


Reply to: