All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Support for UEFI ESP in os-prober
@ 2012-09-29 15:04 Andrey Borzenkov
  2012-09-30 20:30 ` yannubuntu
  2012-10-01 11:25 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 2 replies; 17+ messages in thread
From: Andrey Borzenkov @ 2012-09-29 15:04 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

Attached are suggested implementation for UEFI support. Because ESP can
contain arbitrary number of boot entries, it is itself implemented as
extensible framework.

1. /usr/lib/os-prober/mounted/05efi

Makes basic plausibility checks (FAT and /EFI exists) and calls scripts
from /usr/lib/os-prober/mounted/efi/* to perform OS detection. Returns
detected bootladers in the form ${device}@${path}:${long}:${short}:efi

2. patch for /etc/grub.d/30_os-prober

creates "chainloader ${path}" entry from the above

3. Patch for /usr/lib/os-prober/mounted/20microsoft

It seems that on UEFI systems Windows sometimes installs both legacy and
UEFI bootloader. In this case os-prober adds menu entries for legacy
Windows boot which do not work from within UEFI GRUB bootloader. Patch
detects UEFI platform and skips running there. 

4. /usr/lib/os-prober/mounted/efi/20microsoft

Suggested implementation for Microsoft bootloader. We have no way to
create entries for individual OSes here (this would involve parsing BCD
store at the very least), so entry is titled as "Windows Boot Manager",
the same as is automatically added to UEFI boot menu.

This is successfully tested on VM with Windows 7/openSUSE 12.2 dual
boot. As openSUSE 12.2 comes with GRUB2 as default bootloader, this
issue seems to be hit by quite a number of users.

Comments?

-andrey

[-- Attachment #2: os-prober-skip-MS-legacy-on-UEFI.patch --]
[-- Type: text/x-patch, Size: 538 bytes --]

Index: b/os-probes/mounted/x86/20microsoft
===================================================================
--- a/os-probes/mounted/x86/20microsoft
+++ b/os-probes/mounted/x86/20microsoft
@@ -7,6 +7,12 @@ partition="$1"
 mpoint="$2"
 type="$3"
 
+# This script looks for legacy BIOS bootloaders only. Skip if running UEFI
+if [ -d /sys/firmware/efi ]; then
+	debug "Skipping legacy bootloaders on UEFI system"
+	exit 1
+fi
+
 # Weed out stuff that doesn't apply to us
 case "$type" in
 	ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;

[-- Attachment #3: 30_os-prober.patch --]
[-- Type: text/x-patch, Size: 766 bytes --]

--- /etc/grub.d/30_os-prober.orig	2012-09-28 22:12:51.047085849 +0400
+++ /etc/grub.d/30_os-prober	2012-09-29 18:35:25.949036128 +0400
@@ -144,6 +144,22 @@ EOF
 }
 EOF
     ;;
+    efi)
+
+	EFIPATH=${DEVICE#*@}
+	DEVICE=${DEVICE%@*}
+	onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
+      cat << EOF
+menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
+EOF
+      save_default_entry | sed -e "s/^/\t/"
+      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+
+      cat <<EOF
+	chainloader ${EFIPATH}
+}
+EOF
+    ;;
     linux)
       LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
       prepare_boot_cache=

[-- Attachment #4: 05efi --]
[-- Type: application/x-shellscript, Size: 959 bytes --]

[-- Attachment #5: 20microsoft --]
[-- Type: application/x-shellscript, Size: 614 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2012-09-29 15:04 [RFC] Support for UEFI ESP in os-prober Andrey Borzenkov
@ 2012-09-30 20:30 ` yannubuntu
  2012-10-01 11:25 ` Vladimir 'phcoder' Serbinenko
  1 sibling, 0 replies; 17+ messages in thread
From: yannubuntu @ 2012-09-30 20:30 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]

2012/9/29 Andrey Borzenkov <arvidjaar@gmail.com>

> Attached are suggested implementation for UEFI support. Because ESP can
> contain arbitrary number of boot entries, it is itself implemented as
> extensible framework.
>
> 1. /usr/lib/os-prober/mounted/05efi
>
> Makes basic plausibility checks (FAT and /EFI exists) and calls scripts
> from /usr/lib/os-prober/mounted/efi/* to perform OS detection. Returns
> detected bootladers in the form ${device}@${path}:${long}:${short}:efi
>
> 2. patch for /etc/grub.d/30_os-prober
>
> creates "chainloader ${path}" entry from the above
>
> 3. Patch for /usr/lib/os-prober/mounted/20microsoft
>
> It seems that on UEFI systems Windows sometimes installs both legacy and
> UEFI bootloader. In this case os-prober adds menu entries for legacy
> Windows boot which do not work from within UEFI GRUB bootloader. Patch
> detects UEFI platform and skips running there.
>
> 4. /usr/lib/os-prober/mounted/efi/20microsoft
>
> Suggested implementation for Microsoft bootloader. We have no way to
> create entries for individual OSes here (this would involve parsing BCD
> store at the very least), so entry is titled as "Windows Boot Manager",
> the same as is automatically added to UEFI boot menu.
>
> This is successfully tested on VM with Windows 7/openSUSE 12.2 dual
> boot. As openSUSE 12.2 comes with GRUB2 as default bootloader, this
> issue seems to be hit by quite a number of users.
>
> Comments?
>
> -andrey
>

Thanks Andrey for working on this.
- I confirm that Windows sometimes installs both Legacy and UEFI bootloader.
Example: http://paste.ubuntu.com/1248333
- For information, here is a report you may be interested in:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1024383

Regards
Yann

[-- Attachment #2: Type: text/html, Size: 2352 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2012-09-29 15:04 [RFC] Support for UEFI ESP in os-prober Andrey Borzenkov
  2012-09-30 20:30 ` yannubuntu
@ 2012-10-01 11:25 ` Vladimir 'phcoder' Serbinenko
  2013-05-31 14:48   ` Andrey Borzenkov
  1 sibling, 1 reply; 17+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2012-10-01 11:25 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1891 bytes --]

I haven‘t had time to view in details but os-prober isn‘t managed by us but
by debian-boot team so you need to contact them. Also I‘d prefer more of
detection to be done on runtime than it‘s done in current model
On Sep 29, 2012 5:04 PM, "Andrey Borzenkov" <arvidjaar@gmail.com> wrote:

> Attached are suggested implementation for UEFI support. Because ESP can
> contain arbitrary number of boot entries, it is itself implemented as
> extensible framework.
>
> 1. /usr/lib/os-prober/mounted/05efi
>
> Makes basic plausibility checks (FAT and /EFI exists) and calls scripts
> from /usr/lib/os-prober/mounted/efi/* to perform OS detection. Returns
> detected bootladers in the form ${device}@${path}:${long}:${short}:efi
>
> 2. patch for /etc/grub.d/30_os-prober
>
> creates "chainloader ${path}" entry from the above
>
> 3. Patch for /usr/lib/os-prober/mounted/20microsoft
>
> It seems that on UEFI systems Windows sometimes installs both legacy and
> UEFI bootloader. In this case os-prober adds menu entries for legacy
> Windows boot which do not work from within UEFI GRUB bootloader. Patch
> detects UEFI platform and skips running there.
>
> 4. /usr/lib/os-prober/mounted/efi/20microsoft
>
> Suggested implementation for Microsoft bootloader. We have no way to
> create entries for individual OSes here (this would involve parsing BCD
> store at the very least), so entry is titled as "Windows Boot Manager",
> the same as is automatically added to UEFI boot menu.
>
> This is successfully tested on VM with Windows 7/openSUSE 12.2 dual
> boot. As openSUSE 12.2 comes with GRUB2 as default bootloader, this
> issue seems to be hit by quite a number of users.
>
> Comments?
>
> -andrey
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>

[-- Attachment #2: Type: text/html, Size: 2350 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2012-10-01 11:25 ` Vladimir 'phcoder' Serbinenko
@ 2013-05-31 14:48   ` Andrey Borzenkov
  2013-05-31 16:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 17+ messages in thread
From: Andrey Borzenkov @ 2013-05-31 14:48 UTC (permalink / raw)
  To: grub-devel

В Mon, 1 Oct 2012 13:25:50 +0200
"Vladimir 'phcoder' Serbinenko" <phcoder@gmail.com> пишет:

> I haven‘t had time to view in details but os-prober isn‘t managed by us but
> by debian-boot team so you need to contact them. Also I‘d prefer more of
> detection to be done on runtime than it‘s done in current model

In the meantime os-prober part is integrated in Debian as of 1.58.
The patch adds missing part from grub2 side. How does it look like?

---
 ChangeLog                   |  5 +++++
 util/grub.d/30_os-prober.in | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e9ef17e..798369d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-31  Andrey Borzenkov <arvidjaar@gmail.com>
+
+	* util/grub.d/30_os-prober.in: Add support for probing EFI
+	System Partition (as of os-prober 1.58).
+
 2013-05-30  Josh Triplett  <josh@joshtriplett.org>
 
 	* grub-core/normal/cmdline.c (grub_cmdline_get): Fix Ctrl-u
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
index 04f32a1..5e3c5d8 100644
--- a/util/grub.d/30_os-prober.in
+++ b/util/grub.d/30_os-prober.in
@@ -149,6 +149,22 @@ EOF
 }
 EOF
     ;;
+    efi)
+
+	EFIPATH=${DEVICE#*@}
+	DEVICE=${DEVICE%@*}
+	onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
+      cat << EOF
+menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
+EOF
+      save_default_entry | sed -e "s/^/\t/"
+      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+
+      cat <<EOF
+	chainloader ${EFIPATH}
+}
+EOF
+    ;;
     linux)
       if [ "x$BTRFS" = "xbtrfs" ]; then
          LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid} ${BTRFSsubvol}  2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
-- 
tg: (f434947..) u/os-prober-efi (depends on: master)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-05-31 14:48   ` Andrey Borzenkov
@ 2013-05-31 16:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-05-31 17:03       ` Bruce Dubbs
  0 siblings, 1 reply; 17+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-05-31 16:12 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2176 bytes --]

On 31.05.2013 16:48, Andrey Borzenkov wrote:
> В Mon, 1 Oct 2012 13:25:50 +0200
> "Vladimir 'phcoder' Serbinenko" <phcoder@gmail.com> пишет:
> 
>> I haven‘t had time to view in details but os-prober isn‘t managed by us but
>> by debian-boot team so you need to contact them. Also I‘d prefer more of
>> detection to be done on runtime than it‘s done in current model
> 
> In the meantime os-prober part is integrated in Debian as of 1.58.
> The patch adds missing part from grub2 side. How does it look like?
> 
Go ahead. I must say I'm generally disappointed with os-prober and have
ideas to move away from it. I'll start another topic for it.
> ---
>  ChangeLog                   |  5 +++++
>  util/grub.d/30_os-prober.in | 16 ++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/ChangeLog b/ChangeLog
> index e9ef17e..798369d 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-05-31  Andrey Borzenkov <arvidjaar@gmail.com>
> +
> +	* util/grub.d/30_os-prober.in: Add support for probing EFI
> +	System Partition (as of os-prober 1.58).
> +
>  2013-05-30  Josh Triplett  <josh@joshtriplett.org>
>  
>  	* grub-core/normal/cmdline.c (grub_cmdline_get): Fix Ctrl-u
> diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
> index 04f32a1..5e3c5d8 100644
> --- a/util/grub.d/30_os-prober.in
> +++ b/util/grub.d/30_os-prober.in
> @@ -149,6 +149,22 @@ EOF
>  }
>  EOF
>      ;;
> +    efi)
> +
> +	EFIPATH=${DEVICE#*@}
> +	DEVICE=${DEVICE%@*}
> +	onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
> +      cat << EOF
> +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
> +EOF
> +      save_default_entry | sed -e "s/^/\t/"
> +      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
> +
> +      cat <<EOF
> +	chainloader ${EFIPATH}
> +}
> +EOF
> +    ;;
>      linux)
>        if [ "x$BTRFS" = "xbtrfs" ]; then
>           LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid} ${BTRFSsubvol}  2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-05-31 16:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-05-31 17:03       ` Bruce Dubbs
  2013-05-31 17:55         ` Chris Murphy
  2013-06-05 15:56         ` Mads Kiilerich
  0 siblings, 2 replies; 17+ messages in thread
From: Bruce Dubbs @ 2013-05-31 17:03 UTC (permalink / raw)
  To: The development of GNU GRUB

Vladimir 'φ-coder/phcoder' Serbinenko wrote:

> I must say I'm generally disappointed with os-prober and have
> ideas to move away from it. I'll start another topic for it.

I agree.  I would prefer adding an include command so grub.cfg could 
just do something like:

include /boot/grub/grub.d/*.cfg

and have an install procedure drop in one or more menu items instead of 
every os install or update rewriting the entire grub.cfg every time.

   -- Bruce Dubbs
      linuxfromscratch.org


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-05-31 17:03       ` Bruce Dubbs
@ 2013-05-31 17:55         ` Chris Murphy
  2013-06-05 15:56         ` Mads Kiilerich
  1 sibling, 0 replies; 17+ messages in thread
From: Chris Murphy @ 2013-05-31 17:55 UTC (permalink / raw)
  To: The development of GNU GRUB

On May 31, 2013, at 1:03 PM, Bruce Dubbs <bruce.dubbs@gmail.com> wrote:

> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> 
>> I must say I'm generally disappointed with os-prober and have
>> ideas to move away from it. I'll start another topic for it.
> 
> I agree.  I would prefer adding an include command so grub.cfg could just do something like:
> 
> include /boot/grub/grub.d/*.cfg
> 
> and have an install procedure drop in one or more menu items instead of every os install or update rewriting the entire grub.cfg every time.

Or for GRUB to be a lot more dynamic by scanning the EFI System partition for bootloaders it recognizes, an effectively creates a grub.cfg on the fly based on ESP contents, and NVRAM contents. I think the present behavior is unreliable, and makes GRUB a very narrowly useful boot manager. So the question is, does GRUB want to grow into a more capable boot manager rather than just a collection of bootloaders for different OS's.


Chris Murphy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-05-31 17:03       ` Bruce Dubbs
  2013-05-31 17:55         ` Chris Murphy
@ 2013-06-05 15:56         ` Mads Kiilerich
  2013-06-05 16:56           ` Andrey Borzenkov
                             ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Mads Kiilerich @ 2013-06-05 15:56 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Bruce Dubbs

On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
>> I must say I'm generally disappointed with os-prober and have
>> ideas to move away from it. I'll start another topic for it.
>
> I agree.  I would prefer adding an include command so grub.cfg could 
> just do something like:
>
> include /boot/grub/grub.d/*.cfg
>
> and have an install procedure drop in one or more menu items instead 
> of every os install or update rewriting the entire grub.cfg every time.

http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes 
such a configuration structure, and 
http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch 
implements it as a grub command.

/Mads


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 15:56         ` Mads Kiilerich
@ 2013-06-05 16:56           ` Andrey Borzenkov
  2013-06-05 17:21           ` Bruce Dubbs
  2013-06-05 17:51           ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 0 replies; 17+ messages in thread
From: Andrey Borzenkov @ 2013-06-05 16:56 UTC (permalink / raw)
  To: grub-devel

В Wed, 05 Jun 2013 17:56:40 +0200
Mads Kiilerich <mads@kiilerich.com> пишет:

> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
> > Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >
> >> I must say I'm generally disappointed with os-prober and have
> >> ideas to move away from it. I'll start another topic for it.
> >
> > I agree.  I would prefer adding an include command so grub.cfg could 
> > just do something like:
> >
> > include /boot/grub/grub.d/*.cfg
> >
> > and have an install procedure drop in one or more menu items instead 
> > of every os install or update rewriting the entire grub.cfg every time.
> 
> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes 
> such a configuration structure, 

It is rather (intentionally) limited in functionality. For a start, it
explicitly excludes possibility to boot Windows, making transition from
os-prober impossible.

>                                   and 
> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch 
> implements it as a grub command.
> 
> /Mads
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 15:56         ` Mads Kiilerich
  2013-06-05 16:56           ` Andrey Borzenkov
@ 2013-06-05 17:21           ` Bruce Dubbs
  2013-06-05 17:58             ` Andrey Borzenkov
  2013-06-05 17:51           ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 1 reply; 17+ messages in thread
From: Bruce Dubbs @ 2013-06-05 17:21 UTC (permalink / raw)
  To: Mads Kiilerich; +Cc: The development of GNU GRUB

Mads Kiilerich wrote:
> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
>> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>
>>> I must say I'm generally disappointed with os-prober and have
>>> ideas to move away from it. I'll start another topic for it.
>>
>> I agree.  I would prefer adding an include command so grub.cfg could
>> just do something like:
>>
>> include /boot/grub/grub.d/*.cfg
>>
>> and have an install procedure drop in one or more menu items instead
>> of every os install or update rewriting the entire grub.cfg every time.
>
> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
> such a configuration structure, and
> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
> implements it as a grub command.

Although that's a good start, it seems a little too specific.  What I 
had in mind would be the equivalent to the source command in bash.  For 
example,

if condition; then
   include (hd0,3)/grub/custom/themes/themeA.cfg
else
   include (hd0,2)/boot/grub/themes/themeB.cfg
fi

# Get menuentries
include /boot/grub/grub.d/*.cfg

I have no preference to the keyword.  Either include or source would work.

   -- Bruce


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 15:56         ` Mads Kiilerich
  2013-06-05 16:56           ` Andrey Borzenkov
  2013-06-05 17:21           ` Bruce Dubbs
@ 2013-06-05 17:51           ` Vladimir 'φ-coder/phcoder' Serbinenko
  2 siblings, 0 replies; 17+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-06-05 17:51 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1353 bytes --]

On 05.06.2013 17:56, Mads Kiilerich wrote:
> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
>> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>
>>> I must say I'm generally disappointed with os-prober and have
>>> ideas to move away from it. I'll start another topic for it.
>>
>> I agree.  I would prefer adding an include command so grub.cfg could
>> just do something like:
>>
>> include /boot/grub/grub.d/*.cfg
>>
>> and have an install procedure drop in one or more menu items instead
>> of every os install or update rewriting the entire grub.cfg every time.
> 
> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
> such a configuration structure, and
This standard apparently was done without any consideration of boot
loader point of view and probably without any input from bootloader guys
at all. I'm not ok with using it as is but can be used if ammended.
> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
> implements it as a grub command.
> 
Due to design limitations of design, it will break in some completely
reasonable cases. It can't be supported as-is.
> /Mads
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 17:21           ` Bruce Dubbs
@ 2013-06-05 17:58             ` Andrey Borzenkov
  2013-06-05 18:43               ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 17+ messages in thread
From: Andrey Borzenkov @ 2013-06-05 17:58 UTC (permalink / raw)
  To: grub-devel

В Wed, 05 Jun 2013 12:21:54 -0500
Bruce Dubbs <bruce.dubbs@gmail.com> пишет:

> Mads Kiilerich wrote:
> > On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
> >> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >>
> >>> I must say I'm generally disappointed with os-prober and have
> >>> ideas to move away from it. I'll start another topic for it.
> >>
> >> I agree.  I would prefer adding an include command so grub.cfg could
> >> just do something like:
> >>
> >> include /boot/grub/grub.d/*.cfg
> >>
> >> and have an install procedure drop in one or more menu items instead
> >> of every os install or update rewriting the entire grub.cfg every time.
> >
> > http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
> > such a configuration structure, and
> > http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
> > implements it as a grub command.
> 
> Although that's a good start, it seems a little too specific.  What I 
> had in mind would be the equivalent to the source command in bash.

grub already has "source" command.

>                                                                    For 
> example,
> 
> if condition; then
>    include (hd0,3)/grub/custom/themes/themeA.cfg
> else
>    include (hd0,2)/boot/grub/themes/themeB.cfg
> fi
> 
> # Get menuentries
> include /boot/grub/grub.d/*.cfg
> 

Implementing full-fledged globbing in grub is probably overkill; adding
"source_dir" command looks more doable. Something like

source_dir --suffix .cfg /boot/grub/grub.d 

Any takers? :)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 17:58             ` Andrey Borzenkov
@ 2013-06-05 18:43               ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-06-05 18:53                 ` Bruce Dubbs
  2013-06-05 19:03                 ` Andrey Borzenkov
  0 siblings, 2 replies; 17+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-06-05 18:43 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2067 bytes --]

On 05.06.2013 19:58, Andrey Borzenkov wrote:
> В Wed, 05 Jun 2013 12:21:54 -0500
> Bruce Dubbs <bruce.dubbs@gmail.com> пишет:
> 
>> Mads Kiilerich wrote:
>>> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
>>>> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>>>
>>>>> I must say I'm generally disappointed with os-prober and have
>>>>> ideas to move away from it. I'll start another topic for it.
>>>>
>>>> I agree.  I would prefer adding an include command so grub.cfg could
>>>> just do something like:
>>>>
>>>> include /boot/grub/grub.d/*.cfg
>>>>
>>>> and have an install procedure drop in one or more menu items instead
>>>> of every os install or update rewriting the entire grub.cfg every time.
>>>
>>> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
>>> such a configuration structure, and
>>> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
>>> implements it as a grub command.
>>
>> Although that's a good start, it seems a little too specific.  What I 
>> had in mind would be the equivalent to the source command in bash.
> 
> grub already has "source" command.
> 
>>                                                                    For 
>> example,
>>
>> if condition; then
>>    include (hd0,3)/grub/custom/themes/themeA.cfg
>> else
>>    include (hd0,2)/boot/grub/themes/themeB.cfg
>> fi
>>
>> # Get menuentries
>> include /boot/grub/grub.d/*.cfg
>>
> 
> Implementing full-fledged globbing in grub is probably overkill; adding
> "source_dir" command looks more doable. Something like
> 
We already have globbing. Trouble with this approach is that ->dir
method may be slow or (especially on network systems) absent. It should
not be relied upon unless absolutely necessary.
> source_dir --suffix .cfg /boot/grub/grub.d 
> 
> Any takers? :)
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 18:43               ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2013-06-05 18:53                 ` Bruce Dubbs
  2013-06-05 19:03                 ` Andrey Borzenkov
  1 sibling, 0 replies; 17+ messages in thread
From: Bruce Dubbs @ 2013-06-05 18:53 UTC (permalink / raw)
  To: The development of GNU GRUB
  Cc: Vladimir 'φ-coder/phcoder' Serbinenko

Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 05.06.2013 19:58, Andrey Borzenkov wrote:
>> В Wed, 05 Jun 2013 12:21:54 -0500
>> Bruce Dubbs <bruce.dubbs@gmail.com> пишет:
>>
>>> Mads Kiilerich wrote:
>>>> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
>>>>> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>>>>
>>>>>> I must say I'm generally disappointed with os-prober and have
>>>>>> ideas to move away from it. I'll start another topic for it.
>>>>>
>>>>> I agree.  I would prefer adding an include command so grub.cfg could
>>>>> just do something like:
>>>>>
>>>>> include /boot/grub/grub.d/*.cfg
>>>>>
>>>>> and have an install procedure drop in one or more menu items instead
>>>>> of every os install or update rewriting the entire grub.cfg every time.
>>>>
>>>> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
>>>> such a configuration structure, and
>>>> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
>>>> implements it as a grub command.
>>>
>>> Although that's a good start, it seems a little too specific.  What I
>>> had in mind would be the equivalent to the source command in bash.
>>
>> grub already has "source" command.
>>
>>>                                                                     For
>>> example,
>>>
>>> if condition; then
>>>     include (hd0,3)/grub/custom/themes/themeA.cfg
>>> else
>>>     include (hd0,2)/boot/grub/themes/themeB.cfg
>>> fi
>>>
>>> # Get menuentries
>>> include /boot/grub/grub.d/*.cfg
>>>
>>
>> Implementing full-fledged globbing in grub is probably overkill; adding
>> "source_dir" command looks more doable. Something like
>>
> We already have globbing. Trouble with this approach is that ->dir
> method may be slow or (especially on network systems) absent. It should
> not be relied upon unless absolutely necessary.

This reminds me of the phrase "perfect is the enemy of good".  What 
percentage of systems rely on network capabilities for booting?

>> source_dir --suffix .cfg /boot/grub/grub.d


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 18:43               ` Vladimir 'φ-coder/phcoder' Serbinenko
  2013-06-05 18:53                 ` Bruce Dubbs
@ 2013-06-05 19:03                 ` Andrey Borzenkov
  2013-06-05 19:29                   ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 1 reply; 17+ messages in thread
From: Andrey Borzenkov @ 2013-06-05 19:03 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]

В Wed, 05 Jun 2013 20:43:58 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> On 05.06.2013 19:58, Andrey Borzenkov wrote:
> > В Wed, 05 Jun 2013 12:21:54 -0500
> > Bruce Dubbs <bruce.dubbs@gmail.com> пишет:
> > 
> >> Mads Kiilerich wrote:
> >>> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
> >>>> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >>>>
> >>>>> I must say I'm generally disappointed with os-prober and have
> >>>>> ideas to move away from it. I'll start another topic for it.
> >>>>
> >>>> I agree.  I would prefer adding an include command so grub.cfg could
> >>>> just do something like:
> >>>>
> >>>> include /boot/grub/grub.d/*.cfg
> >>>>
> >>>> and have an install procedure drop in one or more menu items instead
> >>>> of every os install or update rewriting the entire grub.cfg every time.
> >>>
> >>> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
> >>> such a configuration structure, and
> >>> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
> >>> implements it as a grub command.
> >>
> >> Although that's a good start, it seems a little too specific.  What I 
> >> had in mind would be the equivalent to the source command in bash.
> > 
> > grub already has "source" command.
> > 
> >>                                                                    For 
> >> example,
> >>
> >> if condition; then
> >>    include (hd0,3)/grub/custom/themes/themeA.cfg
> >> else
> >>    include (hd0,2)/boot/grub/themes/themeB.cfg
> >> fi
> >>
> >> # Get menuentries
> >> include /boot/grub/grub.d/*.cfg
> >>
> > 
> > Implementing full-fledged globbing in grub is probably overkill; adding
> > "source_dir" command looks more doable. Something like
> > 
> We already have globbing.

Ehh .. you mean that

for i in /boot/grub/grub.d/*.cfg; do
  source $i
done

already works?

>                           Trouble with this approach is that ->dir
> method may be slow or (especially on network systems) absent. It should
> not be relied upon unless absolutely necessary.
> > source_dir --suffix .cfg /boot/grub/grub.d 
> > 
> > Any takers? :)
> > 
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> > 
> 
> 


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
  2013-06-05 19:03                 ` Andrey Borzenkov
@ 2013-06-05 19:29                   ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 17+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-06-05 19:29 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]

On 05.06.2013 21:03, Andrey Borzenkov wrote:
> В Wed, 05 Jun 2013 20:43:58 +0200
> Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:
> 
>> On 05.06.2013 19:58, Andrey Borzenkov wrote:
>>> В Wed, 05 Jun 2013 12:21:54 -0500
>>> Bruce Dubbs <bruce.dubbs@gmail.com> пишет:
>>>
>>>> Mads Kiilerich wrote:
>>>>> On 05/31/2013 07:03 PM, Bruce Dubbs wrote:
>>>>>> Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>>>>>
>>>>>>> I must say I'm generally disappointed with os-prober and have
>>>>>>> ideas to move away from it. I'll start another topic for it.
>>>>>>
>>>>>> I agree.  I would prefer adding an include command so grub.cfg could
>>>>>> just do something like:
>>>>>>
>>>>>> include /boot/grub/grub.d/*.cfg
>>>>>>
>>>>>> and have an install procedure drop in one or more menu items instead
>>>>>> of every os install or update rewriting the entire grub.cfg every time.
>>>>>
>>>>> http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ describes
>>>>> such a configuration structure, and
>>>>> http://pkgs.fedoraproject.org/cgit/grub2.git/plain/0362-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
>>>>> implements it as a grub command.
>>>>
>>>> Although that's a good start, it seems a little too specific.  What I 
>>>> had in mind would be the equivalent to the source command in bash.
>>>
>>> grub already has "source" command.
>>>
>>>>                                                                    For 
>>>> example,
>>>>
>>>> if condition; then
>>>>    include (hd0,3)/grub/custom/themes/themeA.cfg
>>>> else
>>>>    include (hd0,2)/boot/grub/themes/themeB.cfg
>>>> fi
>>>>
>>>> # Get menuentries
>>>> include /boot/grub/grub.d/*.cfg
>>>>
>>>
>>> Implementing full-fledged globbing in grub is probably overkill; adding
>>> "source_dir" command looks more doable. Something like
>>>
>> We already have globbing.
> 
> Ehh .. you mean that
> 
> for i in /boot/grub/grub.d/*.cfg; do
>   source $i
> done
> 
> already works?
> 
Yes, just make sure that regexp module is loaded.
>>                           Trouble with this approach is that ->dir
>> method may be slow or (especially on network systems) absent. It should
>> not be relied upon unless absolutely necessary.
>>> source_dir --suffix .cfg /boot/grub/grub.d 
>>>
>>> Any takers? :)
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/grub-devel
>>>
>>
>>
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [RFC] Support for UEFI ESP in os-prober
       [not found] <mailman.26139.1370458399.22519.grub-devel@gnu.org>
@ 2013-06-06 15:33 ` Tom Davies
  0 siblings, 0 replies; 17+ messages in thread
From: Tom Davies @ 2013-06-06 15:33 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

Hi :)
From a users pov.  


The thing i like about the current system is that it now successfully picks-up the various "Recovery" partitions created by OEMs or by Windows 7 (probably others too)

Ideally i would like the main Windows partitions near the top of the menu and those "Recovery" ones near the bottom along with options to test memory and stuff.  


I still find it frustrating that older kernels don't get hidden away but i gather that is dealt with by a more recent version than the one i am using.  


However, Grub2 is pretty fantastic as it is.  It seems a lot more robust and sophisticated than Grub-legacy and Lilo.  Even those 2 were far more robust and advanced than the Windows ones.  So, good work all!  

Many thanks and regards from 

Tom :)  

[-- Attachment #2: Type: text/html, Size: 2668 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-06-06 15:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-29 15:04 [RFC] Support for UEFI ESP in os-prober Andrey Borzenkov
2012-09-30 20:30 ` yannubuntu
2012-10-01 11:25 ` Vladimir 'phcoder' Serbinenko
2013-05-31 14:48   ` Andrey Borzenkov
2013-05-31 16:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-31 17:03       ` Bruce Dubbs
2013-05-31 17:55         ` Chris Murphy
2013-06-05 15:56         ` Mads Kiilerich
2013-06-05 16:56           ` Andrey Borzenkov
2013-06-05 17:21           ` Bruce Dubbs
2013-06-05 17:58             ` Andrey Borzenkov
2013-06-05 18:43               ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-06-05 18:53                 ` Bruce Dubbs
2013-06-05 19:03                 ` Andrey Borzenkov
2013-06-05 19:29                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-06-05 17:51           ` Vladimir 'φ-coder/phcoder' Serbinenko
     [not found] <mailman.26139.1370458399.22519.grub-devel@gnu.org>
2013-06-06 15:33 ` Tom Davies

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.