Commit 2ba98533 authored by Mike Hibler's avatar Mike Hibler

Add two "loadinfo" params CONSOLE=<console-type> and BIOSDISK=<BIOS-bootdisk>

The former comes from the new console_type node or node_type attribute and
is used by slicefix to set the console to one of null, vga, or sio[1-4].

The latter comes from the pre-existing bootdisk_bios_id and is used by the
BSD slicefix to set the grub.conf root device in a Linux image.
parent 64993367
...@@ -4899,12 +4899,13 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -4899,12 +4899,13 @@ COMMAND_PROTOTYPE(doloadinfo)
MYSQL_ROW row, row2; MYSQL_ROW row, row2;
char buf[MYBUFSIZE]; char buf[MYBUFSIZE];
char *bufp = buf, *ebufp = &buf[sizeof(buf)]; char *bufp = buf, *ebufp = &buf[sizeof(buf)];
char *disktype, *useacpi, *useasf, *noclflush, *vgaonly; char *disktype, *useacpi, *useasf, *noclflush;
char *vgaonly, *consoletype;
char address[MYBUFSIZE]; char address[MYBUFSIZE];
char server_address[MYBUFSIZE]; char server_address[MYBUFSIZE];
char mbrvers[51]; char mbrvers[51];
char *loadpart, *OS, *prepare, *attrclause; char *loadpart, *OS, *prepare, *attrclause;
int disknum, nrows, zfill; int disknum, biosdisknum, nrows, zfill;
/* /*
* Get the address the node should contact to load its image * Get the address the node should contact to load its image
...@@ -5085,10 +5086,11 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -5085,10 +5086,11 @@ COMMAND_PROTOTYPE(doloadinfo)
*/ */
disktype = DISKTYPE; disktype = DISKTYPE;
disknum = DISKNUM; disknum = DISKNUM;
biosdisknum = -1;
useacpi = "unknown"; useacpi = "unknown";
useasf = "unknown"; useasf = "unknown";
noclflush = "unknown"; noclflush = "unknown";
vgaonly = (char *) NULL; vgaonly = consoletype = (char *) NULL;
/* /*
* This query is intended to select certain attributes from * This query is intended to select certain attributes from
...@@ -5106,9 +5108,11 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -5106,9 +5108,11 @@ COMMAND_PROTOTYPE(doloadinfo)
*/ */
attrclause = attrclause =
"(attrkey='bootdisk_unit' or " "(attrkey='bootdisk_unit' or "
" attrkey='bootdisk_bios_id' or "
" attrkey='disktype' or " " attrkey='disktype' or "
" attrkey='use_acpi' or " " attrkey='use_acpi' or "
" attrkey='use_asf' or " " attrkey='use_asf' or "
" attrkey='console_type' or "
" attrkey='vgaonly' or " " attrkey='vgaonly' or "
" attrkey='no_clflush')"; " attrkey='no_clflush')";
...@@ -5146,6 +5150,9 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -5146,6 +5150,9 @@ COMMAND_PROTOTYPE(doloadinfo)
if (strcmp(row2[0], "bootdisk_unit") == 0) { if (strcmp(row2[0], "bootdisk_unit") == 0) {
disknum = atoi(attrstr); disknum = atoi(attrstr);
} }
if (strcmp(row2[0], "bootdisk_biod_id") == 0) {
biosdisknum = strtol(attrstr, 0, 0);
}
else if (strcmp(row2[0], "disktype") == 0) { else if (strcmp(row2[0], "disktype") == 0) {
disktype = attrstr; disktype = attrstr;
} }
...@@ -5161,6 +5168,9 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -5161,6 +5168,9 @@ COMMAND_PROTOTYPE(doloadinfo)
else if (strcmp(row2[0], "vgaonly") == 0) { else if (strcmp(row2[0], "vgaonly") == 0) {
vgaonly = attrstr; vgaonly = attrstr;
} }
else if (strcmp(row2[0], "console_type") == 0) {
consoletype = attrstr;
}
} }
nrows2--; nrows2--;
} }
...@@ -5169,10 +5179,17 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -5169,10 +5179,17 @@ COMMAND_PROTOTYPE(doloadinfo)
bufp += OUTPUT(bufp, ebufp - bufp, bufp += OUTPUT(bufp, ebufp - bufp,
" DISK=%s%d ZFILL=%d ACPI=%s MBRVERS=%s ASF=%s PREPARE=%s NOCLFLUSH=%s", " DISK=%s%d ZFILL=%d ACPI=%s MBRVERS=%s ASF=%s PREPARE=%s NOCLFLUSH=%s",
disktype, disknum, zfill, useacpi, mbrvers, useasf, prepare, noclflush); disktype, disknum, zfill, useacpi, mbrvers, useasf, prepare, noclflush);
if (vgaonly) { if (consoletype) {
bufp += OUTPUT(bufp, ebufp - bufp,
" CONSOLE=%s", consoletype);
} else if (vgaonly) {
bufp += OUTPUT(bufp, ebufp - bufp, bufp += OUTPUT(bufp, ebufp - bufp,
" VGAONLY=%s", vgaonly); " VGAONLY=%s", vgaonly);
} }
if (biosdisknum >= 0) {
bufp += OUTPUT(bufp, ebufp - bufp,
" BIOSDISK=0x%02x", biosdisknum);
}
/* /*
* Do this here, so that we are not using strings above, * Do this here, so that we are not using strings above,
* that have been released to the malloc pool. * that have been released to the malloc pool.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment