[SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Ian Kelling posted 1 patch 22 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/1526267527-10097-1-git-send-email-ian@iankelling.org
src/boot.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

[SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Posted by Ian Kelling 22 weeks ago
Signed-off-by: Ian Kelling <ian@iankelling.org>
---
 src/boot.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/boot.c b/src/boot.c
index ff705fd..ca64595 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -91,14 +91,14 @@ glob_prefix(const char *glob, const char *str)
     }
 }
 
-// Search the bootorder list for the given glob pattern.
+// Search the bootorder glob list for the given device description
 static int
-find_prio(const char *glob)
+find_prio(const char *desc)
 {
-    dprintf(1, "Searching bootorder for: %s\n", glob);
+    dprintf(1, "Searching bootorder for: %s\n", desc);
     int i;
     for (i = 0; i < BootorderCount; i++)
-        if (glob_prefix(glob, Bootorder[i]))
+        if (glob_prefix(Bootorder[i], desc))
             return i+1;
     return -1;
 }
-- 
2.7.4


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Re: [SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Posted by Paul Menzel 22 weeks ago
Dear Ian,


Am 14.05.2018 um 05:12 schrieb Ian Kelling:
> Signed-off-by: Ian Kelling <ian@iankelling.org>
> ---
>   src/boot.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/boot.c b/src/boot.c
> index ff705fd..ca64595 100644
> --- a/src/boot.c
> +++ b/src/boot.c
> @@ -91,14 +91,14 @@ glob_prefix(const char *glob, const char *str)
>       }
>   }
>   
> -// Search the bootorder list for the given glob pattern.
> +// Search the bootorder glob list for the given device description
>   static int
> -find_prio(const char *glob)
> +find_prio(const char *desc)
>   {
> -    dprintf(1, "Searching bootorder for: %s\n", glob);
> +    dprintf(1, "Searching bootorder for: %s\n", desc);
>       int i;
>       for (i = 0; i < BootorderCount; i++)
> -        if (glob_prefix(glob, Bootorder[i]))
> +        if (glob_prefix(Bootorder[i], desc))
>               return i+1;
>       return -1;
>   }

Very nice, but please also update the documention.


Kind regards,

Paul

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Re: [SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Posted by Ian Kelling 22 weeks ago
Paul Menzel <pmenzel@molgen.mpg.de> writes:
>
> Very nice, but please also update the documention.

Thanks. I'm usually good about docs, late Sunday night oversight I
guess. I'll submit a new patch version within a day or two.

-- 
Ian Kelling
https://iankelling.org

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Re: [SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Posted by Kevin O'Connor 22 weeks ago
On Sun, May 13, 2018 at 11:12:07PM -0400, Ian Kelling wrote:
> Signed-off-by: Ian Kelling <ian@iankelling.org>
> ---
>  src/boot.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/boot.c b/src/boot.c
> index ff705fd..ca64595 100644
> --- a/src/boot.c
> +++ b/src/boot.c
> @@ -91,14 +91,14 @@ glob_prefix(const char *glob, const char *str)
>      }
>  }
>  
> -// Search the bootorder list for the given glob pattern.
> +// Search the bootorder glob list for the given device description
>  static int
> -find_prio(const char *glob)
> +find_prio(const char *desc)
>  {
> -    dprintf(1, "Searching bootorder for: %s\n", glob);
> +    dprintf(1, "Searching bootorder for: %s\n", desc);
>      int i;
>      for (i = 0; i < BootorderCount; i++)
> -        if (glob_prefix(glob, Bootorder[i]))
> +        if (glob_prefix(Bootorder[i], desc))
>              return i+1;
>      return -1;
>  }

Thanks, but I don't think this is correct.  The idea is that the user
will pass a bootorder list, and that SeaBIOS will see if the devices
it finds match that list.  So, the SeaBIOS code generates the globs,
and the user generates the actual device names.

