Commit 05dd7e7f authored by Mike Hibler's avatar Mike Hibler
Browse files

In loadinfo command pass the default partition's OS type (FreeBSD, Linux)

Frisbee uses this to ensure that the DOS partition table entry has the
correct type for single-slice images.
parent b22c6f2d
...@@ -2701,7 +2701,7 @@ COMMAND_PROTOTYPE(dorouting) ...@@ -2701,7 +2701,7 @@ COMMAND_PROTOTYPE(dorouting)
/* /*
* Return address from which to load an image, along with the partition that * Return address from which to load an image, along with the partition that
* it should be written to * it should be written to and the OS type in that partition.
*/ */
COMMAND_PROTOTYPE(doloadinfo) COMMAND_PROTOTYPE(doloadinfo)
{ {
...@@ -2712,10 +2712,11 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -2712,10 +2712,11 @@ COMMAND_PROTOTYPE(doloadinfo)
/* /*
* Get the address the node should contact to load its image * Get the address the node should contact to load its image
*/ */
res = mydb_query("select load_address,loadpart from images as i " res = mydb_query("select load_address,loadpart,OS from images as i "
"left join current_reloads as r on i.imageid = r.image_id " "left join current_reloads as r on i.imageid = r.image_id "
"left join os_info as o on i.default_osid = o.osid "
"where node_id='%s'", "where node_id='%s'",
2, nodeid); 3, nodeid);
if (!res) { if (!res) {
error("doloadinfo: %s: DB Error getting loading address!\n", error("doloadinfo: %s: DB Error getting loading address!\n",
...@@ -2736,7 +2737,7 @@ COMMAND_PROTOTYPE(doloadinfo) ...@@ -2736,7 +2737,7 @@ COMMAND_PROTOTYPE(doloadinfo)
mysql_free_result(res); mysql_free_result(res);
return 0; return 0;
} }
sprintf(buf, "ADDR=%s PART=%s\n", row[0], row[1]); sprintf(buf, "ADDR=%s PART=%s PARTOS=%s\n", row[0], row[1], row[2]);
mysql_free_result(res); mysql_free_result(res);
client_writeback(sock, buf, strlen(buf), tcp); client_writeback(sock, buf, strlen(buf), tcp);
......
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