[PATCH 06/14] common: add generic machine partitions interface

Sascha Hauer sha at pengutronix.de
Wed Apr 14 11:08:48 BST 2021


On Tue, Apr 13, 2021 at 12:34:54AM +0200, Ahmad Fatoum wrote:
> Both Fastboot and DFU have their own global variables that allow
> specifying the partitions that can be flashed via the environment.
> With the upcoming addition of the USB mass storage gadget, we will need
> some way to define the partitions there as well.
> 
> Instead of adding yet another way download method-specific variable,
> add a generic machine.partitions variable that can be specified on a
> per-board basis and can be used for all methods.
> 
> Existing variables will still remain for backwards-compatibility, but
> when unset, it should fall back to this new parameter. This is done
> if the follow-up patches.
> 
> +static int machine_partitions_var_init(void)
> +{
> +	struct param_d *param;
> +
> +	machine_partitions = file_list_parse("");
> +	param = dev_add_param_file_list(of_get_machine(), "partitions",
> +					NULL, NULL, &machine_partitions, NULL);

Why machine.partitions and not global.something? What's the very good
reason to open up another namespace for configuration variables?

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