grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Mandatory install device check for PowerPC


From: Michal Suchánek
Subject: Re: [PATCH] Mandatory install device check for PowerPC
Date: Mon, 27 May 2024 16:14:55 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

Hello,

On Mon, May 27, 2024 at 07:07:19PM +0530, Avnish Chouhan wrote:
> This patch adds a check on install_device while installing grub for PowerPC.
> If install_device is not mentioned in grub2-install, the error will be thrown.
> Running grub2-install on PowerPC without the install_device may 
> result in boot corruption.
> 
> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
> ---
>  util/grub-install.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/util/grub-install.c b/util/grub-install.c
> index 5babc7a..192d2a8 100644
> --- a/util/grub-install.c
> +++ b/util/grub-install.c
> @@ -970,6 +970,8 @@ main (int argc, char *argv[])
>      case GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275:
>        if (install_device)
>       is_prep = 1;
> +      else
> +        grub_util_error ("%s", _("install device isn't specified"));
>        break;

As far as I understand this is fine for us (support for pSeries and
powernv platform).

However, this is not acceptable for upstream. Upstream also supports
Apple hardawre, and there the grub binary is installed as a file on the
filesystem rather than copied to a device.

Or to put it differently, there is the PReP sub-platform of
GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275 and currently the code does not
detect that is running on such platform (eg. by examining the device
tree) but rather it infers is_prep solely based on user input (the
device to install to) and in absence of the user input non-PReP platform
is assumed, leading to bootlist corruption when no boot device is given
on a PReP platform.

To fix this the logic should be inverted: Set is_prep should be set
based on what system is detected, and require an install device for
PReP platform.

Thanks

Michal

>      case GRUB_INSTALL_PLATFORM_MIPS_ARC:
>      case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
> -- 
> 2.39.3
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]