diff options
author | Helge Deller <deller@gmx.de> | 2020-12-29 19:17:09 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2020-12-29 19:17:09 +0100 |
commit | 320f23368b4450385213151cd0d39d899b49f90d (patch) | |
tree | 93c9ab8059e687558b62687ea21a78ad3219798f | |
parent | ab20b235e5bcc6c296651bf94374e31dbe64c0da (diff) | |
download | palo-320f23368b4450385213151cd0d39d899b49f90d.tar.gz |
Fix manufacturing mode on C8000 commit
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | ipl/ipl.c | 35 |
1 files changed, 17 insertions, 18 deletions
@@ -20,6 +20,21 @@ extern char _end, _start, _edata; int Debug = 0; int interactive = 0; +/* + * Beware: pdc_model_sysmodel() may return a machine name which has trailing + * spaces. + */ +static char sys_model_name[81]; + +static const char *get_machine_model() +{ + if ((sys_model_name[0] == 0) && + pdc_model_sysmodel(sys_model_name) != PDC_OK) + strcpy(sys_model_name, "unknown"); + + return sys_model_name; +} + void flush_data_cache(char *start, size_t length) { char *end = start + length; @@ -413,8 +428,8 @@ interact(int *ok) /* turn on firmware manufacturing mode on C8000 workstation */ if (numbuf[0] == 'm') { /* hidden option! */ - const char *model = get_machine_model() - if (strcmp(model, "9000/785/C8000", 14) == 0) { + const char *model = get_machine_model(); + if (strncmp(model, "9000/785/C8000", 14) == 0) { *(unsigned char *)0xfffffff0f04300a0 = 0x4d; pdc_do_reset(); } @@ -451,22 +466,6 @@ interact(int *ok) } /* - * Beware: pdc_model_sysmodel() may return a machine name which has trailing - * spaces. - */ -static char sys_model_name[81]; - -static const char *get_machine_model() -{ - if ((sys_model_name[0] == 0) && - pdc_model_sysmodel(sys_model_name) != PDC_OK) - strcpy(sys_model_name, "unknown"); - - return &sys_model_name; -} - - -/* * On some server models the serial port of the GSP/Management card which * mirrors the console port shows up as ttyS1 instead of ttyS0. This happens * on older Linux kernels which set up a serial port for the Diva AUX port. |