Commit b60fc1c5 authored by Leigh Stoller's avatar Leigh Stoller

Change def_boot_image_id to def_boot_osid for new os_info table.

Also copy bootwhat.h from my oskit tree and build from local copy.
parent 09ca4749
......@@ -24,11 +24,11 @@ DBOBJ = bootinfo_null.o bootinfo_cfile.o bootinfo_mysql.o
INCS = -I/usr/local/include
ifeq "$(filter -DLBS, $(CFLAGS))" "-DLBS"
INCS += -I/build/oskit-debug/install/include
else
INCS += -I/n/moab/z/mike/flux/install.debug/include
endif
#ifeq "$(filter -DLBS, $(CFLAGS))" "-DLBS"
#INCS += -I/build/oskit-debug/install/include
#else
#INCS += -I/n/moab/z/mike/flux/install.debug/include
#endif
CFLAGS += $(INCS) $(DBFLAG) -DSOLARIS -DHAVE_SOCKADDR_SA_LEN -DUSE_RECVMSG \
-DCONFPATH='"$(INSTALL_ETCDIR)/"' -DTBDBNAME='"$(TBDBNAME)"'
......
......@@ -4,8 +4,7 @@
#include <stdio.h>
#include <syslog.h>
#include <signal.h>
#include <oskit/boot/bootwhat.h>
#include "bootwhat.h"
static void log_bootwhat(struct in_addr ipaddr, boot_what_t *bootinfo);
static void onhup(int sig);
......
......@@ -3,7 +3,7 @@
#include <stdio.h>
#include <syslog.h>
#include <oskit/boot/bootwhat.h>
#include "bootwhat.h"
#include <mysql/mysql.h>
#ifdef USE_MYSQL_DB
......@@ -27,15 +27,15 @@ query_bootinfo_db(struct in_addr ipaddr, boot_what_t *info)
MYSQL_ROW row;
char dbquery[] =
"select n.next_boot_path, n.next_boot_cmd_line, "
"n.def_boot_image_id, "
"n.def_boot_osid, "
"p.partition, n.def_boot_cmd_line, n.def_boot_path from nodes "
"as n left join partitions as p on n.node_id=p.node_id and "
"n.def_boot_image_id=p.image_id left join interfaces as i on "
"n.def_boot_osid=p.osid left join interfaces as i on "
"i.node_id=n.node_id where i.IP = '%s'";
#define NEXT_BOOT_PATH 0
#define NEXT_BOOT_CMD_LINE 1
#define DEF_BOOT_IMAGE_ID 2
#define DEF_BOOT_OSID 2
#define PARTITION 3
#define DEF_BOOT_CMD_LINE 4
#define DEF_BOOT_PATH 5
......@@ -154,7 +154,7 @@ query_bootinfo_db(struct in_addr ipaddr, boot_what_t *info)
#undef NEXT_BOOT_PATH
#undef NEXT_BOOT_CMD_LINE
#undef DEF_BOOT_IMAGE_ID
#undef DEF_BOOT_OSID
#undef PARTITION
#undef DEF_BOOT_CMD_LINE
#undef DEF_BOOT_PATH
......
/*
* Copyright (c) 2000 University of Utah and the Flux Group.
* All rights reserved.
* @OSKIT-FLUX-GPLUS@
*/
#ifndef _OSKIT_BOOT_BOOTWHAT_H_
#define _OSKIT_BOOT_BOOTWHAT_H_
#define BOOTWHAT_DSTPORT 6969
#define BOOTWHAT_SRCPORT 9696
/*
* This is the structure we pass back and forth between a oskit kernel
* and a server running on some other machine, that tells what to do.
*/
#define MAX_BOOT_DATA 512
#define MAX_BOOT_PATH 256
#define MAX_BOOT_CMDLINE ((MAX_BOOT_DATA - MAX_BOOT_PATH) - 32)
typedef struct {
int opcode;
int status;
char data[MAX_BOOT_DATA];
} boot_info_t;
/* Opcode */
#define BIOPCODE_BOOTWHAT_REQUEST 1 /* What to boot request */
#define BIOPCODE_BOOTWHAT_REPLY 2 /* What to boot reply */
#define BIOPCODE_BOOTWHAT_ACK 3 /* Ack to Reply */
/* BOOTWHAT Reply */
typedef struct {
int type;
union {
/*
* Type is BIBOOTWHAT_TYPE_PART
*
* Specifies the partition number.
*/
int partition;
/*
* Type is BIBOOTWHAT_TYPE_SYSID
*
* Specifies the PC BIOS filesystem type.
*/
int sysid;
/*
* Type is BIBOOTWHAT_TYPE_MB
*
* Specifies a multiboot kernel pathway suitable for TFTP.
*/
struct {
struct in_addr tftp_ip;
char filename[MAX_BOOT_PATH];
} mb;
} what;
char cmdline[1];
} boot_what_t;
/* What type of thing to boot */
#define BIBOOTWHAT_TYPE_PART 1 /* Boot a partition number */
#define BIBOOTWHAT_TYPE_SYSID 2 /* Boot a system ID */
#define BIBOOTWHAT_TYPE_MB 3 /* Boot a multiboot image */
/* Status */
#define BISTAT_SUCCESS 0
#define BISTAT_FAIL 1
#endif /* _OSKIT_BOOT_BOOTWHAT_H_ */
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