* include/grub/ieee1275/ieee1275.h: Introduce flag for firmwares

that hang if GRUB tries to setup colors.
* term/ieee1275/ofconsole.c (grub_ofconsole_init): Don't set
colors for firmwares that don't support it.
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_set_flag):
Recognize Open Hack'Ware, set flags to work around its
limitations.
This commit is contained in:
proski 2008-01-24 08:21:43 +00:00
parent 605e36ed3e
commit d08bbb491e
4 changed files with 38 additions and 6 deletions

View file

@ -46,12 +46,16 @@ grub_ieee1275_set_flag (enum grub_ieee1275_flag flag)
grub_ieee1275_flags |= (1 << flag);
}
#define SF "SmartFirmware(tm)"
#define OHW "PPC Open Hack'Ware"
static void
grub_ieee1275_find_options (void)
{
grub_ieee1275_phandle_t root;
grub_ieee1275_phandle_t options;
grub_ieee1275_phandle_t openprom;
grub_ieee1275_phandle_t bootrom;
int rc;
int realmode = 0;
char tmp[32];
@ -69,7 +73,6 @@ grub_ieee1275_find_options (void)
rc = grub_ieee1275_get_property (openprom, "CodeGen-copyright",
tmp, sizeof (tmp), 0);
#define SF "SmartFirmware(tm)"
if (rc >= 0 && !grub_strncmp (tmp, SF, sizeof (SF) - 1))
is_smartfirmware = 1;
@ -133,8 +136,21 @@ grub_ieee1275_find_options (void)
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY);
}
if (! grub_ieee1275_finddevice ("/rom/boot-rom", &bootrom))
{
rc = grub_ieee1275_get_property (bootrom, "model", tmp, sizeof (tmp), 0);
if (rc >= 0 && !grub_strncmp (tmp, OHW, sizeof (OHW) - 1))
{
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT);
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS);
}
}
}
#undef SF
#undef OHW
void cmain (void);
void
cmain (void)