From: Avnish Chouhan <avnish@linux.ibm.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: grub-devel@gnu.org, daniel.kiper@oracle.com, phcoder@gmail.com,
mchang@suse.com, glaubitz@physik.fu-berlin.de
Subject: Re: [PATCH v4] Mandatory install device check for PowerPC
Date: Thu, 29 Jan 2026 15:18:26 +0530 [thread overview]
Message-ID: <8fc5febd6aec2a999869dc68d6f9d308@linux.ibm.com> (raw)
In-Reply-To: <aXjkGc_78r1sCm3v@kitsune.suse.cz>
On 2026-01-27 21:43, Michal Suchánek wrote:
> Hello,
>
> how is this different from the previous revision?
Hi Michal,
Thank you so much for you views on the patch :)
There's a small change in the comment as addressed by John.
>
> On Tue, Jan 27, 2026 at 07:18:14PM +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 and machine is
>> detected
>> as PowerPC, the error will be thrown and it will terminates the
>> grub2-install
>> operation. Running grub2-install on PowerPC without the install_device
>> may
>> result in bootlist corruption. When no install device is specified, it
>> attempts
>> to load images from the filesystem, which leads to nvram bootlist
>> corruption.
>> The idea is to fail the operation and avoid creating the invalid boot
>> entry.
>>
>> Signed-off-by: Avnish Chouhan <avnish@linux.ibm.com>
>> ---
>> util/grub-install.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/util/grub-install.c b/util/grub-install.c
>> index 0602465..f7389b3 100644
>> --- a/util/grub-install.c
>> +++ b/util/grub-install.c
>> @@ -1289,6 +1289,19 @@ main (int argc, char *argv[])
>> is_prep = 0;
>> }
>> }
>> +#if defined(__powerpc__)
>
> Is this ifdef needed?
>
> This whole block is already in
> if (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275)
> and the same ifdef selects it as the default platform.
>
> Presumably grub-install should be able to install for other platforms,
> and as aresult such ifdefs are not welcome.
Sure. I'll drop this in next version!
>
>> + else
>> + {
>> + /*
>> + * As the machine has been detected as PowerPC and not a PowerMac.
>> We need to check
>> + * whether the install_device has been mentioned while installing.
>> If no device has been
>> + * mentioned, we need to exit and mark it as an error as the
>> install_device is required for
>> + * PowerPC installation. An installation with no device mentioned
>> may lead to corruptions.
> Corruptions of what?
"nvram bootlist corruption". I'll add this too!
Regards,
Avnish Chouhan
>> + */
>> + if (!install_device)
>> + grub_util_error ("%s", _("install device isn't specified,
>> required for PowerPC"));
>> + }
>> +#endif /* __powerpc__ */
>> }
>>
>> size_t ndev = 0;
>> --
>> 2.50.1 (Apple Git-155)
>
> Thanks
>
> Michal
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2026-01-29 9:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 13:48 [PATCH v4] Mandatory install device check for PowerPC Avnish Chouhan
2026-01-27 16:13 ` Michal Suchánek
2026-01-29 9:48 ` Avnish Chouhan [this message]
2026-01-29 9:52 ` Vladimir 'phcoder' Serbinenko
2026-01-29 10:59 ` Avnish Chouhan
2026-01-29 11:14 ` Michal Suchánek
2026-01-30 10:38 ` Avnish Chouhan
2026-01-30 12:00 ` Michal Suchánek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8fc5febd6aec2a999869dc68d6f9d308@linux.ibm.com \
--to=avnish@linux.ibm.com \
--cc=daniel.kiper@oracle.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.com \
--cc=msuchanek@suse.de \
--cc=phcoder@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.