]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
wic: direct: set bootloader.source in the __init__
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 10 Feb 2017 10:57:13 +0000 (12:57 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Feb 2017 04:06:34 +0000 (20:06 -0800)
Moved setting of bootloader source from do_create method
to __init__ as it doesn't have anything to do with image
creation.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
scripts/lib/wic/plugins/imager/direct.py

index 18cd2773d1c22b5f74ed00885433beb2d3760f2f..64a33685262a8e894aca85706e786d76dccc6f45 100644 (file)
@@ -87,6 +87,13 @@ class DirectPlugin(ImagerPlugin):
                     continue
                 part.realnum = realnum
 
+        # as a convenience, set source to the boot partition source
+        # instead of forcing it to be set via bootloader --source
+        for part in self.parts:
+            if not self.ks.bootloader.source and part.mountpoint == "/boot":
+                self.ks.bootloader.source = part.source
+                break
+
     def do_create(self):
         """
         Plugin entry point.
@@ -160,12 +167,6 @@ class DirectPlugin(ImagerPlugin):
         self._image = PartitionedImage(image_path, self.ptable_format,
                                        self.parts, self.native_sysroot)
 
-        for part in self.parts:
-            # as a convenience, set source to the boot partition source
-            # instead of forcing it to be set via bootloader --source
-            if not self.ks.bootloader.source and part.mountpoint == "/boot":
-                self.ks.bootloader.source = part.source
-
         fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
 
         for part in self.parts: