Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-27 Thread Daniel Kiper
On Fri, Mar 27, 2020 at 10:44:09AM -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, Mar 25, 2020 at 06:38:54PM +0100, Daniel Kiper wrote:
> > On Mon, Mar 23, 2020 at 07:53:15PM +0800, Tianjia Zhang wrote:
> > > When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
> > > commands instead of 'linux' and 'initrd'.
> > >
> > > Signed-off-by: Jia Zhang 
> > > Signed-off-by: Tianjia Zhang 
> >
> > Sorry, NAK! We do not want more "linuxefi" kinda commands in the GRUB 
> > upstream.
>
> Are you saying that the existing 'linux' and 'initrd' should be fixed
> to work under EFI?

Exactly, this is the plan for after 2.06 release.

Daniel

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-27 Thread Konrad Rzeszutek Wilk
On Wed, Mar 25, 2020 at 06:38:54PM +0100, Daniel Kiper wrote:
> On Mon, Mar 23, 2020 at 07:53:15PM +0800, Tianjia Zhang wrote:
> > When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
> > commands instead of 'linux' and 'initrd'.
> >
> > Signed-off-by: Jia Zhang 
> > Signed-off-by: Tianjia Zhang 
> 
> Sorry, NAK! We do not want more "linuxefi" kinda commands in the GRUB 
> upstream.

Are you saying that the existing 'linux' and 'initrd' should be fixed
to work under EFI?

Thanks.

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-25 Thread Tianjia Zhang

I got it, Thanks for review.

Tianjia

On 2020/3/26 1:38, Daniel Kiper wrote:

On Mon, Mar 23, 2020 at 07:53:15PM +0800, Tianjia Zhang wrote:

When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
commands instead of 'linux' and 'initrd'.

Signed-off-by: Jia Zhang 
Signed-off-by: Tianjia Zhang 


Sorry, NAK! We do not want more "linuxefi" kinda commands in the GRUB upstream.

Daniel

___
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


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-25 Thread Daniel Kiper
On Mon, Mar 23, 2020 at 07:53:15PM +0800, Tianjia Zhang wrote:
> When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
> commands instead of 'linux' and 'initrd'.
>
> Signed-off-by: Jia Zhang 
> Signed-off-by: Tianjia Zhang 

Sorry, NAK! We do not want more "linuxefi" kinda commands in the GRUB upstream.

Daniel

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-23 Thread Javier Martinez Canillas
On 3/23/20 7:31 PM, Julian Andres Klode wrote:
> On Mon, Mar 23, 2020 at 07:26:59PM +0100, Javier Martinez Canillas wrote:
>> On 3/23/20 12:53 PM, Tianjia Zhang wrote:
>>> When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
>>> commands instead of 'linux' and 'initrd'.
>>>
>>
>> These two commands are added by most distros as a part of their Secure Boot
>> patch-set, but aren't present in upstream GRUB so this patch doesn't apply.
> 
> I was about to say that at least in Ubuntu, linux automatically loads
> via EFI and then falls back to native grub kernel loading if that
> does not work (and it's not on secure boot). Which IMO is the right
> thing to do.
> 

In Fedora also always 'linux' and 'initrd' is used nowadays. There's no need to
have separate linux16, linuxefi and linux commands although these are supported
for backward compatibility.

Best regards,
-- 
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-23 Thread Julian Andres Klode
On Mon, Mar 23, 2020 at 07:26:59PM +0100, Javier Martinez Canillas wrote:
> On 3/23/20 12:53 PM, Tianjia Zhang wrote:
> > When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
> > commands instead of 'linux' and 'initrd'.
> >
> 
> These two commands are added by most distros as a part of their Secure Boot
> patch-set, but aren't present in upstream GRUB so this patch doesn't apply.

I was about to say that at least in Ubuntu, linux automatically loads
via EFI and then falls back to native grub kernel loading if that
does not work (and it's not on secure boot). Which IMO is the right
thing to do.

Also the other point is that this actually breaks stuff if you install
both MBR and EFI bootloaders. Which is something you actually should
be doing because you still want to be able to boot even if user switches
their BIOS from UEFI to BIOS or vice versa or other shenanigans.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer  i speak de, en

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-23 Thread Javier Martinez Canillas
On 3/23/20 12:53 PM, Tianjia Zhang wrote:
> When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
> commands instead of 'linux' and 'initrd'.
>

These two commands are added by most distros as a part of their Secure Boot
patch-set, but aren't present in upstream GRUB so this patch doesn't apply.
 
Best regards,
-- 
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] grub.d: Use linuxefi and initrdefi commands if platform is efi

2020-03-23 Thread Paul Menzel

Dear Tianjia,


Am 23.03.20 um 12:53 schrieb Tianjia Zhang:

When the platform is EFI platform, use 'linuxefi' and 'initrdefi'
commands instead of 'linux' and 'initrd'.

Signed-off-by: Jia Zhang 
Signed-off-by: Tianjia Zhang 
---
  util/grub.d/10_linux.in | 11 +--
  1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index e8b01c0d0..8c5c3dab7 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -138,10 +138,17 @@ linux_entry ()
  fi
  printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
fi
+  if [ "@GRUB_PLATFORM@" != "efi" ] ; then
+linux_cmd="linux"
+initrd_cmd="initrd"
+  else
+linux_cmd="linuxefi"
+initrd_cmd="initrdefi"
+  fi
message="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
echo'$(echo "$message" | grub_quote)'
-   linux   ${rel_dirname}/${basename} 
root=${linux_root_device_thisversion} ro ${args}
+   ${linux_cmd}${rel_dirname}/${basename} 
root=${linux_root_device_thisversion} ro ${args}
  EOF
if test -n "${initrd}" ; then
  # TRANSLATORS: ramdisk isn't identifier. Should be translated.
@@ -152,7 +159,7 @@ EOF
  done
  sed "s/^/$submenu_indentation/" << EOF
echo'$(echo "$message" | grub_quote)'
-   initrd  $(echo $initrd_path)
+   ${initrd_cmd}   $(echo $initrd_path)
  EOF
fi
sed "s/^/$submenu_indentation/" << EOF


What problem does your change address?


Kind regards,

Paul

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel