diff mbox series

[isar-cip-core,RFC,v3,5/5] images/swupdate.inc: Add variables to generate the sw-description

Message ID 20231229123111.400555-6-Quirin.Gylstorff@siemens.com (mailing list archive)
State Changes Requested
Headers show
Series Add Bootloader to sw-description | expand

Commit Message

Gylstorff Quirin Dec. 29, 2023, 12:30 p.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This done for all distributions except Debian buster.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 recipes-core/images/swupdate.inc | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Comments

Jan Kiszka Jan. 2, 2024, 12:40 p.m. UTC | #1
On 29.12.23 13:30, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> This done for all distributions except Debian buster.

Why not buster?

> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  recipes-core/images/swupdate.inc | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
> index 4983f7c..388faad 100644
> --- a/recipes-core/images/swupdate.inc
> +++ b/recipes-core/images/swupdate.inc
> @@ -11,6 +11,33 @@
>  
>  inherit image_uuid
>  inherit read-only-rootfs
> +inherit ${@'' if d.getVar('BASE_DISTRO_CODENAME') == 'buster' else 'sw-description-generator'}
> +
> +SWU_IMAGES += "rootfs"
> +SWU_IMAGE_rootfs[filename] = "${SWU_ROOTFS_PARTITION_NAME}"
> +SWU_IMAGE_rootfs[device] = "C:BOOT0:linux.efi->${ABROOTFS_PART_UUID_A},C:BOOT1:linux.efi->${ABROOTFS_PART_UUID_B}"
> +SWU_IMAGE_rootfs[type] = "roundrobin"
> +SWU_IMAGE_rootfs[compressed] = "zlib"
> +SWU_IMAGE_rootfs[properties] += "subtype:image"
> +SWU_IMAGE_rootfs[properties] += "configfilecheck:/etc/os-release@not_match@IMAGE_UUID=${TARGET_IMAGE_UUID}"
> +
> +SWU_FILES += "kernel"
> +SWU_FILE_kernel[filename] = "linux.efi"
> +SWU_FILE_kernel[path] = "linux.efi"
> +SWU_FILE_kernel[type] = "roundrobin"
> +SWU_FILE_kernel[device] = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1"
> +SWU_FILE_kernel[filesystem] = "vfat"
> +SWU_FILE_kernel[properties] = "subtype:kernel"
> +
> +EFI_BOOTLOADER_NAME = "${@efi_bootloader_name(d)}"
> +SWU_ADDITIONAL_FILES += "${@d.getVar('EFI_BOOTLOADER_NAME') if bb.utils.to_boolean(d.getVar('SWU_EBG_UPDATE')) else ''}"
> +
> +SWU_FILES += "${@'ebg' if bb.utils.to_boolean(d.getVar('SWU_EBG_UPDATE')) else ''}"
> +SWU_FILE_ebg[filename] = "${EFI_BOOTLOADER_NAME}"
> +SWU_FILE_ebg[path] = "EFI/BOOT/${EFI_BOOTLOADER_NAME}"
> +SWU_FILE_ebg[device] = "${SWU_EFI_BOOT_DEVICE}"
> +SWU_FILE_ebg[filesystem] = "vfat"
> +SWU_FILE_kernel[properties] = "atomic-install:true"
>  
>  SWU_SIGNED ?= "1"
>  

Not yet clear to me what we gain by this approach.

Jan
Gylstorff Quirin Jan. 2, 2024, 1:28 p.m. UTC | #2
On 1/2/24 13:40, Jan Kiszka wrote:
> On 29.12.23 13:30, Quirin Gylstorff wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> This done for all distributions except Debian buster.
> 
> Why not buster?

For buster we need to build python3-libconf as it is only available for 
bullseye and later.

Will add something to the commit message of v4.

