All of lore.kernel.org
 help / color / mirror / Atom feed
From: avnish <avnish@imap.linux.ibm.com>
To: grub-devel@gnu.org
Cc: grub-devel-request@gnu.org, phcoder@gmail.com,
	msuchanek@suse.com, mchang@suse.com
Subject: Re: [PATCH] Mandatory install device check for PowerPC
Date: Sat, 09 Nov 2024 11:20:08 +0530	[thread overview]
Message-ID: <513e1d4f2e2e30af17d0dc47792dbec4@imap.linux.ibm.com> (raw)
In-Reply-To: <mailman.4423.1731067669.1513.grub-devel@gnu.org>

Hi Vladimir,
Thank you so much for your response!

I have fine tuned the patch as per the last discussion (sorry, I missed 
the v2 tag). This latest patch will add install device check only to 
PowerPC machines. PowerMacs aren't affected by this change. The check is 
added when platform is detected as 
"GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275" along with machine detected as 
non PowerMac. As per my Power platform analysis, currently in 
"grub_install.c", it detects PowerMacs based on the file system detected 
(HFS or HFS+) and set the "is_prep" as 0 based on this finding. This new 
check will only be applicable to PowerPC. And in case of PowerMacs, it 
will allow grub_install even without mentioning the install device.
Thank you!


Regards,
Avnish Chouhan
> ------------------------------
> 
> Message: 5
> Date: Fri, 8 Nov 2024 15:07:29 +0300
> From: "Vladimir 'phcoder' Serbinenko" <phcoder@gmail.com>
> To: The development of GNU GRUB <grub-devel@gnu.org>
> Subject: Re: [PATCH] Mandatory install device check for PowerPC
> Message-ID:
> 	<CAEaD8JMqP4_uP5cZutSMGWvGMxbHAvNh10VCMO4ZcbqvLAQ9zw@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> As discussed in another thread, this breaks installing from x86 onto
> removable disk for PPC Mac which is a supported workflow
> 
> Le ven. 8 nov. 2024, 14:13, Avnish Chouhan <avnish@linux.ibm.com> a 
> écrit :
> 
>> 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>
>> ---
>>  grub-install.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>> 
>> diff --git a/util/grub-install.c b/util/grub-install.c
>> index 7dc5657..a049f53 100644
>> --- a/util/grub-install.c
>> +++ b/util/grub-install.c
>> @@ -1289,6 +1289,17 @@ main (int argc, char *argv[])
>>               is_prep = 0;
>>             }
>>         }
>> +      else
>> +        {
>> +         /*
>> +          * As the machine has been detected as PowerPC and not the
>> 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.
>> +          */
>> +           if (!install_device)
>> +             grub_util_error ("%s", _("install device isn't specified
>> required for PowerPC"));
>> +        }
>>      }
>> 
>>    size_t ndev = 0;
>> --
>> 2.39.3
>> 
>> 
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <https://lists.gnu.org/archive/html/grub-devel/attachments/20241108/22e8b62a/attachment.htm>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 
> 
> ------------------------------
> 
> End of Grub-devel Digest, Vol 249, Issue 30
> *******************************************

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

       reply	other threads:[~2024-11-09  5:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4423.1731067669.1513.grub-devel@gnu.org>
2024-11-09  5:50 ` avnish [this message]
2024-11-11  9:13   ` [PATCH] Mandatory install device check for PowerPC Michal Suchánek
     [not found] <mailman.9605.1731316609.21424.grub-devel@gnu.org>
2024-11-28 10:41 ` Avnish Chouhan
2025-01-06  6:01   ` Avnish Chouhan
2024-11-08 11:11 Avnish Chouhan
2024-11-08 12:07 ` Vladimir 'phcoder' Serbinenko
  -- strict thread matches above, loose matches on Subject: below --
2024-05-27 13:37 Avnish Chouhan
2024-05-27 13:53 ` Vladimir 'phcoder' Serbinenko
2024-05-27 14:14 ` Michal Suchánek
2024-05-29 12:45   ` avnish

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=513e1d4f2e2e30af17d0dc47792dbec4@imap.linux.ibm.com \
    --to=avnish@imap.linux.ibm.com \
    --cc=grub-devel-request@gnu.org \
    --cc=grub-devel@gnu.org \
    --cc=mchang@suse.com \
    --cc=msuchanek@suse.com \
    --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.