From 789aedba01d0b059939c7dded5f0d8626d613fe5 Mon Sep 17 00:00:00 2001 From: Mike Hibler <mike@flux.utah.edu> Date: Tue, 9 Jan 2007 21:08:28 +0000 Subject: [PATCH] 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). --- tmcd/tmcd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tmcd/tmcd.c b/tmcd/tmcd.c index 44540e402e..88978ab30f 100644 --- a/tmcd/tmcd.c +++ b/tmcd/tmcd.c @@ -1,6 +1,6 @@ /* * 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); -- GitLab