From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [wic][PATCH 5/9] wic: adjust code for new data structure
Date: Thu, 14 Jan 2016 14:12:55 +0200 [thread overview]
Message-ID: <e6b1fa3be9f3ee113ff5637f06cc3d4ea4133ee1.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>
New data structure is less nested than old one.
Adjusted bootloader and partitions fields:
self.ks.handler.bootloader -> self.ks.bootoader
self.ks.handler.partitions -> self.ks.partitions
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
scripts/lib/wic/imager/baseimager.py | 2 +-
scripts/lib/wic/imager/direct.py | 16 ++++++++--------
scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +-
scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | 4 ++--
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/scripts/lib/wic/imager/baseimager.py b/scripts/lib/wic/imager/baseimager.py
index acbe948..760cf8a 100644
--- a/scripts/lib/wic/imager/baseimager.py
+++ b/scripts/lib/wic/imager/baseimager.py
@@ -85,7 +85,7 @@ class BaseImageCreator(object):
# No ks provided when called by convertor, so skip the dependency check
if self.ks:
# If we have btrfs partition we need to check necessary tools
- for part in self.ks.handler.partition.partitions:
+ for part in self.ks.partitions:
if part.fstype and part.fstype == "btrfs":
self._dep_checks.append("mkfs.btrfs")
break
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index f89c42c..25bab89 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -64,7 +64,7 @@ class DirectImageCreator(BaseImageCreator):
self.__disks = {}
self.__disk_format = "direct"
self._disk_names = []
- self.ptable_format = self.ks.handler.bootloader.ptable
+ self.ptable_format = self.ks.bootloader.ptable
self.oe_builddir = oe_builddir
if image_output_dir:
@@ -151,12 +151,12 @@ class DirectImageCreator(BaseImageCreator):
"please check your kickstart setting.")
# Set a default partition if no partition is given out
- if not self.ks.handler.partition.partitions:
+ if not self.ks.partitions:
partstr = "part / --size 1900 --ondisk sda --fstype=ext3"
args = partstr.split()
- part = self.ks.handler.partition.parse(args[1:])
- if part not in self.ks.handler.partition.partitions:
- self.ks.handler.partition.partitions.append(part)
+ part = self.ks.parse(args[1:])
+ if part not in self.ks.partitions:
+ self.ks.partitions.append(part)
# partitions list from kickstart file
return kickstart.get_partitions(self.ks)
@@ -206,7 +206,7 @@ class DirectImageCreator(BaseImageCreator):
bootloader object, the default can be explicitly set using the
--source bootloader param.
"""
- return self.ks.handler.bootloader.source
+ return self.ks.bootloader.source
#
# Actual implemention
@@ -224,8 +224,8 @@ class DirectImageCreator(BaseImageCreator):
for part in 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.handler.bootloader.source and part.mountpoint == "/boot":
- self.ks.handler.bootloader.source = part.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"))
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 5feb79d..556586f 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -61,7 +61,7 @@ class BootimgEFIPlugin(SourcePlugin):
if not custom_cfg:
# Create grub configuration using parameters from wks file
- options = creator.ks.handler.bootloader.appendLine
+ bootloader = creator.ks.bootloader
grubefi_conf = ""
grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n"
diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
index 76e7b03..4280ff7 100644
--- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
+++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py
@@ -78,7 +78,7 @@ class RootfsPlugin(SourcePlugin):
Called before do_prepare_partition()
"""
- options = image_creator.ks.handler.bootloader.appendLine
+ bootloader = image_creator.ks.bootloader
syslinux_conf = ""
syslinux_conf += "PROMPT 0\n"
@@ -97,7 +97,7 @@ class RootfsPlugin(SourcePlugin):
syslinux_conf += " KERNEL /boot/bzImage\n"
syslinux_conf += " APPEND label=boot root=%s %s\n" % \
- (image_creator.rootdev, options)
+ (image_creator.rootdev, bootloader.append)
syslinux_cfg = os.path.join(image_creator.rootfs_dir['ROOTFS_DIR'], "boot", "syslinux.cfg")
msger.debug("Writing syslinux config %s" % syslinux_cfg)
--
2.1.4
next prev parent reply other threads:[~2016-01-14 14:14 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 ` Ed Bartosh [this message]
2016-01-14 12:12 ` [wic][PATCH 6/9] wic: get rid of get_timeout getter Ed Bartosh
2016-01-14 12:12 ` [wic][PATCH 7/9] wic: get rid of get_rootfs and set_rootfs Ed Bartosh
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=e6b1fa3be9f3ee113ff5637f06cc3d4ea4133ee1.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