[PATCH 6/7] petitboot: Implement ordered boot options

Samuel Mendoza-Jonas sam.mj at au1.ibm.com
Thu Apr 2 14:21:19 AEDT 2015


> @@ -109,17 +106,16 @@ void config_set_defaults(struct config *config)
>  	config->network.n_interfaces = 0;
>  	config->network.dns_servers = NULL;
>  	config->network.n_dns_servers = 0;
> -	config->boot_device = NULL;
>  	config->safe_mode = false;
>  	config->lang = NULL;
>  
> -	config->n_boot_priorities = 2;
> -	config->boot_priorities = talloc_array(config, struct boot_priority,
> -						config->n_boot_priorities);
> -	config->boot_priorities[0].type = DEVICE_TYPE_NETWORK;
> -	config->boot_priorities[0].priority = 0;
> -	config->boot_priorities[1].type = DEVICE_TYPE_ANY;
> -	config->boot_priorities[1].priority = 1;
> +	config->n_autoboot_opts = 2;
> +	config->autoboot_opts = talloc_array(config, struct autoboot_option,
> +						config->n_autoboot_opts);
> +	config->autoboot_opts[0].boot_type = BOOT_DEVICE_TYPE;
> +	config->autoboot_opts[0].type = DEVICE_TYPE_NETWORK;
> +	config->autoboot_opts[1].boot_type = BOOT_DEVICE_TYPE;
> +	config->autoboot_opts[1].type = DEVICE_TYPE_ANY;

Note to self here - I noticed while testing some other patches on top of this that
if no petitboot,bootdevs sysparam is read, these will remain the defaults. Which is
fine except that even if auto-boot?=false is set, these will show up erroneously
in the configuration screen which looks a bit confusing.

Instead I'll probably make it so that if we don't read any bootdevs and autoboot is
disabled, free this array.


-- 
-----------
LTC Ozlabs
IBM



More information about the Petitboot mailing list