Commit 8a7891c9 authored by Mike Hibler's avatar Mike Hibler

Database state necessary for one-time PXE booting and WinPE image loading.

parent e73ab8cc
......@@ -1687,6 +1687,7 @@ CREATE TABLE `images` (
`global` tinyint(4) NOT NULL default '0',
`mbr_version` varchar(50) NOT NULL default '1',
`updated` datetime default NULL,
`format` varchar(8) NOT NULL default 'ndz',
`access_key` varchar(64) default NULL,
`auth_uuid` varchar(64) default NULL,
`auth_key` varchar(512) default NULL,
......@@ -2516,6 +2517,7 @@ CREATE TABLE `nodes` (
`next_boot_path` text,
`next_boot_cmd_line` text,
`pxe_boot_path` text,
`next_pxe_boot_path` text,
`rpms` text,
`deltas` text,
`tarballs` text,
......@@ -4816,4 +4818,3 @@ CREATE TABLE `wires` (
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
......@@ -971,6 +971,7 @@ REPLACE INTO table_regex VALUES ('images','wholedisk','text','redirect','default
REPLACE INTO table_regex VALUES ('images','mbr_version','text','redirect','default:int',0,0,NULL);
REPLACE INTO table_regex VALUES ('images','max_concurrent','text','redirect','default:int',0,0,NULL);
REPLACE INTO table_regex VALUES ('images','reboot_waittime','text','redirect','default:int',0,0,NULL);
REPLACE INTO table_regex VALUES ('images','format','text','regex','^[-\\w]+$',1,8,NULL);
REPLACE INTO table_regex VALUES ('node_types','new_type','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('node_types','node_type','text','regex','^[-\\w]+$',1,30,NULL);
......
#
# Support for WinPE/ImageX loaded images.
# Need an image format field to identify when the process is needed.
# Need a "one shot" PXE boot field too.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (! DBSlotExists("images", "format")) {
DBQueryFatal("alter table images add ".
" `format` varchar(8) NOT NULL default 'ndz' ".
" after updated");
#
# Everything is considered an ndz image right now so we don't
# do any other fix-up here.
#
# At Utah we have other types (for motes, switches, etc),
# but probably not anywhere else.
#
}
if (! DBSlotExists("nodes", "next_pxe_boot_path")) {
DBQueryFatal("alter table nodes add ".
" `next_pxe_boot_path` text after `pxe_boot_path`");
}
DBQueryFatal("REPLACE INTO table_regex VALUES ".
"('images','format','text','regex',".
"'^[-\\\\w]+\$',1,8,NULL)");
return 0;
}
1;
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