All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Mandatory install device check for PowerPC
@ 2024-05-27 13:37 Avnish Chouhan
  2024-05-27 13:53 ` Vladimir 'phcoder' Serbinenko
  2024-05-27 14:14 ` Michal Suchánek
  0 siblings, 2 replies; 10+ messages in thread
From: Avnish Chouhan @ 2024-05-27 13:37 UTC (permalink / raw)
  To: grub-devel; +Cc: brking, meghanaprakash, msuchanek, mchang, Avnish Chouhan

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;
     case GRUB_INSTALL_PLATFORM_MIPS_ARC:
     case GRUB_INSTALL_PLATFORM_MIPSEL_ARC:
-- 
2.39.3


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

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] Mandatory install device check for PowerPC
@ 2024-11-08 11:11 Avnish Chouhan
  2024-11-08 12:07 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 10+ messages in thread
From: Avnish Chouhan @ 2024-11-08 11:11 UTC (permalink / raw)
  To: grub-devel
  Cc: daniel.kiper, brking, meghanaprakash, msuchanek, mchang,
	Avnish Chouhan

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread
[parent not found: <mailman.4423.1731067669.1513.grub-devel@gnu.org>]
[parent not found: <mailman.9605.1731316609.21424.grub-devel@gnu.org>]

end of thread, other threads:[~2025-01-06  6:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-27 13:37 [PATCH] Mandatory install device check for PowerPC Avnish Chouhan
2024-05-27 13:53 ` Vladimir 'phcoder' Serbinenko
2024-05-27 14:14 ` Michal Suchánek
2024-05-29 12:45   ` avnish
  -- strict thread matches above, loose matches on Subject: below --
2024-11-08 11:11 Avnish Chouhan
2024-11-08 12:07 ` Vladimir 'phcoder' Serbinenko
     [not found] <mailman.4423.1731067669.1513.grub-devel@gnu.org>
2024-11-09  5:50 ` avnish
2024-11-11  9:13   ` 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

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.