2010-11-21 16:39:36 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
* License, or any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-07-20 19:55:45 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
* 02110-1301, USA.
|
2010-11-21 16:39:36 +00:00
|
|
|
*/
|
|
|
|
|
|
2007-01-19 01:13:12 +00:00
|
|
|
#include <stdio.h>
|
2010-11-21 16:39:36 +00:00
|
|
|
#include <getopt.h>
|
2010-04-19 20:16:01 +01:00
|
|
|
#include <ipxe/command.h>
|
2010-11-21 16:39:36 +00:00
|
|
|
#include <ipxe/parseopt.h>
|
2010-11-20 17:20:03 +00:00
|
|
|
#include <ipxe/netdevice.h>
|
2010-11-22 21:04:30 +00:00
|
|
|
#include <hci/ifmgmt_cmd.h>
|
2007-01-10 02:03:20 +00:00
|
|
|
#include <usr/autoboot.h>
|
2006-12-20 07:04:08 +00:00
|
|
|
|
2009-05-01 15:41:06 +01:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
|
|
2010-11-21 16:39:36 +00:00
|
|
|
/** @file
|
|
|
|
|
*
|
|
|
|
|
* Booting commands
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** "autoboot" command descriptor */
|
|
|
|
|
static struct command_descriptor autoboot_cmd =
|
2010-11-22 21:04:30 +00:00
|
|
|
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
|
2011-03-04 12:14:51 +00:00
|
|
|
"[<interface>...]" );
|
2010-11-21 16:39:36 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* "autoboot" command
|
|
|
|
|
*
|
|
|
|
|
* @v argc Argument count
|
|
|
|
|
* @v argv Argument list
|
|
|
|
|
* @ret rc Return status code
|
|
|
|
|
*/
|
2007-01-14 00:06:23 +00:00
|
|
|
static int autoboot_exec ( int argc, char **argv ) {
|
2010-11-22 21:04:30 +00:00
|
|
|
return ifcommon_exec ( argc, argv, &autoboot_cmd, netboot, 0 );
|
2010-11-20 17:20:03 +00:00
|
|
|
}
|
|
|
|
|
|
2010-11-21 16:39:36 +00:00
|
|
|
/** Booting commands */
|
2010-11-20 17:20:03 +00:00
|
|
|
struct command autoboot_commands[] __command = {
|
|
|
|
|
{
|
|
|
|
|
.name = "autoboot",
|
|
|
|
|
.exec = autoboot_exec,
|
|
|
|
|
},
|
2006-12-20 07:04:08 +00:00
|
|
|
};
|