iPXE
Data Structures | Functions | Variables
reboot_cmd.c File Reference

Reboot command. More...

#include <getopt.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/reboot.h>

Go to the source code of this file.

Data Structures

struct  reboot_options
 "reboot" options More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int reboot_exec (int argc, char **argv)
 The "reboot" command.

Variables

static struct option_descriptor reboot_opts []
 "reboot" option list
static struct command_descriptor reboot_cmd
 "reboot" command descriptor
struct command reboot_command __command
 "reboot" command

Detailed Description

Reboot command.

Definition in file reboot_cmd.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int reboot_exec ( int  argc,
char **  argv 
) [static]

The "reboot" command.

Parameters:
argcArgument count
argvArgument list
Return values:
rcReturn status code

Definition at line 60 of file reboot_cmd.c.

References parse_options(), rc, reboot(), and reboot_options::warm.

                                                 {
        struct reboot_options opts;
        int rc;

        /* Parse options */
        if ( ( rc = parse_options ( argc, argv, &reboot_cmd, &opts ) ) != 0 )
                return rc;

        /* Reboot system */
        reboot ( opts.warm );

        return 0;
}

Variable Documentation

struct option_descriptor reboot_opts[] [static]
Initial value:
 {
        OPTION_DESC ( "warm", 'w', no_argument,
                      struct reboot_options, warm, parse_flag ),
}

"reboot" option list

Definition at line 44 of file reboot_cmd.c.

struct command_descriptor reboot_cmd [static]
Initial value:

"reboot" command descriptor

Definition at line 50 of file reboot_cmd.c.

struct command reboot_command __command
Initial value:
 {
        .name = "reboot",
        .exec = reboot_exec,
}

"reboot" command

Definition at line 75 of file reboot_cmd.c.