This was done that way because QEMU generates and passes a bootorder
list to SeaBIOS.  QEMU will generate the actual device names, but
SeaBIOS generally doesn't have enough information to generate the full
device names.  So, SeaBIOS globs the QEMU generated device names to
find a match.

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Re: [SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Posted by Ian Kelling 22 weeks ago
Kevin O'Connor <kevin@koconnor.net> writes:

> On Sun, May 13, 2018 at 11:12:07PM -0400, Ian Kelling wrote:
>> Signed-off-by: Ian Kelling <ian@iankelling.org>
>> ---
>>  src/boot.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>> 
>> diff --git a/src/boot.c b/src/boot.c
>> index ff705fd..ca64595 100644
>> --- a/src/boot.c
>> +++ b/src/boot.c
>> @@ -91,14 +91,14 @@ glob_prefix(const char *glob, const char *str)
>>      }
>>  }
>>  
>> -// Search the bootorder list for the given glob pattern.
>> +// Search the bootorder glob list for the given device description
>>  static int
>> -find_prio(const char *glob)
>> +find_prio(const char *desc)
>>  {
>> -    dprintf(1, "Searching bootorder for: %s\n", glob);
>> +    dprintf(1, "Searching bootorder for: %s\n", desc);
>>      int i;
>>      for (i = 0; i < BootorderCount; i++)
>> -        if (glob_prefix(glob, Bootorder[i]))
>> +        if (glob_prefix(Bootorder[i], desc))
>>              return i+1;
>>      return -1;
>>  }
>
> Thanks, but I don't think this is correct.  The idea is that the user
> will pass a bootorder list, and that SeaBIOS will see if the devices
> it finds match that list.  So, the SeaBIOS code generates the globs,
> and the user generates the actual device names.
>
> This was done that way because QEMU generates and passes a bootorder
> list to SeaBIOS.  QEMU will generate the actual device names, but
> SeaBIOS generally doesn't have enough information to generate the full
> device names.  So, SeaBIOS globs the QEMU generated device names to
> find a match.
>
> -Kevin

Ahh, now it makes sense. I searched for ways to generate open firmware
device names other than looking in seabios logs, but google gave me
basically nothing. Do you know how this can be done under gnu/linux for
physical (non-virtual) devices?

-- 
Ian Kelling
https://iankelling.org

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Re: [SeaBIOS] [PATCH] Enable shell-like * globing in bootorder entries

Posted by Kevin O'Connor 22 weeks ago
On Tue, May 15, 2018 at 11:03:16PM -0400, Ian Kelling wrote:
> Kevin O'Connor <kevin@koconnor.net> writes:
> > Thanks, but I don't think this is correct.  The idea is that the user
> > will pass a bootorder list, and that SeaBIOS will see if the devices
> > it finds match that list.  So, the SeaBIOS code generates the globs,
> > and the user generates the actual device names.
> >
> > This was done that way because QEMU generates and passes a bootorder
> > list to SeaBIOS.  QEMU will generate the actual device names, but
> > SeaBIOS generally doesn't have enough information to generate the full
> > device names.  So, SeaBIOS globs the QEMU generated device names to
> > find a match.
> >
> Ahh, now it makes sense. I searched for ways to generate open firmware
> device names other than looking in seabios logs, but google gave me
> basically nothing. Do you know how this can be done under gnu/linux for
> physical (non-virtual) devices?

The easiest way I know of is to look at the seabios logs.  I don't
know of any concise open firmware naming document.

SeaBIOS is only expecting a handful of devices - you can see what it
expects by looking at src/boot.c.  The examples there are:

    // Find pci device - for example: /pci@i0cf8/ethernet@5
    // Find scsi drive - for example: /pci@i0cf8/scsi@5/channel@0/disk@1,0
    // Find ata drive - for example: /pci@i0cf8/ide@1,1/drive@1/disk@0
    // Find floppy - for example: /pci@i0cf8/isa@1/fdc@03f1/floppy@0
    // Find pci rom - for example: /pci@i0cf8/scsi@3:rom2
    // Find named rom - for example: /rom@genroms/linuxboot.bin
    // Find usb - for example: /pci@i0cf8/usb@1,2/storage@1/channel@0/disk@0,0
    // Try usb-host/redir - for example: /pci@i0cf8/usb@1,2/usb-host@1

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios