Commit 789aedba authored by Mike Hibler's avatar Mike Hibler

Modify LOADINFO command to include ACPI info for FreeBSD images.

node_type_attributes can now include a row with attrkey=use_acpi which can
either be set to:

  '1', if the FreeBSD image absolutely must use ACPI on this node_type
       in order to boot (e.g., our Dell SC440 machine)

  '0', if the FreeBSD image absolutely must NOT use ACPI on the node_type
       in order to boot (e.g., our pc2000s, possibly due to the IXP cards).

Otherwise, just don't set this attribute.

This value is queried by rc.frisbee and passed to slicefix after the disk
is loaded so that it can change /boot/loader.conf to enable/disable ACPI.

Note that ACPI (or lack thereof) has never been an issue with Linux or
Windows, so this is only meaningful to FreeBSD >= 5.0.

Note also that this does nothing for MFSes.  On machines that must use ACPI,
you need to use a special MFS for that node type (set via 'adminmfs_osid'
and 'diskloadmfs_osid' node_type_attributes).
parent 346c0562
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2006 University of Utah and the Flux Group.
* Copyright (c) 2000-2007 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -3470,7 +3470,7 @@ COMMAND_PROTOTYPE(doloadinfo)
MYSQL_ROW row;
char buf[MYBUFSIZE];
char *bufp = buf, *ebufp = &buf[sizeof(buf)];
char *disktype;
char *disktype, *useacpi;
int disknum, zfill;
/*
......@@ -3529,12 +3529,14 @@ COMMAND_PROTOTYPE(doloadinfo)
*/
disktype = DISKTYPE;
disknum = DISKNUM;
useacpi = "unknown";
res = mydb_query("select attrkey,attrvalue from nodes as n "
"left join node_type_attributes as a on "
" n.type=a.type "
"where (a.attrkey='bootdisk_unit' or "
" a.attrkey='disktype') and "
" a.attrkey='disktype' or "
" a.attrkey='use_acpi') and "
" n.node_id='%s'", 2, reqp->nodeid);
if (!res) {
......@@ -3556,12 +3558,15 @@ COMMAND_PROTOTYPE(doloadinfo)
else if (strcmp(row[0], "disktype") == 0) {
disktype = row[1];
}
else if (strcmp(row[0], "use_acpi") == 0) {
useacpi = row[1];
}
}
nrows--;
}
}
OUTPUT(bufp, ebufp - bufp, " DISK=%s%d ZFILL=%d\n",
disktype, disknum, zfill);
OUTPUT(bufp, ebufp - bufp, " DISK=%s%d ZFILL=%d ACPI=%s\n",
disktype, disknum, zfill, useacpi);
mysql_free_result(res);
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