[PATCH 1/2] Add support for extlinux.conf

Ahmad Fatoum a.fatoum at pengutronix.de
Mon May 4 06:29:17 PDT 2026


Hello Sascha,

On 4/27/26 10:58 AM, Sascha Hauer wrote:
> On Fri, Apr 24, 2026 at 04:53:59PM +0200, Ahmad Fatoum wrote:
>> Hello,
>>
>> On 4/24/26 10:46 AM, Alexander Shiyan wrote:
>>>> On 4/16/26 3:45 PM, Alexander Shiyan wrote:
>>>>> 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.

I think we can't get this to work properly anyhow. Besides root= there
are other options as well (e.g. rootfstype) that we won't be able to
exhaustively remove. Add on top of that, that an initrd may decide for
itself that another rootfs should be used anyway...

If a user knows for a given system that appending root= will work, they
can do that, but I think it's useful for the cases where it doesn't work
that there are two root='s, so the root appending is directly apparent.

We just need to ensure the appended root comes last, so it has precedence.

Cheers,
Ahmad

> 
> Sascha
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list