public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [wic][PATCH 7/9] wic: get rid of get_rootfs and set_rootfs
Date: Thu, 14 Jan 2016 14:12:57 +0200	[thread overview]
Message-ID: <0a948d53ca14af9ac009d54f6b4863626a9f2392.1452766193.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1452766193.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1452766193.git.ed.bartosh@linux.intel.com>

Got rid of get_rootfs and set_rootfs java-like getter and
setter. Renamed rootfs to rootfs_dir to be consistent with
the name of kickstart parameter --rootfs-dir.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 scripts/lib/wic/imager/direct.py                     |  6 +++---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 14 +++++++-------
 scripts/lib/wic/plugins/source/rootfs.py             | 14 +++++++-------
 scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py  |  2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 25bab89..09ff5f8 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -233,7 +233,7 @@ class DirectImageCreator(BaseImageCreator):
             # get rootfs size from bitbake variable if it's not set in .ks file
             if not part.size:
                 # and if rootfs name is specified for the partition
-                image_name = part.get_rootfs()
+                image_name = part.rootfs_dir
                 if image_name:
                     # Bitbake variable ROOTFS_SIZE is calculated in
                     # Image._get_rootfs_size method from meta/lib/oe/image.py
@@ -336,13 +336,13 @@ class DirectImageCreator(BaseImageCreator):
 
         msg += 'The following build artifacts were used to create the image(s):\n'
         for part in parts:
-            if part.get_rootfs() is None:
+            if part.rootfs_dir is None:
                 continue
             if part.mountpoint == '/':
                 suffix = ':'
             else:
                 suffix = '["%s"]:' % (part.mountpoint or part.label)
-            msg += '  ROOTFS_DIR%s%s\n' % (suffix.ljust(20), part.get_rootfs())
+            msg += '  ROOTFS_DIR%s%s\n' % (suffix.ljust(20), part.rootfs_dir)
 
         msg += '  BOOTIMG_DIR:                  %s\n' % self.bootimg_dir
         msg += '  KERNEL_DIR:                   %s\n' % self.kernel_dir
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 9ad0bc7..b5ca4d3 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -262,26 +262,26 @@ class IsoImagePlugin(SourcePlugin):
 
         isodir = "%s/ISO" % cr_workdir
 
-        if part.rootfs is None:
+        if part.rootfs_dir is None:
             if not 'ROOTFS_DIR' in rootfs_dir:
                 msger.error("Couldn't find --rootfs-dir, exiting.\n")
             rootfs_dir = rootfs_dir['ROOTFS_DIR']
         else:
-            if part.rootfs in rootfs_dir:
-                rootfs_dir = rootfs_dir[part.rootfs]
-            elif part.rootfs:
-                rootfs_dir = part.rootfs
+            if part.rootfs_dir in rootfs_dir:
+                rootfs_dir = rootfs_dir[part.rootfs_dir]
+            elif part.rootfs_dir:
+                rootfs_dir = part.rootfs_dir
             else:
                 msg = "Couldn't find --rootfs-dir=%s connection "
                 msg += "or it is not a valid path, exiting.\n"
-                msger.error(msg % part.rootfs)
+                msger.error(msg % part.rootfs_dir)
 
         if not os.path.isdir(rootfs_dir):
             rootfs_dir = get_bitbake_var("IMAGE_ROOTFS")
         if not os.path.isdir(rootfs_dir):
             msger.error("Couldn't find IMAGE_ROOTFS, exiting.\n")
 
-        part.set_rootfs(rootfs_dir)
+        part.rootfs_dir = rootfs_dir
 
         # Prepare rootfs.img
         hdd_dir = get_bitbake_var("HDDDIR")
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index a90712b..425da8b 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -61,23 +61,23 @@ class RootfsPlugin(SourcePlugin):
         'prepares' the partition to be incorporated into the image.
         In this case, prepare content for legacy bios boot partition.
         """
-        if part.rootfs is None:
+        if part.rootfs_dir is None:
             if not 'ROOTFS_DIR' in krootfs_dir:
                 msg = "Couldn't find --rootfs-dir, exiting"
                 msger.error(msg)
             rootfs_dir = krootfs_dir['ROOTFS_DIR']
         else:
-            if part.rootfs in krootfs_dir:
-                rootfs_dir = krootfs_dir[part.rootfs]
-            elif part.rootfs:
-                rootfs_dir = part.rootfs
+            if part.rootfs_dir in krootfs_dir:
+                rootfs_dir = krootfs_dir[part.rootfs_dir]
+            elif part.rootfs_dir:
+                rootfs_dir = part.rootfs_dir
             else:
                 msg = "Couldn't find --rootfs-dir=%s connection"
                 msg += " or it is not a valid path, exiting"
-                msger.error(msg % part.rootfs)
+                msger.error(msg % part.rootfs_dir)
 
         real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
 
-        part.set_rootfs(real_rootfs_dir)
+        part.rootfs_dir = real_rootfs_dir
         part.prepare_rootfs(cr_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
 
diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
index bdf1b54..48b4817 100644
--- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
+++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
@@ -141,7 +141,7 @@ class RootfsPlugin(SourcePlugin):
 
         real_rootfs_dir = cls._get_rootfs_dir(rootfs_dir)
 
-        part.set_rootfs(real_rootfs_dir)
+        part.rootfs_dir = real_rootfs_dir
         part.prepare_rootfs(image_creator_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
 
         # install syslinux into rootfs partition
-- 
2.1.4



  parent reply	other threads:[~2016-01-14 14:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 12:12 [wic][PATCH 0/9] Reimplement kickstart parser Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 1/9] wic: add partition module Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 2/9] wic: add kickstart parser module Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 3/9] wic: use new kickstart parser Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 4/9] wic: remove pykickstart code Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 5/9] wic: adjust code for new data structure Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 6/9] wic: get rid of get_timeout getter Ed Bartosh
2016-01-14 12:12 ` Ed Bartosh [this message]
2016-01-14 12:12 ` [wic][PATCH 8/9] wic: get rid of set_size and set_source_file setters Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 9/9] wic: get rid of 2 getters Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a948d53ca14af9ac009d54f6b4863626a9f2392.1452766193.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox