Przeglądaj źródła

swupdate_class: multiple type extensions for images

There is an issue adding kernel image, that share the same name,
for example uImage-<machine>.dtb and uImage-<machine>.bin, and both
are notpicked up into the .swu image. This allows to select
multiple file extensions, and both kernel and dtb file are
added to the compound image.

Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic 9 lat temu
rodzic
commit
3077afa11a
1 zmienionych plików z 10 dodań i 6 usunięć
  1. 10 6
      classes/swupdate.bbclass

+ 10 - 6
classes/swupdate.bbclass

@@ -29,7 +29,7 @@ def swupdate_getdepends(d):
 
     depstr = ""
     for dep in deps:
-        depstr += " " + dep + ":do_rootfs"
+        depstr += " " + dep + ":do_populate_sysroot"
     return depstr
 
 do_swuimage[dirs] = "${TOPDIR}"
@@ -79,11 +79,15 @@ python do_swuimage () {
     deploydir = d.getVar('DEPLOY_DIR_IMAGE', True)
 
     for image in images:
-        imagename = image + '-' + d.getVar('MACHINE', True) + d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", image, True)
-        src = os.path.join(deploydir, "%s" % imagename)
-        dst = os.path.join(s, "%s" % imagename)
-        shutil.copyfile(src, dst)
-        list_for_cpio += " " + imagename
+        imagename = image + '-' + d.getVar('MACHINE', True)
+        fstypes = (d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", image, True) or "").split()
+        for fstype in fstypes:
+            imagebase = image + '-' + d.getVar('MACHINE', True)
+            imagename = imagebase + fstype
+            src = os.path.join(deploydir, "%s" % imagename)
+            dst = os.path.join(s, "%s" % imagename)
+            shutil.copyfile(src, dst)
+            list_for_cpio += " " + imagename
 
     line = 'for i in ' + list_for_cpio + '; do echo $i;done | cpio -ov -H crc >' + os.path.join(deploydir,d.getVar('IMAGE_NAME', True) + '.swu')
     os.system("cd " + s + ";" + line)