bootctl.c revision eb9da376d76b48585b3b63b4f91903b54f7abd36
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering This file is part of systemd.
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering Copyright 2013 Kay Sievers
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering systemd is free software; you can redistribute it and/or modify it
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering under the terms of the GNU Lesser General Public License as published by
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering (at your option) any later version.
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering systemd is distributed in the hope that it will be useful, but
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering Lesser General Public License for more details.
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering You should have received a copy of the GNU Lesser General Public License
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poetteringstatic int help(void) {
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering "Query or change firmware and boot manager settings.\n\n"
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering " -h --help Show this help\n"
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering " --version Show package version\n"
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering " status Show current boot settings\n",
82659fd7571bda0f3dce9755b89a23c411d53ddaLennart Poetteringstatic int parse_argv(int argc, char *argv[]) {
4819ff0358b6317c195fd4b1768e03d09c871070Lennart Poettering { "version", no_argument, NULL, ARG_VERSION },
ac5e3a505e49c80b56c971a8fc13bacac961640dJan Synacek while ((c = getopt_long(argc, argv, "+hH:P", options, NULL)) >= 0) {
ac5e3a505e49c80b56c971a8fc13bacac961640dJan Synacek switch (c) {
case ARG_VERSION:
return -EINVAL;
int err;
if (!in)
return -ENOMEM;
if (err < 0)
goto err;
if (err < 0)
goto err;
err:
return err;
size_t i;
int err;
if (err < 0)
return -ENOMEM;
printf(" Partition: /dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
printf(" File: %s%s\n", draw_special_char(DRAW_TREE_RIGHT), info->fw_entries[info->fw_entry_active].path);
printf(" Partition: /dev/disk/by-partuuid/%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
return err;
const char* verb;
MORE,
LESS,
} argc_cmp;
const int argc;
} verbs[] = {
int left;
if (left <= 0)
help();
return -EINVAL;
case EQUAL:
return -EINVAL;
case MORE:
return -EINVAL;
case LESS:
return -EINVAL;
log_open();
goto finish;
goto finish;
return retval;