Mandatory install device check for PowerPC
PATCH 1/1 Mandatory install device check for PowerPC
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.
--- util/grub-install.c | 2 ++ 1 file changed, 2 insertions(+)
util/grub-install.c +2 -0
@@ -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 :
Signature · 7 lines
2.39.3 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 7 lines · Avnish Chouhan
This patch adds a check on
install_devicewhile installing grub for PowerPC.
Ifinstall_deviceis not mentioned in grub2-install, the error will be thrown.
Running grub2-install on PowerPC without theinstall_devicemay result in boot corruption.
This breaks PowerMac booting which doesn't have install device.
Quoted 23 lines
Signed-off-by Avnish Chouhan <[email protected]>--- util/grub-install.c | 2 ++ 1 file changed, 2 insertions(+)util/grub-install.c +2
-1@@ -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
Quoted 5 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Hello,
Quoted 15 lines · Avnish Chouhan
This patch adds a check on
install_devicewhile installing grub for PowerPC. Ifinstall_deviceis not mentioned in grub2-install, the error will be thrown. Running grub2-install on PowerPC without theinstall_devicemay result in boot corruption.Signed-off-by Avnish Chouhan <[email protected]>--- util/grub-install.c | 2 ++ 1 file changed, 2 insertions(+)util/grub-install.c +0
-0
util/grub-install.c main (int argc, char *argv[]) · line 975
Quoted 6 lines
util/grub-install.c +2
-0@@ -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
Quoted 5 lines
util/grub-install.c +0
-0case GRUB_INSTALL_PLATFORM_MIPS_ARC :case GRUB_INSTALL_PLATFORM_MIPSEL_ARC :Signature · 1 line
2.39.3
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Hi Michal,
Thank you so much for a response!
We'll work on to figure out the type of machine.
On no_prep, as per my analysis. Even with no install device given while installing. We observe boot corruption on some specific setups (mostly where we have multiple valid PReP partition available on the machine. And corruption probably due to wrong PReP picked up by installer. And as the installer picked the valid PReP available, we don't get any errors. Thank you!
Regards,
Avnish Chouhan
Quoted 40 lines · Michal Suchánek
Hello,
Quoted 15 lines · Avnish Chouhan
This patch adds a check on
install_devicewhile installing grub for PowerPC. Ifinstall_deviceis not mentioned in grub2-install, the error will be thrown. Running grub2-install on PowerPC without theinstall_devicemay result in boot corruption.Signed-off-by Avnish Chouhan <[email protected]>--- util/grub-install.c | 2 ++ 1 file changed, 2 insertions(+)util/grub-install.c +0
-0util/grub-install.c main (int argc, char *argv[]) · line 975
Quoted 6 lines
util/grub-install.c +2
-0@@ -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_IEEE1275and currently the code does not detect that is running on such platform (eg. by examining the device tree) but rather it infersis_prepsolely 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.
Quoted 13 lines
To fix this the logic should be inverted: Set
is_prepshould be set based on what system is detected, and require an install device for PReP platform.Thanks
Michal
Quoted 5 lines
util/grub-install.c +0
-1case GRUB_INSTALL_PLATFORM_MIPS_ARC :case GRUB_INSTALL_PLATFORM_MIPSEL_ARC : --2.39.3
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel