/* '-' can signal do not use global APPEND */
if (!strcmp(syslinux_opt->append, "-"))
opt->boot_args = talloc_strdup(opt, "");
- else
+ else if (global_append)
opt->boot_args = talloc_asprintf(opt, "%s %s",
global_append,
syslinux_opt->append);
- } else
+ else
+ opt->boot_args = talloc_strdup(opt, syslinux_opt->append);
+ } else if (global_append)
opt->boot_args = talloc_strdup(opt, global_append);
if (!opt->boot_args)
/*
* set the global defaults
* by spec 'default' defaults to 'linux' and
- * 'implicit' defaults to '1', we also just set
- * and empty string in 'append' to make it easier
- * in syslinux_finish
+ * 'implicit' defaults to '1'
*/
conf_set_global_option(conf, "default", "linux");
conf_set_global_option(conf, "implicit", "1");
- conf_set_global_option(conf, "append", "");
for (filename = syslinux_conf_files; *filename; filename++) {
/*
check_name(opt, "backup");
check_resolved_local_resource(opt->boot_image, ctx->device, "/backup/vmlinuz");
- check_args(opt, " root=/dev/sdb");
+ check_args(opt, "root=/dev/sdb");
check_resolved_local_resource(opt->initrd, ctx->device, "/boot/initrd");
}
KERNEL /test/vmlinuz
APPEND -
+LABEL onlyglobal
+KERNEL /only/vmlinuz
+
#endif
void run_test(struct parser_test *test)
ctx = test->ctx;
- check_boot_option_count(ctx, 3);
- opt = get_boot_option(ctx, 2);
+ check_boot_option_count(ctx, 4);
+
+ opt = get_boot_option(ctx, 3);
check_name(opt, "linux");
check_resolved_local_resource(opt->boot_image, ctx->device, "/vmlinuz");
check_args(opt, "console=ttyS0 console=tty0");
check_not_present_resource(opt->initrd);
- opt = get_boot_option(ctx, 1);
+ opt = get_boot_option(ctx, 2);
check_name(opt, "backup");
check_resolved_local_resource(opt->boot_image, ctx->device, "/backup/vmlinuz");
check_args(opt, "console=ttyS0 root=/dev/sdb");
check_resolved_local_resource(opt->initrd, ctx->device, "/boot/initrd");
- opt = get_boot_option(ctx, 0);
+ opt = get_boot_option(ctx, 1);
check_name(opt, "hyphen");
check_resolved_local_resource(opt->boot_image, ctx->device, "/test/vmlinuz");
check_args(opt, "");
check_not_present_resource(opt->initrd);
+
+ opt = get_boot_option(ctx, 0);
+
+ check_name(opt, "onlyglobal");
+ check_resolved_local_resource(opt->boot_image, ctx->device, "/only/vmlinuz");
+ check_args(opt, "console=ttyS0");
+ check_not_present_resource(opt->initrd);
}