Commit e2d292dc authored by Mike Hibler's avatar Mike Hibler
Browse files

Grab bootdisk_unit out of DB (rather than assuming '0') for loadinfo command.

Needed for new PCs with SATA disks which start as "ad4".
parent 139b89c7
...@@ -3215,10 +3215,10 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -3215,10 +3215,10 @@ COMMAND_PROTOTYPE(doloadinfo)
*/ */
disktype = DISKTYPE; disktype = DISKTYPE;
disknum = DISKNUM; disknum = DISKNUM;
res = mydb_query("select disktype from nodes as n " res = mydb_query("select disktype,bootdisk_unit from nodes as n "
"left join node_types as nt on n.type = nt.type " "left join node_types as nt on n.type = nt.type "
"where n.node_id='%s'", "where n.node_id='%s'",
1, reqp->nodeid); 2, reqp->nodeid);
if (!res) { if (!res) {
error("doloadinfo: %s: DB Error getting disktype!\n", error("doloadinfo: %s: DB Error getting disktype!\n",
reqp->nodeid); reqp->nodeid);
...@@ -3229,6 +3229,8 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -3229,6 +3229,8 @@ COMMAND_PROTOTYPE(doloadinfo)
row = mysql_fetch_row(res); row = mysql_fetch_row(res);
if (row[0] && row[0][0]) if (row[0] && row[0][0])
disktype = row[0]; disktype = row[0];
if (row[1] && row[1][0])
disknum = atoi(row[1]);
} }
OUTPUT(bufp, ebufp - bufp, " DISK=%s%d\n", disktype, disknum); OUTPUT(bufp, ebufp - bufp, " DISK=%s%d\n", disktype, disknum);
mysql_free_result(res); mysql_free_result(res);
......
Supports Markdown
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