android: boot: support extra command line
commit b36b227b6a37695ab39306341c3a977cf9b081b6 upstream. In version 3 and 4 of boot image header, the vendor specific command line are located in vendor boot image. Thus, use extra command line to add those cmd to bootargs. Signed-off-by: Safae Ouajih <souajih@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
This commit is contained in:
		
							parent
							
								
									50fada27e2
								
							
						
					
					
						commit
						01f7be0dbb
					
				|  | @ -55,6 +55,7 @@ static void android_vendor_boot_image_v3_v4_parse_hdr(const struct andr_vnd_boot | ||||||
| 	 * The header takes a full page, the remaining components are aligned | 	 * The header takes a full page, the remaining components are aligned | ||||||
| 	 * on page boundary. | 	 * on page boundary. | ||||||
| 	 */ | 	 */ | ||||||
|  | 	data->kcmdline_extra = hdr->cmdline; | ||||||
| 	data->tags_addr = hdr->tags_addr; | 	data->tags_addr = hdr->tags_addr; | ||||||
| 	data->image_name = hdr->name; | 	data->image_name = hdr->name; | ||||||
| 	data->kernel_addr = hdr->kernel_addr; | 	data->kernel_addr = hdr->kernel_addr; | ||||||
|  | @ -233,6 +234,11 @@ int android_image_get_kernel(const struct andr_boot_img_hdr_v0 *hdr, | ||||||
| 		len += strlen(img_data.kcmdline); | 		len += strlen(img_data.kcmdline); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	if (img_data.kcmdline_extra) { | ||||||
|  | 		printf("Kernel extra command line: %s\n", img_data.kcmdline_extra); | ||||||
|  | 		len += strlen(img_data.kcmdline_extra); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	char *bootargs = env_get("bootargs"); | 	char *bootargs = env_get("bootargs"); | ||||||
| 	if (bootargs) | 	if (bootargs) | ||||||
| 		len += strlen(bootargs); | 		len += strlen(bootargs); | ||||||
|  | @ -252,6 +258,11 @@ int android_image_get_kernel(const struct andr_boot_img_hdr_v0 *hdr, | ||||||
| 	if (*img_data.kcmdline) | 	if (*img_data.kcmdline) | ||||||
| 		strcat(newbootargs, img_data.kcmdline); | 		strcat(newbootargs, img_data.kcmdline); | ||||||
| 
 | 
 | ||||||
|  | 	if (img_data.kcmdline_extra) { | ||||||
|  | 		strcat(newbootargs, " "); | ||||||
|  | 		strcat(newbootargs, img_data.kcmdline_extra); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	env_set("bootargs", newbootargs); | 	env_set("bootargs", newbootargs); | ||||||
| 
 | 
 | ||||||
| 	if (os_data) { | 	if (os_data) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue