[PATCH 1/2] Add support for extlinux.conf
Alexander Shiyan
eagle.alexander923 at gmail.com
Mon Apr 27 10:34:47 PDT 2026
Hello, Sasha.
...
> > >>> This adds support for the extlinux.conf configuration format, commonly
> > >>> used by Syslinux and many Linux distributions. The configuration file
> > >>> is typically located at /boot/extlinux/extlinux.conf or
> > >>> /extlinux/extlinux.conf and defines boot entries with kernel, initrd,
> > >>> device tree, and command line options.
> > > ...
> > >>> +static int extlinux_boot(struct bootentry *be, int verbose, int dryrun)
> > >>> +{
> > >>> + struct extlinux_entry *e =
> > >>> + container_of(be, struct extlinux_entry, entry);
> > >>> + char *kernel_abs, *initrd_abs = NULL, *fdt_abs = NULL;
> > >>> + struct bootm_data data = {};
> > >>> + int ret;
> > >>> +
> > >>> + bootm_data_init_defaults(&data);
> > >>> +
> > >>> + data.dryrun = max_t(int, dryrun, data.dryrun);
> > >>> + data.verbose = max(verbose, data.verbose);
> > >>> + data.appendroot = true;
> > >>
> > >> Not sure this is a good idea because of potential of clashing with
> > >> extlinux appended command line options.
> > >
> > > globalvar_add_bool("extlinux.fix_root", NULL); ?
> >
> > global.extlinux.strip_root to remove root=
> > and bootm.appendroot to add barebox' own root?
>
> We already have the latter, so nothing to do here.
>
> Shouldn't we by default remove the root= option once data->appendroot is
> set? Also in the bootspec case we do not want to end up with two root=
> options.
Is this method better?
I haven't tested it yet, but it goes something like this:
if (getenv_bool("bootm.appendroot", (int *)&data.appendroot))
data.appendroot = true;
if (e->append) {
/*
* The same rootfs image may be launched from eMMC or SD card.
* Remove any hardcoded root= parameter from "append" to avoid
* conflicts, then let barebox automatically add the correct
* root= (via appendroot) based on the boot device.
*/
if (data.appendroot) {
char *append = remove_param(e->append, "ROOT=");
free(e->append);
e->append = append;
}
globalvar_add_simple("linux.bootargs.dyn.extlinux", e->append);
}
More information about the barebox
mailing list