mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	add default-option to bootmenu
with this patch the selected Entry in bootmenu can be set by environment-var bootmenu_default=<number> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
This commit is contained in:
		
				
					committed by
					
						 Tom Rini
						Tom Rini
					
				
			
			
				
	
			
			
			
						parent
						
							430c166bce
						
					
				
				
					commit
					f7bb20a53e
				
			| @@ -253,6 +253,7 @@ static struct bootmenu_data *bootmenu_create(int delay) | |||||||
|  |  | ||||||
| 	int len; | 	int len; | ||||||
| 	char *sep; | 	char *sep; | ||||||
|  | 	char *default_str; | ||||||
| 	struct bootmenu_entry *entry; | 	struct bootmenu_entry *entry; | ||||||
|  |  | ||||||
| 	menu = malloc(sizeof(struct bootmenu_data)); | 	menu = malloc(sizeof(struct bootmenu_data)); | ||||||
| @@ -263,6 +264,10 @@ static struct bootmenu_data *bootmenu_create(int delay) | |||||||
| 	menu->active = 0; | 	menu->active = 0; | ||||||
| 	menu->first = NULL; | 	menu->first = NULL; | ||||||
|  |  | ||||||
|  | 	default_str = env_get("bootmenu_default"); | ||||||
|  | 	if (default_str) | ||||||
|  | 		menu->active = (int)simple_strtol(default_str, NULL, 10); | ||||||
|  |  | ||||||
| 	while ((option = bootmenu_getoption(i))) { | 	while ((option = bootmenu_getoption(i))) { | ||||||
| 		sep = strchr(option, '='); | 		sep = strchr(option, '='); | ||||||
| 		if (!sep) { | 		if (!sep) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user