summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-01-14 14:12:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-18 11:47:05 +0000
commit26fb2a1a45049fd5731ae83efb962a84afb14568 (patch)
tree13f27e849210b55e1b540c902da63cb325bfb574 /scripts/lib
parentc8272380ceed8dd56237995eecbaca5f4c9645dd (diff)
downloadpoky-26fb2a1a45049fd5731ae83efb962a84afb14568.tar.gz
wic: adjust code for new data structure
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 (From OE-Core rev: b46da0731e3f7016d0ab2a67967f07c7e199f219) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/imager/baseimager.py2
-rw-r--r--scripts/lib/wic/imager/direct.py16
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py2
-rw-r--r--scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py4
4 files changed, 12 insertions, 12 deletions
diff --git a/scripts/lib/wic/imager/baseimager.py b/scripts/lib/wic/imager/baseimager.py
index acbe948584..760cf8a58a 100644
--- a/scripts/lib/wic/imager/baseimager.py
+++ b/scripts/lib/wic/imager/baseimager.py
@@ -85,7 +85,7 @@ class BaseImageCreator(object):
85 # No ks provided when called by convertor, so skip the dependency check 85 # No ks provided when called by convertor, so skip the dependency check
86 if self.ks: 86 if self.ks:
87 # If we have btrfs partition we need to check necessary tools 87 # If we have btrfs partition we need to check necessary tools
88 for part in self.ks.handler.partition.partitions: 88 for part in self.ks.partitions:
89 if part.fstype and part.fstype == "btrfs": 89 if part.fstype and part.fstype == "btrfs":
90 self._dep_checks.append("mkfs.btrfs") 90 self._dep_checks.append("mkfs.btrfs")
91 break 91 break
diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index f89c42cfb7..25bab89169 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -64,7 +64,7 @@ class DirectImageCreator(BaseImageCreator):
64 self.__disks = {} 64 self.__disks = {}
65 self.__disk_format = "direct" 65 self.__disk_format = "direct"
66 self._disk_names = [] 66 self._disk_names = []
67 self.ptable_format = self.ks.handler.bootloader.ptable 67 self.ptable_format = self.ks.bootloader.ptable
68 68
69 self.oe_builddir = oe_builddir 69 self.oe_builddir = oe_builddir
70 if image_output_dir: 70 if image_output_dir:
@@ -151,12 +151,12 @@ class DirectImageCreator(BaseImageCreator):
151 "please check your kickstart setting.") 151 "please check your kickstart setting.")
152 152
153 # Set a default partition if no partition is given out 153 # Set a default partition if no partition is given out
154 if not self.ks.handler.partition.partitions: 154 if not self.ks.partitions:
155 partstr = "part / --size 1900 --ondisk sda --fstype=ext3" 155 partstr = "part / --size 1900 --ondisk sda --fstype=ext3"
156 args = partstr.split() 156 args = partstr.split()
157 part = self.ks.handler.partition.parse(args[1:]) 157 part = self.ks.parse(args[1:])
158 if part not in self.ks.handler.partition.partitions: 158 if part not in self.ks.partitions:
159 self.ks.handler.partition.partitions.append(part) 159 self.ks.partitions.append(part)
160 160
161 # partitions list from kickstart file 161 # partitions list from kickstart file
162 return kickstart.get_partitions(self.ks) 162 return kickstart.get_partitions(self.ks)
@@ -206,7 +206,7 @@ class DirectImageCreator(BaseImageCreator):
206 bootloader object, the default can be explicitly set using the 206 bootloader object, the default can be explicitly set using the
207 --source bootloader param. 207 --source bootloader param.
208 """ 208 """
209 return self.ks.handler.bootloader.source 209 return self.ks.bootloader.source
210 210
211 # 211 #
212 # Actual implemention 212 # Actual implemention
@@ -224,8 +224,8 @@ class DirectImageCreator(BaseImageCreator):
224 for part in parts: 224 for part in parts:
225 # as a convenience, set source to the boot partition source 225 # as a convenience, set source to the boot partition source
226 # instead of forcing it to be set via bootloader --source 226 # instead of forcing it to be set via bootloader --source
227 if not self.ks.handler.bootloader.source and part.mountpoint == "/boot": 227 if not self.ks.bootloader.source and part.mountpoint == "/boot":
228 self.ks.handler.bootloader.source = part.source 228 self.ks.bootloader.source = part.source
229 229
230 fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR")) 230 fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
231 231
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 5feb79dbf1..556586f322 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):
61 61
62 if not custom_cfg: 62 if not custom_cfg:
63 # Create grub configuration using parameters from wks file 63 # Create grub configuration using parameters from wks file
64 options = creator.ks.handler.bootloader.appendLine 64 bootloader = creator.ks.bootloader
65 65
66 grubefi_conf = "" 66 grubefi_conf = ""
67 grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n" 67 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 76e7b033fb..4280ff7f3e 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):
78 78
79 Called before do_prepare_partition() 79 Called before do_prepare_partition()
80 """ 80 """
81 options = image_creator.ks.handler.bootloader.appendLine 81 bootloader = image_creator.ks.bootloader
82 82
83 syslinux_conf = "" 83 syslinux_conf = ""
84 syslinux_conf += "PROMPT 0\n" 84 syslinux_conf += "PROMPT 0\n"
@@ -97,7 +97,7 @@ class RootfsPlugin(SourcePlugin):
97 syslinux_conf += " KERNEL /boot/bzImage\n" 97 syslinux_conf += " KERNEL /boot/bzImage\n"
98 98
99 syslinux_conf += " APPEND label=boot root=%s %s\n" % \ 99 syslinux_conf += " APPEND label=boot root=%s %s\n" % \
100 (image_creator.rootdev, options) 100 (image_creator.rootdev, bootloader.append)
101 101
102 syslinux_cfg = os.path.join(image_creator.rootfs_dir['ROOTFS_DIR'], "boot", "syslinux.cfg") 102 syslinux_cfg = os.path.join(image_creator.rootfs_dir['ROOTFS_DIR'], "boot", "syslinux.cfg")
103 msger.debug("Writing syslinux config %s" % syslinux_cfg) 103 msger.debug("Writing syslinux config %s" % syslinux_cfg)