summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-02 13:58:16 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-03 12:43:31 +0100
commit791a3912d98014105bdb2a8585e4a1b7ae8120b1 (patch)
treebcfb06b795482f6113cfa6b5c967a0bbb9b4bc1c /scripts/lib/wic/plugins
parent14b47e22f9b2566320ab6ef103da1501bca129de (diff)
downloadpoky-791a3912d98014105bdb2a8585e4a1b7ae8120b1.tar.gz
wic: fix short variable names
Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". (From OE-Core rev: 872cb0d5d79b26f34e6b35d7be8870d245021be4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins')
-rw-r--r--scripts/lib/wic/plugins/imager/direct_plugin.py4
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py26
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-pcbios.py28
-rw-r--r--scripts/lib/wic/plugins/source/isoimage-isohybrid.py32
4 files changed, 45 insertions, 45 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct_plugin.py b/scripts/lib/wic/plugins/imager/direct_plugin.py
index e9672fe274..6d3f46cc61 100644
--- a/scripts/lib/wic/plugins/imager/direct_plugin.py
+++ b/scripts/lib/wic/plugins/imager/direct_plugin.py
@@ -50,8 +50,8 @@ class DirectPlugin(ImagerPlugin):
50 """ 50 """
51 krootfs_dir = {} 51 krootfs_dir = {}
52 for rootfs_dir in rootfs_dirs.split(' '): 52 for rootfs_dir in rootfs_dirs.split(' '):
53 k, v = rootfs_dir.split('=') 53 key, val = rootfs_dir.split('=')
54 krootfs_dir[k] = v 54 krootfs_dir[key] = val
55 55
56 return krootfs_dir 56 return krootfs_dir
57 57
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index b48cc835d6..fa63c6abda 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -41,16 +41,16 @@ class BootimgEFIPlugin(SourcePlugin):
41 name = 'bootimg-efi' 41 name = 'bootimg-efi'
42 42
43 @classmethod 43 @classmethod
44 def do_configure_grubefi(cls, hdddir, cr, cr_workdir): 44 def do_configure_grubefi(cls, hdddir, creator, cr_workdir):
45 """ 45 """
46 Create loader-specific (grub-efi) config 46 Create loader-specific (grub-efi) config
47 """ 47 """
48 options = cr.ks.handler.bootloader.appendLine 48 options = creator.ks.handler.bootloader.appendLine
49 49
50 grubefi_conf = "" 50 grubefi_conf = ""
51 grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n" 51 grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n"
52 grubefi_conf += "default=boot\n" 52 grubefi_conf += "default=boot\n"
53 timeout = kickstart.get_timeout(cr.ks) 53 timeout = kickstart.get_timeout(creator.ks)
54 if not timeout: 54 if not timeout:
55 timeout = 0 55 timeout = 0
56 grubefi_conf += "timeout=%s\n" % timeout 56 grubefi_conf += "timeout=%s\n" % timeout
@@ -59,7 +59,7 @@ class BootimgEFIPlugin(SourcePlugin):
59 kernel = "/bzImage" 59 kernel = "/bzImage"
60 60
61 grubefi_conf += "linux %s root=%s rootwait %s\n" \ 61 grubefi_conf += "linux %s root=%s rootwait %s\n" \
62 % (kernel, cr.rootdev, options) 62 % (kernel, creator.rootdev, options)
63 grubefi_conf += "}\n" 63 grubefi_conf += "}\n"
64 64
65 msger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg" \ 65 msger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg" \
@@ -69,7 +69,7 @@ class BootimgEFIPlugin(SourcePlugin):
69 cfg.close() 69 cfg.close()
70 70
71 @classmethod 71 @classmethod
72 def do_configure_gummiboot(cls, hdddir, cr, cr_workdir): 72 def do_configure_gummiboot(cls, hdddir, creator, cr_workdir):
73 """ 73 """
74 Create loader-specific (gummiboot) config 74 Create loader-specific (gummiboot) config
75 """ 75 """
@@ -79,9 +79,9 @@ class BootimgEFIPlugin(SourcePlugin):
79 install_cmd = "install -d %s/loader/entries" % hdddir 79 install_cmd = "install -d %s/loader/entries" % hdddir
80 exec_cmd(install_cmd) 80 exec_cmd(install_cmd)
81 81
82 options = cr.ks.handler.bootloader.appendLine 82 options = creator.ks.handler.bootloader.appendLine
83 83
84 timeout = kickstart.get_timeout(cr.ks) 84 timeout = kickstart.get_timeout(creator.ks)
85 if not timeout: 85 if not timeout:
86 timeout = 0 86 timeout = 0
87 87
@@ -100,7 +100,7 @@ class BootimgEFIPlugin(SourcePlugin):
100 boot_conf = "" 100 boot_conf = ""
101 boot_conf += "title boot\n" 101 boot_conf += "title boot\n"
102 boot_conf += "linux %s\n" % kernel 102 boot_conf += "linux %s\n" % kernel
103 boot_conf += "options LABEL=Boot root=%s %s\n" % (cr.rootdev, options) 103 boot_conf += "options LABEL=Boot root=%s %s\n" % (creator.rootdev, options)
104 104
105 msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \ 105 msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \
106 % cr_workdir) 106 % cr_workdir)
@@ -110,7 +110,7 @@ class BootimgEFIPlugin(SourcePlugin):
110 110
111 111
112 @classmethod 112 @classmethod
113 def do_configure_partition(cls, part, source_params, cr, cr_workdir, 113 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
114 oe_builddir, bootimg_dir, kernel_dir, 114 oe_builddir, bootimg_dir, kernel_dir,
115 native_sysroot): 115 native_sysroot):
116 """ 116 """
@@ -125,9 +125,9 @@ class BootimgEFIPlugin(SourcePlugin):
125 125
126 try: 126 try:
127 if source_params['loader'] == 'grub-efi': 127 if source_params['loader'] == 'grub-efi':
128 cls.do_configure_grubefi(hdddir, cr, cr_workdir) 128 cls.do_configure_grubefi(hdddir, creator, cr_workdir)
129 elif source_params['loader'] == 'gummiboot': 129 elif source_params['loader'] == 'gummiboot':
130 cls.do_configure_gummiboot(hdddir, cr, cr_workdir) 130 cls.do_configure_gummiboot(hdddir, creator, cr_workdir)
131 else: 131 else:
132 msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader']) 132 msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader'])
133 except KeyError: 133 except KeyError:
@@ -135,7 +135,7 @@ class BootimgEFIPlugin(SourcePlugin):
135 135
136 136
137 @classmethod 137 @classmethod
138 def do_prepare_partition(cls, part, source_params, cr, cr_workdir, 138 def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
139 oe_builddir, bootimg_dir, kernel_dir, 139 oe_builddir, bootimg_dir, kernel_dir,
140 rootfs_dir, native_sysroot): 140 rootfs_dir, native_sysroot):
141 """ 141 """
@@ -148,7 +148,7 @@ class BootimgEFIPlugin(SourcePlugin):
148 if not bootimg_dir: 148 if not bootimg_dir:
149 msger.error("Couldn't find HDDDIR, exiting\n") 149 msger.error("Couldn't find HDDDIR, exiting\n")
150 # just so the result notes display it 150 # just so the result notes display it
151 cr.set_bootimg_dir(bootimg_dir) 151 creator.set_bootimg_dir(bootimg_dir)
152 152
153 staging_kernel_dir = kernel_dir 153 staging_kernel_dir = kernel_dir
154 154
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 3c2dbc9d1c..96ed54dbad 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -41,36 +41,36 @@ class BootimgPcbiosPlugin(SourcePlugin):
41 name = 'bootimg-pcbios' 41 name = 'bootimg-pcbios'
42 42
43 @classmethod 43 @classmethod
44 def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, 44 def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
45 bootimg_dir, kernel_dir, native_sysroot): 45 bootimg_dir, kernel_dir, native_sysroot):
46 """ 46 """
47 Called after all partitions have been prepared and assembled into a 47 Called after all partitions have been prepared and assembled into a
48 disk image. In this case, we install the MBR. 48 disk image. In this case, we install the MBR.
49 """ 49 """
50 mbrfile = "%s/syslinux/" % bootimg_dir 50 mbrfile = "%s/syslinux/" % bootimg_dir
51 if cr.ptable_format == 'msdos': 51 if creator.ptable_format == 'msdos':
52 mbrfile += "mbr.bin" 52 mbrfile += "mbr.bin"
53 elif cr.ptable_format == 'gpt': 53 elif creator.ptable_format == 'gpt':
54 mbrfile += "gptmbr.bin" 54 mbrfile += "gptmbr.bin"
55 else: 55 else:
56 msger.error("Unsupported partition table: %s" % cr.ptable_format) 56 msger.error("Unsupported partition table: %s" % creator.ptable_format)
57 57
58 if not os.path.exists(mbrfile): 58 if not os.path.exists(mbrfile):
59 msger.error("Couldn't find %s. If using the -e option, do you " 59 msger.error("Couldn't find %s. If using the -e option, do you "
60 "have the right MACHINE set in local.conf? If not, " 60 "have the right MACHINE set in local.conf? If not, "
61 "is the bootimg_dir path correct?" % mbrfile) 61 "is the bootimg_dir path correct?" % mbrfile)
62 62
63 full_path = cr._full_path(workdir, disk_name, "direct") 63 full_path = creator._full_path(workdir, disk_name, "direct")
64 msger.debug("Installing MBR on disk %s as %s with size %s bytes" \ 64 msger.debug("Installing MBR on disk %s as %s with size %s bytes" \
65 % (disk_name, full_path, disk['min_size'])) 65 % (disk_name, full_path, disk['min_size']))
66 66
67 rc = runner.show(['dd', 'if=%s' % mbrfile, 67 rcode = runner.show(['dd', 'if=%s' % mbrfile,
68 'of=%s' % full_path, 'conv=notrunc']) 68 'of=%s' % full_path, 'conv=notrunc'])
69 if rc != 0: 69 if rcode != 0:
70 raise ImageError("Unable to set MBR to %s" % full_path) 70 raise ImageError("Unable to set MBR to %s" % full_path)
71 71
72 @classmethod 72 @classmethod
73 def do_configure_partition(cls, part, source_params, cr, cr_workdir, 73 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
74 oe_builddir, bootimg_dir, kernel_dir, 74 oe_builddir, bootimg_dir, kernel_dir,
75 native_sysroot): 75 native_sysroot):
76 """ 76 """
@@ -89,11 +89,11 @@ class BootimgPcbiosPlugin(SourcePlugin):
89 else: 89 else:
90 splashline = "" 90 splashline = ""
91 91
92 options = cr.ks.handler.bootloader.appendLine 92 options = creator.ks.handler.bootloader.appendLine
93 93
94 syslinux_conf = "" 94 syslinux_conf = ""
95 syslinux_conf += "PROMPT 0\n" 95 syslinux_conf += "PROMPT 0\n"
96 timeout = kickstart.get_timeout(cr.ks) 96 timeout = kickstart.get_timeout(creator.ks)
97 if not timeout: 97 if not timeout:
98 timeout = 0 98 timeout = 0
99 syslinux_conf += "TIMEOUT " + str(timeout) + "\n" 99 syslinux_conf += "TIMEOUT " + str(timeout) + "\n"
@@ -110,7 +110,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
110 syslinux_conf += "KERNEL " + kernel + "\n" 110 syslinux_conf += "KERNEL " + kernel + "\n"
111 111
112 syslinux_conf += "APPEND label=boot root=%s %s\n" % \ 112 syslinux_conf += "APPEND label=boot root=%s %s\n" % \
113 (cr.rootdev, options) 113 (creator.rootdev, options)
114 114
115 msger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg" \ 115 msger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg" \
116 % cr_workdir) 116 % cr_workdir)
@@ -119,7 +119,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
119 cfg.close() 119 cfg.close()
120 120
121 @classmethod 121 @classmethod
122 def do_prepare_partition(cls, part, source_params, cr, cr_workdir, 122 def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
123 oe_builddir, bootimg_dir, kernel_dir, 123 oe_builddir, bootimg_dir, kernel_dir,
124 rootfs_dir, native_sysroot): 124 rootfs_dir, native_sysroot):
125 """ 125 """
@@ -141,7 +141,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
141 if not _has_syslinux(bootimg_dir): 141 if not _has_syslinux(bootimg_dir):
142 msger.error("Please build syslinux first\n") 142 msger.error("Please build syslinux first\n")
143 # just so the result notes display it 143 # just so the result notes display it
144 cr.set_bootimg_dir(bootimg_dir) 144 creator.set_bootimg_dir(bootimg_dir)
145 145
146 staging_kernel_dir = kernel_dir 146 staging_kernel_dir = kernel_dir
147 147
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 1cee90637a..9472d8abb9 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -54,7 +54,7 @@ class IsoImagePlugin(SourcePlugin):
54 name = 'isoimage-isohybrid' 54 name = 'isoimage-isohybrid'
55 55
56 @classmethod 56 @classmethod
57 def do_configure_syslinux(cls, cr, cr_workdir): 57 def do_configure_syslinux(cls, creator, cr_workdir):
58 """ 58 """
59 Create loader-specific (syslinux) config 59 Create loader-specific (syslinux) config
60 """ 60 """
@@ -64,9 +64,9 @@ class IsoImagePlugin(SourcePlugin):
64 else: 64 else:
65 splashline = "" 65 splashline = ""
66 66
67 options = cr.ks.handler.bootloader.appendLine 67 options = creator.ks.handler.bootloader.appendLine
68 68
69 timeout = kickstart.get_timeout(cr.ks, 10) 69 timeout = kickstart.get_timeout(creator.ks, 10)
70 70
71 syslinux_conf = "" 71 syslinux_conf = ""
72 syslinux_conf += "PROMPT 0\n" 72 syslinux_conf += "PROMPT 0\n"
@@ -90,7 +90,7 @@ class IsoImagePlugin(SourcePlugin):
90 cfg.write(syslinux_conf) 90 cfg.write(syslinux_conf)
91 91
92 @classmethod 92 @classmethod
93 def do_configure_grubefi(cls, part, cr, cr_workdir): 93 def do_configure_grubefi(cls, part, creator, cr_workdir):
94 """ 94 """
95 Create loader-specific (grub-efi) config 95 Create loader-specific (grub-efi) config
96 """ 96 """
@@ -100,13 +100,13 @@ class IsoImagePlugin(SourcePlugin):
100 else: 100 else:
101 splashline = "" 101 splashline = ""
102 102
103 options = cr.ks.handler.bootloader.appendLine 103 options = creator.ks.handler.bootloader.appendLine
104 104
105 grubefi_conf = "" 105 grubefi_conf = ""
106 grubefi_conf += "serial --unit=0 --speed=115200 --word=8 " 106 grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
107 grubefi_conf += "--parity=no --stop=1\n" 107 grubefi_conf += "--parity=no --stop=1\n"
108 grubefi_conf += "default=boot\n" 108 grubefi_conf += "default=boot\n"
109 timeout = kickstart.get_timeout(cr.ks, 10) 109 timeout = kickstart.get_timeout(creator.ks, 10)
110 grubefi_conf += "timeout=%s\n" % timeout 110 grubefi_conf += "timeout=%s\n" % timeout
111 grubefi_conf += "\n" 111 grubefi_conf += "\n"
112 grubefi_conf += "search --set=root --label %s " % part.label 112 grubefi_conf += "search --set=root --label %s " % part.label
@@ -185,7 +185,7 @@ class IsoImagePlugin(SourcePlugin):
185 return initrd 185 return initrd
186 186
187 @classmethod 187 @classmethod
188 def do_stage_partition(cls, part, source_params, cr, cr_workdir, 188 def do_stage_partition(cls, part, source_params, creator, cr_workdir,
189 oe_builddir, bootimg_dir, kernel_dir, 189 oe_builddir, bootimg_dir, kernel_dir,
190 native_sysroot): 190 native_sysroot):
191 """ 191 """
@@ -231,7 +231,7 @@ class IsoImagePlugin(SourcePlugin):
231 exec_cmd("bitbake mtools-native") 231 exec_cmd("bitbake mtools-native")
232 232
233 @classmethod 233 @classmethod
234 def do_configure_partition(cls, part, source_params, cr, cr_workdir, 234 def do_configure_partition(cls, part, source_params, creator, cr_workdir,
235 oe_builddir, bootimg_dir, kernel_dir, 235 oe_builddir, bootimg_dir, kernel_dir,
236 native_sysroot): 236 native_sysroot):
237 """ 237 """
@@ -249,11 +249,11 @@ class IsoImagePlugin(SourcePlugin):
249 msger.debug("%s" % source_params) 249 msger.debug("%s" % source_params)
250 if 'image_name' in source_params and \ 250 if 'image_name' in source_params and \
251 source_params['image_name'].strip(): 251 source_params['image_name'].strip():
252 cr.name = source_params['image_name'].strip() 252 creator.name = source_params['image_name'].strip()
253 msger.debug("The name of the image is: %s" % cr.name) 253 msger.debug("The name of the image is: %s" % creator.name)
254 254
255 @classmethod 255 @classmethod
256 def do_prepare_partition(cls, part, source_params, cr, cr_workdir, 256 def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
257 oe_builddir, bootimg_dir, kernel_dir, 257 oe_builddir, bootimg_dir, kernel_dir,
258 rootfs_dir, native_sysroot): 258 rootfs_dir, native_sysroot):
259 """ 259 """
@@ -353,7 +353,7 @@ class IsoImagePlugin(SourcePlugin):
353 exec_cmd(install_cmd) 353 exec_cmd(install_cmd)
354 354
355 if not os.path.isfile("%s/EFI/BOOT/boot.cfg" % bootimg_dir): 355 if not os.path.isfile("%s/EFI/BOOT/boot.cfg" % bootimg_dir):
356 cls.do_configure_grubefi(part, cr, bootimg_dir) 356 cls.do_configure_grubefi(part, creator, bootimg_dir)
357 357
358 # Builds bootx64.efi/bootia32.efi if ISODIR didn't exist or 358 # Builds bootx64.efi/bootia32.efi if ISODIR didn't exist or
359 # didn't contains it 359 # didn't contains it
@@ -463,7 +463,7 @@ class IsoImagePlugin(SourcePlugin):
463 install_cmd = "install -d %s/isolinux" % isodir 463 install_cmd = "install -d %s/isolinux" % isodir
464 exec_cmd(install_cmd) 464 exec_cmd(install_cmd)
465 465
466 cls.do_configure_syslinux(cr, cr_workdir) 466 cls.do_configure_syslinux(creator, cr_workdir)
467 467
468 install_cmd = "install -m 444 %s/syslinux/ldlinux.sys " % syslinux_dir 468 install_cmd = "install -m 444 %s/syslinux/ldlinux.sys " % syslinux_dir
469 install_cmd += "%s/isolinux/ldlinux.sys" % isodir 469 install_cmd += "%s/isolinux/ldlinux.sys" % isodir
@@ -508,7 +508,7 @@ class IsoImagePlugin(SourcePlugin):
508 part.set_source_file(iso_img) 508 part.set_source_file(iso_img)
509 509
510 @classmethod 510 @classmethod
511 def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, 511 def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
512 bootimg_dir, kernel_dir, native_sysroot): 512 bootimg_dir, kernel_dir, native_sysroot):
513 """ 513 """
514 Called after all partitions have been prepared and assembled into a 514 Called after all partitions have been prepared and assembled into a
@@ -516,9 +516,9 @@ class IsoImagePlugin(SourcePlugin):
516 utility for booting via BIOS from disk storage devices. 516 utility for booting via BIOS from disk storage devices.
517 """ 517 """
518 518
519 full_path = cr._full_path(workdir, disk_name, "direct") 519 full_path = creator._full_path(workdir, disk_name, "direct")
520 iso_img = "%s.p1" % full_path 520 iso_img = "%s.p1" % full_path
521 full_path_iso = cr._full_path(workdir, disk_name, "iso") 521 full_path_iso = creator._full_path(workdir, disk_name, "iso")
522 522
523 isohybrid_cmd = "isohybrid -u %s" % iso_img 523 isohybrid_cmd = "isohybrid -u %s" % iso_img
524 msger.debug("running command: %s" % \ 524 msger.debug("running command: %s" % \