boot-loader.c revision 7b4d7cc08283e5485dcfa49ffdf1915de1d5e81b
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Kay Sievers
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <getopt.h>
#include <locale.h>
#include <string.h>
#include <ctype.h>
#include "boot.h"
#include "boot-loader.h"
#include "build.h"
#include "util.h"
#include "strv.h"
#include "conf-files.h"
static char *loader_fragment_read_title(const char *fragment) {
FILE *f;
if (!f)
return NULL;
char *s;
size_t l;
if (l < 1)
continue;
s = line;
while (isspace(s[0]))
s++;
if (s[0] == '#')
continue;
if (!startswith(s, "title"))
continue;
s += strlen("title");
if (!isspace(s[0]))
continue;
while (isspace(s[0]))
s++;
break;
}
fclose(f);
return title;
}
unsigned int count;
unsigned int i;
int err;
if (err < 0)
return err;
if (!info->loader_entries)
return -ENOMEM;
for (i = 0; i < count; i++) {
return -ENOMEM;
}
}
return 0;
}
char *fn;
unsigned int i;
if (!loader_active)
return -ENOENT;
if (info->loader_entries_count == 0)
return -ENOENT;
return -ENOMEM;
for (i = 0; i < info->loader_entries_count; i++) {
info->loader_entry_active = i;
break;
}
}
return 0;
}