Re: [GRUB PARTUUID PATCH V9 4/5] Update grub script template files
On 04/16/2018 04:47 AM, Daniel Kiper wrote: > On Wed, Apr 11, 2018 at 07:45:01AM -0700, Nick Vinson wrote: >> On 04/11/2018 01:31 AM, Daniel Kiper wrote: >>> On Tue, Apr 10, 2018 at 08:00:04PM -0700, Nick Vinson wrote: On 04/10/2018 01:52 PM, Daniel Kiper wrote: > On Sat, Apr 07, 2018 at 04:28:13PM -0700, Nicholas Vinson wrote: >> Update grub-mkconfig.in and 10_linux.in to support grub-probe's new >> partuuid target. Update grub.texi documentation. The following table >> shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and >> initramfs detection interact: >> >> Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux >> Root >> detected Set Set ID >> Method >> >> False FalseFalsepart >> UUID >> False FalseTrue part >> UUID >> False True Falsedev name >> False True True dev name >> True FalseFalsefs UUID >> True FalseTrue part >> UUID >> True True Falsefs UUID >> True True True dev name > > What will happen if GRUB_DISABLE_LINUX_PARTUUID and/or > GRUB_DISABLE_LINUX_UUID > are not set? I think that you can avoid that by setting defaults. You do > that > for GRUB_DISABLE_LINUX_PARTUUID in next patch but GRUB_DISABLE_LINUX_UUID > does not have any default. > If they're not set, then that's the same as them being set to 'False'. I should have worded my table above a bit differently and used Yes/No instead of True/False as that is really what it is trying to convey. >>> >>> IMO it will be more confusing. I think that I would use lowercase >>> false/true as it is used in the script and below the table I would >>> add a note that == false or something like that. >> >> Ack. I will update the commit comment. > > Thanks. May I ask you to put similar table into docs/grub.texi? Done. Thanks, Nicholas Vinson > > Daniel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [GRUB PARTUUID PATCH V9 4/5] Update grub script template files
On Wed, Apr 11, 2018 at 07:45:01AM -0700, Nick Vinson wrote: > On 04/11/2018 01:31 AM, Daniel Kiper wrote: > > On Tue, Apr 10, 2018 at 08:00:04PM -0700, Nick Vinson wrote: > >> On 04/10/2018 01:52 PM, Daniel Kiper wrote: > >>> On Sat, Apr 07, 2018 at 04:28:13PM -0700, Nicholas Vinson wrote: > Update grub-mkconfig.in and 10_linux.in to support grub-probe's new > partuuid target. Update grub.texi documentation. The following table > shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and > initramfs detection interact: > > Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux > Root > detected Set Set ID > Method > > False FalseFalsepart > UUID > False FalseTrue part > UUID > False True Falsedev name > False True True dev name > True FalseFalsefs UUID > True FalseTrue part > UUID > True True Falsefs UUID > True True True dev name > >>> > >>> What will happen if GRUB_DISABLE_LINUX_PARTUUID and/or > >>> GRUB_DISABLE_LINUX_UUID > >>> are not set? I think that you can avoid that by setting defaults. You do > >>> that > >>> for GRUB_DISABLE_LINUX_PARTUUID in next patch but GRUB_DISABLE_LINUX_UUID > >>> does not have any default. > >>> > >> > >> If they're not set, then that's the same as them being set to 'False'. > >> I should have worded my table above a bit differently and used Yes/No > >> instead of True/False as that is really what it is trying to convey. > > > > IMO it will be more confusing. I think that I would use lowercase > > false/true as it is used in the script and below the table I would > > add a note that == false or something like that. > > Ack. I will update the commit comment. Thanks. May I ask you to put similar table into docs/grub.texi? Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [GRUB PARTUUID PATCH V9 4/5] Update grub script template files
On 04/11/2018 01:31 AM, Daniel Kiper wrote: > On Tue, Apr 10, 2018 at 08:00:04PM -0700, Nick Vinson wrote: >> On 04/10/2018 01:52 PM, Daniel Kiper wrote: >>> On Sat, Apr 07, 2018 at 04:28:13PM -0700, Nicholas Vinson wrote: Update grub-mkconfig.in and 10_linux.in to support grub-probe's new partuuid target. Update grub.texi documentation. The following table shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and initramfs detection interact: Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root detected Set Set ID Method False FalseFalsepart UUID False FalseTrue part UUID False True Falsedev name False True True dev name True FalseFalsefs UUID True FalseTrue part UUID True True Falsefs UUID True True True dev name >>> >>> What will happen if GRUB_DISABLE_LINUX_PARTUUID and/or >>> GRUB_DISABLE_LINUX_UUID >>> are not set? I think that you can avoid that by setting defaults. You do >>> that >>> for GRUB_DISABLE_LINUX_PARTUUID in next patch but GRUB_DISABLE_LINUX_UUID >>> does not have any default. >>> >> >> If they're not set, then that's the same as them being set to 'False'. >> I should have worded my table above a bit differently and used Yes/No >> instead of True/False as that is really what it is trying to convey. > > IMO it will be more confusing. I think that I would use lowercase > false/true as it is used in the script and below the table I would > add a note that == false or something like that. Ack. I will update the commit comment. > >> I.E. If there is no initramfs detected and GRUB_DISABLE_LINUX_PARTUUID >> is not set and GRUB_DISABLE_LINUX_UUID is not set, set the kernel root >> variable to "root=PARTUUID=...". >> >> In the scripts, the only value explicitly checked for is 'true'. >> Anything else (including unset) is considered false. > > OK, perfect! > Signed-off-by: Nicholas Vinson --- docs/grub.texi | 10 ++ util/grub-mkconfig.in | 3 +++ util/grub.d/10_linux.in | 18 +++--- >>> >>> Could you update util/grub.d/20_linux_xen.in too? >> >> Let me see what I can do. I have never worked with xen before, so I do >> not know much about it. > > This should be easy. However, if you are not sure please drop me a line. > 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 65b4bbeda..06f0afe45 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1424,6 +1424,16 @@ the Linux kernel, using a @samp{root=UUID=...} kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to @samp{true}. +@item GRUB_DISABLE_LINUX_PARTUUID +If @command{grub-mkconfig} cannot identify the root filesystem via its +universally-unique indentifier (UUID), @command{grub-mkconfig} will use the UUID +of the partition containing the filesystem to identify the root filesystem to +the Linux kernel via a @samp{root=PARTUUID=...} kernel parameter. This is not +as reliable as using the filesystem UUID, but is more reliable than using the +Linux device names. When enabled, this option requires the Linux kernel version >>> >>> s/When enabled, /When enabled, GRUB_DISABLE_LINUX_PARTUUID set to false, / >>> or something like that. Otherwise it is unclear. >> >> I'll clean up the wording in the next release. > > Thanks a lot! > > By the way, should not we merge patches 4 and 5 into one patch? We should. I split it so that if #5 proved controversial for some reason and received a lot of resistance, it could be dropped and the remainder of the patchset could be merged. There does not seem to be any issue with setting GRUB_DISABLE_LINUX_PARTUUID to a default value, so there is no reason to keep it separate. Thanks, Nicholas Vinson > > Daniel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [GRUB PARTUUID PATCH V9 4/5] Update grub script template files
On Tue, Apr 10, 2018 at 08:00:04PM -0700, Nick Vinson wrote: > On 04/10/2018 01:52 PM, Daniel Kiper wrote: > > On Sat, Apr 07, 2018 at 04:28:13PM -0700, Nicholas Vinson wrote: > >> Update grub-mkconfig.in and 10_linux.in to support grub-probe's new > >> partuuid target. Update grub.texi documentation. The following table > >> shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and > >> initramfs detection interact: > >> > >> Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root > >> detected Set Set ID Method > >> > >> False FalseFalsepart UUID > >> False FalseTrue part UUID > >> False True Falsedev name > >> False True True dev name > >> True FalseFalsefs UUID > >> True FalseTrue part UUID > >> True True Falsefs UUID > >> True True True dev name > > > > What will happen if GRUB_DISABLE_LINUX_PARTUUID and/or > > GRUB_DISABLE_LINUX_UUID > > are not set? I think that you can avoid that by setting defaults. You do > > that > > for GRUB_DISABLE_LINUX_PARTUUID in next patch but GRUB_DISABLE_LINUX_UUID > > does not have any default. > > > > If they're not set, then that's the same as them being set to 'False'. > I should have worded my table above a bit differently and used Yes/No > instead of True/False as that is really what it is trying to convey. IMO it will be more confusing. I think that I would use lowercase false/true as it is used in the script and below the table I would add a note that == false or something like that. > I.E. If there is no initramfs detected and GRUB_DISABLE_LINUX_PARTUUID > is not set and GRUB_DISABLE_LINUX_UUID is not set, set the kernel root > variable to "root=PARTUUID=...". > > In the scripts, the only value explicitly checked for is 'true'. > Anything else (including unset) is considered false. OK, perfect! > >> Signed-off-by: Nicholas Vinson > >> --- > >> docs/grub.texi | 10 ++ > >> util/grub-mkconfig.in | 3 +++ > >> util/grub.d/10_linux.in | 18 +++--- > > > > Could you update util/grub.d/20_linux_xen.in too? > > Let me see what I can do. I have never worked with xen before, so I do > not know much about it. This should be easy. However, if you are not sure please drop me a line. > >> 3 files changed, 28 insertions(+), 3 deletions(-) > >> > >> diff --git a/docs/grub.texi b/docs/grub.texi > >> index 65b4bbeda..06f0afe45 100644 > >> --- a/docs/grub.texi > >> +++ b/docs/grub.texi > >> @@ -1424,6 +1424,16 @@ the Linux kernel, using a @samp{root=UUID=...} > >> kernel parameter. This is > >> usually more reliable, but in some cases it may not be appropriate. To > >> disable the use of UUIDs, set this option to @samp{true}. > >> > >> +@item GRUB_DISABLE_LINUX_PARTUUID > >> +If @command{grub-mkconfig} cannot identify the root filesystem via its > >> +universally-unique indentifier (UUID), @command{grub-mkconfig} will use > >> the UUID > >> +of the partition containing the filesystem to identify the root > >> filesystem to > >> +the Linux kernel via a @samp{root=PARTUUID=...} kernel parameter. This > >> is not > >> +as reliable as using the filesystem UUID, but is more reliable than using > >> the > >> +Linux device names. When enabled, this option requires the Linux kernel > >> version > > > > s/When enabled, /When enabled, GRUB_DISABLE_LINUX_PARTUUID set to false, / > > or something like that. Otherwise it is unclear. > > I'll clean up the wording in the next release. Thanks a lot! By the way, should not we merge patches 4 and 5 into one patch? Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [GRUB PARTUUID PATCH V9 4/5] Update grub script template files
On 04/10/2018 01:52 PM, Daniel Kiper wrote: > On Sat, Apr 07, 2018 at 04:28:13PM -0700, Nicholas Vinson wrote: >> Update grub-mkconfig.in and 10_linux.in to support grub-probe's new >> partuuid target. Update grub.texi documentation. The following table >> shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and >> initramfs detection interact: >> >> Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root >> detected Set Set ID Method >> >> False FalseFalsepart UUID >> False FalseTrue part UUID >> False True Falsedev name >> False True True dev name >> True FalseFalsefs UUID >> True FalseTrue part UUID >> True True Falsefs UUID >> True True True dev name > > What will happen if GRUB_DISABLE_LINUX_PARTUUID and/or GRUB_DISABLE_LINUX_UUID > are not set? I think that you can avoid that by setting defaults. You do that > for GRUB_DISABLE_LINUX_PARTUUID in next patch but GRUB_DISABLE_LINUX_UUID > does not have any default. > If they're not set, then that's the same as them being set to 'False'. I should have worded my table above a bit differently and used Yes/No instead of True/False as that is really what it is trying to convey. I.E. If there is no initramfs detected and GRUB_DISABLE_LINUX_PARTUUID is not set and GRUB_DISABLE_LINUX_UUID is not set, set the kernel root variable to "root=PARTUUID=...". In the scripts, the only value explicitly checked for is 'true'. Anything else (including unset) is considered false. >> Signed-off-by: Nicholas Vinson >> --- >> docs/grub.texi | 10 ++ >> util/grub-mkconfig.in | 3 +++ >> util/grub.d/10_linux.in | 18 +++--- > > Could you update util/grub.d/20_linux_xen.in too? Let me see what I can do. I have never worked with xen before, so I do not know much about it. > >> 3 files changed, 28 insertions(+), 3 deletions(-) >> >> diff --git a/docs/grub.texi b/docs/grub.texi >> index 65b4bbeda..06f0afe45 100644 >> --- a/docs/grub.texi >> +++ b/docs/grub.texi >> @@ -1424,6 +1424,16 @@ the Linux kernel, using a @samp{root=UUID=...} kernel >> parameter. This is >> usually more reliable, but in some cases it may not be appropriate. To >> disable the use of UUIDs, set this option to @samp{true}. >> >> +@item GRUB_DISABLE_LINUX_PARTUUID >> +If @command{grub-mkconfig} cannot identify the root filesystem via its >> +universally-unique indentifier (UUID), @command{grub-mkconfig} will use the >> UUID >> +of the partition containing the filesystem to identify the root filesystem >> to >> +the Linux kernel via a @samp{root=PARTUUID=...} kernel parameter. This is >> not >> +as reliable as using the filesystem UUID, but is more reliable than using >> the >> +Linux device names. When enabled, this option requires the Linux kernel >> version > > s/When enabled, /When enabled, GRUB_DISABLE_LINUX_PARTUUID set to false, / > or something like that. Otherwise it is unclear. I'll clean up the wording in the next release. Thanks, Nicholas Vinson > > Daniel > ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [GRUB PARTUUID PATCH V9 4/5] Update grub script template files
On Sat, Apr 07, 2018 at 04:28:13PM -0700, Nicholas Vinson wrote: > Update grub-mkconfig.in and 10_linux.in to support grub-probe's new > partuuid target. Update grub.texi documentation. The following table > shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and > initramfs detection interact: > > Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root > detected Set Set ID Method > > False FalseFalsepart UUID > False FalseTrue part UUID > False True Falsedev name > False True True dev name > True FalseFalsefs UUID > True FalseTrue part UUID > True True Falsefs UUID > True True True dev name What will happen if GRUB_DISABLE_LINUX_PARTUUID and/or GRUB_DISABLE_LINUX_UUID are not set? I think that you can avoid that by setting defaults. You do that for GRUB_DISABLE_LINUX_PARTUUID in next patch but GRUB_DISABLE_LINUX_UUID does not have any default. > Signed-off-by: Nicholas Vinson > --- > docs/grub.texi | 10 ++ > util/grub-mkconfig.in | 3 +++ > util/grub.d/10_linux.in | 18 +++--- Could you update util/grub.d/20_linux_xen.in too? > 3 files changed, 28 insertions(+), 3 deletions(-) > > diff --git a/docs/grub.texi b/docs/grub.texi > index 65b4bbeda..06f0afe45 100644 > --- a/docs/grub.texi > +++ b/docs/grub.texi > @@ -1424,6 +1424,16 @@ the Linux kernel, using a @samp{root=UUID=...} kernel > parameter. This is > usually more reliable, but in some cases it may not be appropriate. To > disable the use of UUIDs, set this option to @samp{true}. > > +@item GRUB_DISABLE_LINUX_PARTUUID > +If @command{grub-mkconfig} cannot identify the root filesystem via its > +universally-unique indentifier (UUID), @command{grub-mkconfig} will use the > UUID > +of the partition containing the filesystem to identify the root filesystem to > +the Linux kernel via a @samp{root=PARTUUID=...} kernel parameter. This is > not > +as reliable as using the filesystem UUID, but is more reliable than using the > +Linux device names. When enabled, this option requires the Linux kernel > version s/When enabled, /When enabled, GRUB_DISABLE_LINUX_PARTUUID set to false, / or something like that. Otherwise it is unclear. Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel
[GRUB PARTUUID PATCH V9 4/5] Update grub script template files
Update grub-mkconfig.in and 10_linux.in to support grub-probe's new partuuid target. Update grub.texi documentation. The following table shows how GRUB_DISABLE_LINUX_UUID, GRUB_DISABLE_LINUX_PARTUUID, and initramfs detection interact: Initramfs GRUB_DISABLE_LINUX_PARTUUID GRUB_DISABLE_LINUX_UUID Linux Root detected Set Set ID Method False FalseFalsepart UUID False FalseTrue part UUID False True Falsedev name False True True dev name True FalseFalsefs UUID True FalseTrue part UUID True True Falsefs UUID True True True dev name Signed-off-by: Nicholas Vinson --- docs/grub.texi | 10 ++ util/grub-mkconfig.in | 3 +++ util/grub.d/10_linux.in | 18 +++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 65b4bbeda..06f0afe45 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1424,6 +1424,16 @@ the Linux kernel, using a @samp{root=UUID=...} kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to @samp{true}. +@item GRUB_DISABLE_LINUX_PARTUUID +If @command{grub-mkconfig} cannot identify the root filesystem via its +universally-unique indentifier (UUID), @command{grub-mkconfig} will use the UUID +of the partition containing the filesystem to identify the root filesystem to +the Linux kernel via a @samp{root=PARTUUID=...} kernel parameter. This is not +as reliable as using the filesystem UUID, but is more reliable than using the +Linux device names. When enabled, this option requires the Linux kernel version +to be greater than 2.6.37 (3.10 for systems using the MSDOS partition scheme) or +newer. To disable the use of partition UUIDs, set this option to @samp{true}. + @item GRUB_DISABLE_RECOVERY If this option is set to @samp{true}, disable the generation of recovery mode menu entries. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 35ef583b0..2360e 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`" @@ -188,6 +189,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 \ @@ -223,6 +225,7 @@ export GRUB_DEFAULT \ GRUB_TERMINAL_OUTPUT \ GRUB_SERIAL_COMMAND \ GRUB_DISABLE_LINUX_UUID \ + GRUB_DISABLE_LINUX_PARTUUID \ GRUB_DISABLE_RECOVERY \ GRUB_VIDEO_BACKEND \ GRUB_GFXMODE \ diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index faedf74e1..6916f1841 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -45,10 +45,16 @@ esac # btrfs may reside on multiple devices. We cannot pass them as value of root= parameter # and mounting btrfs requires user space scanning, so force UUID in this case. -if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ -|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ +if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ) \ +|| ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \ +|| ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ + && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \ || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} +elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \ +|| [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then + LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi @@ -242,7 +248,13 @@ while [ "x$list" != "x" ] ; do if test -z "${initramfs}" && test -z "${initrd_real}" ; 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} +if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \ + || [ "x${GRUB_DI