+ opt = state->opt->option;
+ assert(opt);
+ assert(opt->name);
+ assert(opt->boot_args);
+
+ /* populate the boot option from state data */
+ if (state->initrd_size) {
+ opt->boot_args = talloc_asprintf(opt, "ramdisk_size=%s %s",
+ state->initrd_size, opt->boot_args);
+ }
+
+ if (state->ramdisk) {
+ opt->boot_args = talloc_asprintf(opt, "ramdisk=%s %s",
+ state->initrd_size, opt->boot_args);
+ }
+
+ if (state->root) {
+ opt->boot_args = talloc_asprintf(opt, "root=%s %s",
+ state->root, opt->boot_args);
+ }
+
+ if (state->read_only && state->read_write) {
+ pb_log("boot option %s specified both 'ro' and 'rw', "
+ "using 'rw'\n", opt->name);
+ state->read_only = false;
+ }
+
+ if (state->read_only || state->read_write) {
+ opt->boot_args = talloc_asprintf(opt, "%s %s",
+ state->read_only ? "ro" : "rw",
+ opt->boot_args);
+ }
+
+ if (state->literal) {
+ opt->boot_args = talloc_strdup(opt, state->literal);
+ }
+
+ opt->description = talloc_asprintf(opt, "%s %s %s",