> 
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>>   recipes-core/images/swupdate.inc | 27 +++++++++++++++++++++++++++
>>   1 file changed, 27 insertions(+)
>>
>> diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
>> index 4983f7c..388faad 100644
>> --- a/recipes-core/images/swupdate.inc
>> +++ b/recipes-core/images/swupdate.inc
>> @@ -11,6 +11,33 @@
>>   
>>   inherit image_uuid
>>   inherit read-only-rootfs
>> +inherit ${@'' if d.getVar('BASE_DISTRO_CODENAME') == 'buster' else 'sw-description-generator'}
>> +
>> +SWU_IMAGES += "rootfs"
>> +SWU_IMAGE_rootfs[filename] = "${SWU_ROOTFS_PARTITION_NAME}"
>> +SWU_IMAGE_rootfs[device] = "C:BOOT0:linux.efi->${ABROOTFS_PART_UUID_A},C:BOOT1:linux.efi->${ABROOTFS_PART_UUID_B}"
>> +SWU_IMAGE_rootfs[type] = "roundrobin"
>> +SWU_IMAGE_rootfs[compressed] = "zlib"
>> +SWU_IMAGE_rootfs[properties] += "subtype:image"
>> +SWU_IMAGE_rootfs[properties] += "configfilecheck:/etc/os-release@not_match@IMAGE_UUID=${TARGET_IMAGE_UUID}"
>> +
>> +SWU_FILES += "kernel"
>> +SWU_FILE_kernel[filename] = "linux.efi"
>> +SWU_FILE_kernel[path] = "linux.efi"
>> +SWU_FILE_kernel[type] = "roundrobin"
>> +SWU_FILE_kernel[device] = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1"
>> +SWU_FILE_kernel[filesystem] = "vfat"
>> +SWU_FILE_kernel[properties] = "subtype:kernel"
>> +
>> +EFI_BOOTLOADER_NAME = "${@efi_bootloader_name(d)}"
>> +SWU_ADDITIONAL_FILES += "${@d.getVar('EFI_BOOTLOADER_NAME') if bb.utils.to_boolean(d.getVar('SWU_EBG_UPDATE')) else ''}"
>> +
>> +SWU_FILES += "${@'ebg' if bb.utils.to_boolean(d.getVar('SWU_EBG_UPDATE')) else ''}"
>> +SWU_FILE_ebg[filename] = "${EFI_BOOTLOADER_NAME}"
>> +SWU_FILE_ebg[path] = "EFI/BOOT/${EFI_BOOTLOADER_NAME}"
>> +SWU_FILE_ebg[device] = "${SWU_EFI_BOOT_DEVICE}"
>> +SWU_FILE_ebg[filesystem] = "vfat"
>> +SWU_FILE_kernel[properties] = "atomic-install:true"
>>   
>>   SWU_SIGNED ?= "1"
>>   
> 
> Not yet clear to me what we gain by this approach.

The benefits are:
- we can add easily additional files/images/scripts in downstream projects.
- Also this allows for example to build an update containing only the 
bootloader without addining a seperate template file.
- it simplifies the adding of new 'flags'
- I think it should be is easier to use for downstream as the correct 
syntax of the sw-description is generate.
> 
> Jan
> 
Quirin
diff mbox series

Patch

diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
index 4983f7c..388faad 100644
--- a/recipes-core/images/swupdate.inc
+++ b/recipes-core/images/swupdate.inc
@@ -11,6 +11,33 @@ 
 
 inherit image_uuid
 inherit read-only-rootfs
+inherit ${@'' if d.getVar('BASE_DISTRO_CODENAME') == 'buster' else 'sw-description-generator'}
+
+SWU_IMAGES += "rootfs"
+SWU_IMAGE_rootfs[filename] = "${SWU_ROOTFS_PARTITION_NAME}"
+SWU_IMAGE_rootfs[device] = "C:BOOT0:linux.efi->${ABROOTFS_PART_UUID_A},C:BOOT1:linux.efi->${ABROOTFS_PART_UUID_B}"
+SWU_IMAGE_rootfs[type] = "roundrobin"
+SWU_IMAGE_rootfs[compressed] = "zlib"
+SWU_IMAGE_rootfs[properties] += "subtype:image"
+SWU_IMAGE_rootfs[properties] += "configfilecheck:/etc/os-release@not_match@IMAGE_UUID=${TARGET_IMAGE_UUID}"
+
+SWU_FILES += "kernel"
+SWU_FILE_kernel[filename] = "linux.efi"
+SWU_FILE_kernel[path] = "linux.efi"
+SWU_FILE_kernel[type] = "roundrobin"
+SWU_FILE_kernel[device] = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1"
+SWU_FILE_kernel[filesystem] = "vfat"
+SWU_FILE_kernel[properties] = "subtype:kernel"
+
+EFI_BOOTLOADER_NAME = "${@efi_bootloader_name(d)}"
+SWU_ADDITIONAL_FILES += "${@d.getVar('EFI_BOOTLOADER_NAME') if bb.utils.to_boolean(d.getVar('SWU_EBG_UPDATE')) else ''}"
+
+SWU_FILES += "${@'ebg' if bb.utils.to_boolean(d.getVar('SWU_EBG_UPDATE')) else ''}"
+SWU_FILE_ebg[filename] = "${EFI_BOOTLOADER_NAME}"
+SWU_FILE_ebg[path] = "EFI/BOOT/${EFI_BOOTLOADER_NAME}"
+SWU_FILE_ebg[device] = "${SWU_EFI_BOOT_DEVICE}"
+SWU_FILE_ebg[filesystem] = "vfat"
+SWU_FILE_kernel[properties] = "atomic-install:true"
 
 SWU_SIGNED ?= "1"