All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Watson <cjwatson@ubuntu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [patch] incorrect root device while /dev/ on tmpfs
Date: Sat, 17 Oct 2009 13:55:07 +0100	[thread overview]
Message-ID: <20091017125507.GS28534@riva.ucam.org> (raw)
In-Reply-To: <4AD9B795.6000201@parallels.com>

On Sat, Oct 17, 2009 at 04:24:53PM +0400, Vasily Averin wrote:
> While /dev mounted as tmpfs it does not contain /dev/disk/by-uuid directory,
> 10_linux script did not check it properly and do not set root device via UUID.
> Therefore following kernel boot can fail (incorrect root device) if device names
> was changed.
> 
> Attached path fixes this issue. Please review and commit it

> diff -up ./util/grub.d/10_linux.in.tmpdevuuid ./util/grub.d/10_linux.in
> --- ./util/grub.d/10_linux.in.tmpdevuuid	2009-08-29 20:05:06.000000000 +0400
> +++ ./util/grub.d/10_linux.in	2009-09-03 11:07:34.000000000 +0400
> @@ -36,7 +36,7 @@ case ${GRUB_DEVICE} in
>  esac
>  
>  if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
> -    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
> +    || ( test -d /dev/disk/by-uuid  && ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}") ; then
>    LINUX_ROOT_DEVICE=${GRUB_DEVICE}
>  else
>    LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}

It seems to me that this eliminates the safety check to ensure that
Linux actually recognises this UUID. If for some reason GRUB and Linux
are out of sync in how they calculate UUIDs, this will probably result
in an unbootable system.

Would it help to double-check with blkid in this case, or something like
that?

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



  parent reply	other threads:[~2009-10-17 12:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-17 12:24 [patch] incorrect root device while /dev/ on tmpfs Vasily Averin
2009-10-17 12:50 ` Felix Zielcke
2009-10-17 12:56   ` Colin Watson
2009-10-17 13:40     ` Felix Zielcke
2009-10-17 12:55 ` Colin Watson [this message]
2009-10-17 13:39 ` Vladimir 'phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091017125507.GS28534@riva.ucam.org \
    --to=cjwatson@ubuntu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.