From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1bSGyN-0000Cr-3M for mharc-grub-devel@gnu.org; Wed, 27 Jul 2016 01:01:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSGyK-0000CU-LF for grub-devel@gnu.org; Wed, 27 Jul 2016 01:01:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSGyE-0004Ke-RL for grub-devel@gnu.org; Wed, 27 Jul 2016 01:01:31 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:33018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSGyE-0004KL-ED for grub-devel@gnu.org; Wed, 27 Jul 2016 01:01:26 -0400 Received: by mail-lf0-x241.google.com with SMTP id f93so1427999lfi.0 for ; Tue, 26 Jul 2016 22:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=xvvga0mSCUrcWcO0noX99VKegoU/k1rZVgbgULkVkJ4=; b=YJT4VEcuzJuQKkMV4C1V+QjRnepv2kWo+x/speAg+0U2TqMO4PbUSbjCfYQWrh4X/w EISwjfeyyKN6U+PI8GZgt1iToB4OzkjOJAdHQgudiHi9wQhc1gLZgC7LGIKFzXGBN3c8 i35Qp8/9PerjHo71ZTdq70lTIIkyBsKvAGJ6zRCU/FZOAj5READKordYMcU3k4TMtN2O pI6nle8DD95kHLIRp/sxT39DtYIwnKeNriFsvmTO16W06SXgmYrwPGZIWsu5N5ZVtcLb XhJmCTatwn/Pydux7C7OZNk+SNzA4X+6EDLvmqRCLy7Ps7thocNf0apIO8lUMwA7eIKD iB1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xvvga0mSCUrcWcO0noX99VKegoU/k1rZVgbgULkVkJ4=; b=hFKiuWyQ/HHD0sJKUvahKv8oZ/FRF3aRYj0ot20+zdk6Fwv6/7fhtLrP8qj8dsPgot l4s9ZaLhHUwI1wqYW0/4fDxnlJdapUfOipSdZ5gSVBy2TIYsP1Q++rWHF6mbK6oQDX1w LIYTwvB25G7bYigDCCVzwcLkoWz6HoL5zYx0sP3ejcnx0TVfXpUFFu9yVF74BloU2eso 30l3u8YuE8ODQUtjoyV/ExyG36u4SA0ebA3ZFPgWG8bNfo3voT2eU7kMUP1Qx3p8NxCj VlmsvJc3RRN2kKXRrjeo6eCgRvOrETYDKFoMPYeGehddLht3h2nJydKKP2msNPdR35kk QfCg== X-Gm-Message-State: AEkoouu39Hv7zIshANx3SO+8Dc7CPWq9Wp+YCMFPEkrJDxTL3/Xdde1oA4stFvfiX7Z7Xg== X-Received: by 10.46.0.92 with SMTP id 89mr10464247lja.37.1469595681375; Tue, 26 Jul 2016 22:01:21 -0700 (PDT) Received: from [192.168.1.44] (ppp109-252-91-231.pppoe.spdop.ru. [109.252.91.231]) by smtp.gmail.com with ESMTPSA id h203sm643989lfh.46.2016.07.26.22.01.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 22:01:20 -0700 (PDT) Subject: Re: [GRUB PARTUUID PATCH 2/2] Update grub script template files To: The development of GNU GRUB References: Cc: Nicholas Vinson From: Andrei Borzenkov X-Enigmail-Draft-Status: N1110 Message-ID: <41dbc01b-c380-f7d6-fcf4-b421b1352b97@gmail.com> Date: Wed, 27 Jul 2016 08:01:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::241 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 05:01:33 -0000 20.06.2016 04:37, Nicholas Vinson пишет: > Update grub-mkconfig.in and 10_linux.in to support grub-probe's new > partuuid target. > > Signed-off-by: Nicholas Vinson > --- > util/grub-mkconfig.in | 2 ++ > util/grub.d/10_linux.in | 11 +++++++++-- > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in > index f8496d2..fc42462 100644 > --- a/util/grub-mkconfig.in > +++ b/util/grub-mkconfig.in > @@ -134,6 +134,7 @@ fi > # Device containing our userland. Typically used for root= parameter. > GRUB_DEVICE="`${grub_probe} --target=device /`" > GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true > +GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true > > # Device containing our /boot partition. Usually the same as GRUB_DEVICE. > GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" > @@ -182,6 +183,7 @@ if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub > # override them. > export GRUB_DEVICE \ > GRUB_DEVICE_UUID \ > + GRUB_DEVICE_PARTUUID \ > GRUB_DEVICE_BOOT \ > GRUB_DEVICE_BOOT_UUID \ > GRUB_FS \ > diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in > index de9044c..8081fdb 100644 > --- a/util/grub.d/10_linux.in > +++ b/util/grub.d/10_linux.in > @@ -220,8 +220,15 @@ while [ "x$list" != "x" ] ; do > gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 > elif test -z "${initramfs}" ; then > # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's > - # no initrd or builtin initramfs, it can't work here. > - linux_root_device_thisversion=${GRUB_DEVICE} > + # no initrd or builtin initramfs, it can't work here. However, if > + # GRUB_DEVICE_PARTUUID is not empty we can use that here if > + # GRUD_DISABLE_LINUX_UUID is not set to true. > + if [ "x${GRUB_DISABLE_LINUX_UUID}" != "xtrue" ] > + && [ "x${GRUB_DEVICE_PARTUUID}" != "x" ]; then > + linux_root_device_thisversion="PARTUUID=${GRUB_DEVICE_PARTUUID}" Well, PARTUUID appeared first in 2.6.37 and MSDOS "UUID" in 3.10. Unfortunately we have no way to check for it, even as fragile as stored kernel config. So I am not sure we should do it by default. And if we add some extra knob to turn it on, as you mentioned yourself, you can simply add root=PARTUUID=xxx to stored kernel command line. One more consideration is that reinstalling in existing partition will invalidate FS UUID stored in grub.cfg which is arguably the right thing because you now have something different there, but PARTUUID will most likely remain the same. > + else > + linux_root_device_thisversion=${GRUB_DEVICE} > + fi > fi > > if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then >