Explorar el Código

styhead migration fixes

Based on the guidance from [1], resolve build errors on styhead.

This resolves 2 issues with styhead as found with the integration at [2]
and testing of branch at [3], as referenced at [4], [5], [6], and [7]:

```
WARNING: swupdate-image-tegra-1.0-r0 do_unpack: swupdate-image-tegra: the directory ${WORKDIR}/${PN} (/home/dan/trellis/oe4t/tegra-demo-distro/build-master/tmp/work/jetson_orin_nano_devkit_nvme-oe4t-linux/swupdate-image-tegra/1.0/swupdate-image-tegra) pointed to by the S variable doesn't exist - please set S within the recipe to point to where the source has been unpacked to
```
This warning is printed due to the setting of S based on WORKDIR
in swupdate.bbclass and the fact that the S directory is no longer
automatically created as discussed in [1].  To resolve, use the guidance
in [1] to set S and UNPACKDIR for recipes which only use file:// sources.

In addition, as suggested in [7], move to swupdate-common to share between
swupdate-image and swupdate.

```
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/dan/trellis/oe4t/tegra-demo-distro/build-master/tmp/work/jetson_orin_nano_devkit_nvme-oe4t-linux/swupdate-image-tegra/1.0/swupdate-image-tegra/sw-description'
```

This error occurs due to a missing S directory which is no longer created
automatically after styhead

When using the guidance in [1] to set UNPACKDIR there is no
longer a need to copy from WORKDIR to UNPACKDIR since S is UNPACKDIR, so both
the workdir reference and shutil copy can be removed.

1: https://docs.yoctoproject.org/next/migration-guides/migration-5.1.html
2: https://github.com/OE4T/tegra-demo-distro/blob/master/layers/meta-tegrademo/dynamic-layers/meta-swupdate/README.md
3: https://github.com/Trellis-Logic/tegra-demo-distro/tree/master%2Bswupdate-kas
4: https://groups.google.com/g/swupdate/c/E2h_qgHvJuk
5: https://groups.google.com/g/swupdate/c/x4jxRPbtXa0/m/QQkYqgILAQAJ
6: https://groups.google.com/g/swupdate/c/x4jxRPbtXa0
7: https://groups.google.com/g/swupdate/c/8K-9H7C9o5E

Signed-off-by: Dan Walkes <danwalkes@trellis-logic.com>
Dan Walkes hace 1 año
padre
commit
7bdbcbec86

+ 3 - 2
classes-recipe/swupdate-common.bbclass

@@ -4,6 +4,9 @@
 
 inherit swupdate-lib
 
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"
+
 DEPENDS += "\
     cpio-native \
     ${@ 'openssl-native' if d.getVar('SWUPDATE_SIGNING') or d.getVar('SWUPDATE_ENCRYPT_SWDESC') or d.getVarFlags('SWUPDATE_IMAGES_ENCRYPTED') else ''} \
@@ -322,10 +325,8 @@ python do_swuimage () {
     import shutil
 
     list_for_cpio = ["sw-description"]
-    unpackdir = d.getVar('UNPACKDIR')
     s = d.getVar('S')
     imgdeploydir = d.getVar('SWUDEPLOYDIR')
-    shutil.copyfile(os.path.join(unpackdir, "sw-description"), os.path.join(s, "sw-description"))
 
     if d.getVar('SWUPDATE_SIGNING'):
         list_for_cpio.append('sw-description.sig')

+ 0 - 2
classes-recipe/swupdate-image.bbclass

@@ -13,8 +13,6 @@
 inherit swupdate-common
 inherit image-artifact-names
 
-S = "${WORKDIR}/${PN}"
-
 SRC_URI += "file://sw-description"
 SWUPDATE_IMAGES += "${IMAGE_LINK_NAME}"
 

+ 0 - 2
classes-recipe/swupdate.bbclass

@@ -36,8 +36,6 @@
 inherit swupdate-common
 inherit image-artifact-names
 
-S = "${WORKDIR}/${PN}"
-
 IMAGE_DEPENDS ?= ""
 
 do_configure[noexec] = "1"