Skip to contentSkip to conversation

kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLE

PATCH Superseded Nathan Rossi 1 participant 7 messages Oct 21, 2016 – Jan 12, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLE

Check the value of UBOOT_SIGN_ENABLE, as it is defaulted to "0" which for matches as True in python due to being a non-empty string.

---
 meta/classes/kernel-fitimage.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-fitimage.bbclass +1 -1
index 8580247f82..3bbf91f65a 100644
@@ -26,7 +26,7 @@ python __anonymous () {
         # Verified boot will sign the fitImage and append the public key to
         # U-boot dtb. We ensure the U-Boot dtb is deployed before assembling
         # the fitImage:
-        if d.getVar('UBOOT_SIGN_ENABLE', True):
+        if d.getVar('UBOOT_SIGN_ENABLE', True) == "1":
             uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot'
             d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
 }
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks

Allow the load and entry addresses to remain unset if the UBOOT_RD_* variables are also unset for ramdisk entries in the image tree. This allows for U-Boot to decide dynamically where to load the ramdisk.

---
 meta/classes/kernel-fitimage.bbclass | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/classes/kernel-fitimage.bbclass +11 -2
index 3bbf91f65a..5c9e76b9ac 100644
@@ -178,6 +178,15 @@ EOF
 fitimage_emit_section_ramdisk() {
 
 	ramdisk_csum="sha1"
+	ramdisk_loadline=""
+	ramdisk_entryline=""
+
+	if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
+		ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
+	fi
+	if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
+		ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
+	fi
 
 	cat << EOF >> ${1}
                 ramdisk@${2} {
@@ -187,8 +196,8 @@ fitimage_emit_section_ramdisk() {
                         arch = "${UBOOT_ARCH}";
                         os = "linux";
                         compression = "none";
-                        load = <${UBOOT_RD_LOADADDRESS}>;
-                        entry = <${UBOOT_RD_ENTRYPOINT}>;
+                        ${ramdisk_loadline}
+                        ${ramdisk_entryline}
                         hash@1 {
                                 algo = "${ramdisk_csum}";
                         };
Signature · 1 line
2.9.3
#4 lore raw

PATCH 1/1 kernel-fitimage.bbclass: Don't assume KERNEL_IMAGETYPE == fitImage

In reply to Nathan Rossi

The name of the output image for a fitImage that contains a ramdisk should match the same as for the fitImage that does not contain a ramdisk. As such it should not be assumed that KERNEL_IMAGETYPE is "fitImage". This change explicitly sets the name of the output ramdisk/initramfs to start with fitImage as does the non-ramdisk output.

---
 meta/classes/kernel-fitimage.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/kernel-fitimage.bbclass +4 -4
index 5c9e76b9ac..55529b161f 100644
@@ -419,11 +419,11 @@ kernel_do_deploy_append() {
 
 		if [ -n "${INITRAMFS_IMAGE}" ]; then
 			echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
-			its_initramfs_base_name="${KERNEL_IMAGETYPE}-its-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-			its_initramfs_symlink_name=${KERNEL_IMAGETYPE}-its-${INITRAMFS_IMAGE}-${MACHINE}
+			its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
+			its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE}-${MACHINE}
 			install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
-			fit_initramfs_base_name="${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-			fit_initramfs_symlink_name=${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}
+			fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
+			fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE}-${MACHINE}
 			install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
 		fi
 
Signature · 1 line
2.9.3
#5 lore raw

Re: [PATCH] kernel-fitimage.bbclass: Don't assume KERNEL_IMAGETYPE == fitImage

Just pinging these patches, to see if there were any issues or comments. I realize I sent them just before a release so it was very likely they would get lost in the noise.

Thanks,
Nathan

Quoted 33 lines · Nathan Rossi

The name of the output image for a fitImage that contains a ramdisk should match the same as for the fitImage that does not contain a ramdisk. As such it should not be assumed that KERNEL_IMAGETYPE is "fitImage". This change explicitly sets the name of the output ramdisk/initramfs to start with fitImage as does the non-ramdisk output.

---
 meta/classes/kernel-fitimage.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/kernel-fitimage.bbclass +4 -5
index 5c9e76b9ac..55529b161f 100644
@@ -419,11 +419,11 @@ kernel_do_deploy_append() {
 
                if [ -n "${INITRAMFS_IMAGE}" ]; then
                        echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
-                       its_initramfs_base_name="${KERNEL_IMAGETYPE}-its-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-                       its_initramfs_symlink_name=${KERNEL_IMAGETYPE}-its-${INITRAMFS_IMAGE}-${MACHINE}
+                       its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
+                       its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE}-${MACHINE}
                        install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
-                       fit_initramfs_base_name="${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
-                       fit_initramfs_symlink_name=${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}
+                       fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
+                       fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE}-${MACHINE}
                        install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
                fi
 
--

2.9.3

#2 lore raw

Re: [PATCH] kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks

In reply to Nathan Rossi

Just pinging these patches, to see if there were any issues or comments. I realize I sent them just before a release so it was very likely they would get lost in the noise.

Thanks,
Nathan

Quoted 42 lines · Nathan Rossi

Allow the load and entry addresses to remain unset if the UBOOT_RD_* variables are also unset for ramdisk entries in the image tree. This allows for U-Boot to decide dynamically where to load the ramdisk.

---
 meta/classes/kernel-fitimage.bbclass | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/classes/kernel-fitimage.bbclass +11 -3
index 3bbf91f65a..5c9e76b9ac 100644
@@ -178,6 +178,15 @@ EOF
 fitimage_emit_section_ramdisk() {
 
        ramdisk_csum="sha1"
+       ramdisk_loadline=""
+       ramdisk_entryline=""
+
+       if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
+               ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
+       fi
+       if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
+               ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
+       fi
 
        cat << EOF >> ${1}
                 ramdisk@${2} {
@@ -187,8 +196,8 @@ fitimage_emit_section_ramdisk() {
                         arch = "${UBOOT_ARCH}";
                         os = "linux";
                         compression = "none";
-                        load = <${UBOOT_RD_LOADADDRESS}>;
-                        entry = <${UBOOT_RD_ENTRYPOINT}>;
+                        ${ramdisk_loadline}
+                        ${ramdisk_entryline}
                         hash@1 {
                                 algo = "${ramdisk_csum}";
                         };
--

2.9.3

#6 lore raw
In reply to Nathan Rossi

Just pinging these patches, to see if there were any issues or comments. I realize I sent them just before a release so it was very likely they would get lost in the noise.

Thanks,
Nathan

Quoted 23 lines · Nathan Rossi

Check the value of UBOOT_SIGN_ENABLE, as it is defaulted to "0" which for matches as True in python due to being a non-empty string.

---
 meta/classes/kernel-fitimage.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel-fitimage.bbclass +1 -2
index 8580247f82..3bbf91f65a 100644
@@ -26,7 +26,7 @@ python __anonymous () {
         # Verified boot will sign the fitImage and append the public key to
         # U-boot dtb. We ensure the U-Boot dtb is deployed before assembling
         # the fitImage:
-        if d.getVar('UBOOT_SIGN_ENABLE', True):
+        if d.getVar('UBOOT_SIGN_ENABLE', True) == "1":
             uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot', True) or 'u-boot'
             d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
 }
--

2.9.3

#3 lore raw

Re: [PATCH] kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks

In reply to Nathan Rossi
Quoted 3 lines · Nathan Rossi

Just pinging these patches, to see if there were any issues or comments. I realize I sent them just before a release so it was very likely they would get lost in the noise.

Pinging these three patches again.

https://patchwork.openembedded.org/patch/133134/
https://patchwork.openembedded.org/patch/133135/ (another patch was just sent by someone else which does the same change,
https://lists.yoctoproject.org/pipermail/yocto/2017-January/033840.html)

And I've updated the third one, sent a v2 so that it applies cleanly to master.

https://patchwork.openembedded.org/patch/135805/

Thanks,
Nathan

Quoted 47 lines

Thanks,
Nathan

Quoted 42 lines · Nathan Rossi

Allow the load and entry addresses to remain unset if the UBOOT_RD_* variables are also unset for ramdisk entries in the image tree. This allows for U-Boot to decide dynamically where to load the ramdisk.

---
 meta/classes/kernel-fitimage.bbclass | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/classes/kernel-fitimage.bbclass +11 -3
index 3bbf91f65a..5c9e76b9ac 100644
@@ -178,6 +178,15 @@ EOF
 fitimage_emit_section_ramdisk() {
 
        ramdisk_csum="sha1"
+       ramdisk_loadline=""
+       ramdisk_entryline=""
+
+       if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
+               ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
+       fi
+       if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
+               ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
+       fi
 
        cat << EOF >> ${1}
                 ramdisk@${2} {
@@ -187,8 +196,8 @@ fitimage_emit_section_ramdisk() {
                         arch = "${UBOOT_ARCH}";
                         os = "linux";
                         compression = "none";
-                        load = <${UBOOT_RD_LOADADDRESS}>;
-                        entry = <${UBOOT_RD_ENTRYPOINT}>;
+                        ${ramdisk_loadline}
+                        ${ramdisk_entryline}
                         hash@1 {
                                 algo = "${ramdisk_csum}";
                         };
--

2.9.3