aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu/readconfig.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-03 18:45:42 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-07-03 18:45:42 -0700
commit09dcba81bb7220e929093913bbfcb2c47e0ed4fb (patch)
tree509fa3f1f5b55f7e7ee5f6f7b50fa2ea8ae3720d /com32/menu/readconfig.c
parent9de789906be3d913a89189c15ba4eff40f37022f (diff)
downloadsyslinux-09dcba81bb7220e929093913bbfcb2c47e0ed4fb.tar.gz
syslinux-09dcba81bb7220e929093913bbfcb2c47e0ed4fb.tar.xz
syslinux-09dcba81bb7220e929093913bbfcb2c47e0ed4fb.zip
Allow the initrd to be specified on a separate linesyslinux-3.71-pre4
Allow the initrd to be specified on a separate line from command-line options (append). This apparently can help certain tools.
Diffstat (limited to 'com32/menu/readconfig.c')
-rw-r--r--com32/menu/readconfig.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index 10201938..e26105ad 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -200,6 +200,7 @@ struct labeldata {
const char *kernel;
enum kernel_type type;
const char *append;
+ const char *initrd;
const char *menulabel;
const char *passwd;
char *helptext;
@@ -222,6 +223,7 @@ clear_label_data(struct labeldata *ld)
refstr_put(ld->label);
refstr_put(ld->kernel);
refstr_put(ld->append);
+ refstr_put(ld->initrd);
refstr_put(ld->menulabel);
refstr_put(ld->passwd);
@@ -324,6 +326,9 @@ record(struct menu *m, struct labeldata *ld, const char *append)
ipp = ipoptions;
*ipp = '\0';
+ if (ld->initrd)
+ ipp += sprintf(ipp, " initrd=%s", ld->initrd);
+
if (ld->ipappend) {
ipappend = syslinux_ipappend_strings();
for (i = 0; i < ipappend->count; i++) {
@@ -862,6 +867,14 @@ static void parse_config_file(FILE *f)
refstr_put(append);
append = a;
}
+ } else if ( looking_at(p, "initrd") ) {
+ const char *a = refstrdup(skipspace(p+6));
+ if ( ld.label ) {
+ refstr_put(ld.initrd);
+ ld.initrd = a;
+ } else {
+ /* Ignore */
+ }
} else if ( looking_at(p, "label") ) {
p = skipspace(p+5);
record(m, &ld, append);
@@ -870,6 +883,7 @@ static void parse_config_file(FILE *f)
ld.type = KT_KERNEL;
ld.passwd = NULL;
ld.append = NULL;
+ ld.initrd = NULL;
ld.menulabel = NULL;
ld.helptext = NULL;
ld.ipappend = ipappend;