summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-02-10 12:57:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-15 20:06:34 -0800
commit361b890da1c7b24de0a62516545e4c164830081d (patch)
treed1e61fac1c4afa6890ec090ab3d73681f000b97c /scripts
parent20c70dd617d4abfff507e210610a58a9989f7c9b (diff)
downloadopenembedded-core-361b890da1c7b24de0a62516545e4c164830081d.tar.gz
openembedded-core-361b890da1c7b24de0a62516545e4c164830081d.tar.bz2
openembedded-core-361b890da1c7b24de0a62516545e4c164830081d.zip
wic: direct: set bootloader.source in the __init__
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 18cd2773d1..64a3368526 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -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: