Re: [PATCH v2 16/17] android: boot: support bootconfig

Mattijs Korpershoek
2023-02-01T08:45:38Z

On Thu, Jan 26, 2023 at 17:55, Simon Glass <sjg@chromium.org> wrote:

> Hi Safae,
>
> On Thu, 26 Jan 2023 at 09:05, Safae Ouajih <souajih@baylibre.com> wrote:
>>
>> This adds support for Bootconfig feature.
>> - The bootconfig feature replaces the androidboot.*
>> kernel cmdline options.
>>
>> This was adapted from downstream [1] commit : 7af0a0506d4d ("cuttlefish:
>> support bootconfig parameters").
>>
>> Link:[1] https://android.googlesource.com/platform/external/u-boot/
>>
>> Signed-off-by: Safae Ouajih <souajih@baylibre.com>
>> ---
>> boot/image-android.c | 58 +++++++++++++++++++++++++++++++++++++++--
>> include/android_image.h | 11 ++++++++
>> 2 files changed, 67 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

>
> nit below
>
> [..]
>
>> diff --git a/include/android_image.h b/include/android_image.h
>> index 351e17750e..6e1afae4c0 100644
>> --- a/include/android_image.h
>> +++ b/include/android_image.h
>> @@ -25,6 +25,14 @@
>> #define ANDR_VENDOR_BOOT_ARGS_SIZE 2048
>> #define ANDR_VENDOR_BOOT_NAME_SIZE 16
>>
>> +#define BOOTCONFIG_MAGIC "#BOOTCONFIG\n"
>> +#define BOOTCONFIG_MAGIC_SIZE 12
>> +#define BOOTCONFIG_SIZE_SIZE 4
>> +#define BOOTCONFIG_CHECKSUM_SIZE 4
>> +#define BOOTCONFIG_TRAILER_SIZE BOOTCONFIG_MAGIC_SIZE + \
>> + BOOTCONFIG_SIZE_SIZE + \
>> + BOOTCONFIG_CHECKSUM_SIZE
>> +
>> struct andr_boot_img_hdr_v3 {
>> u8 magic[ANDR_BOOT_MAGIC_SIZE];
>>
>> @@ -333,6 +341,9 @@ struct andr_image_data {
>> ulong recovery_dtbo_ptr;
>> u32 recovery_dtbo_size;
>>
>> + ulong bootconfig_addr;
>> + ulong bootconfig_size;
>> +
>> const char *kcmdline;
>> const char *kcmdline_extra;
>> const char *image_name;
>> --
>> 2.34.1
>>
>
> That struct needs a full comment
>
> REgards,
> Simon