summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/source/bootimg-pcbios.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/wic/plugins/source/bootimg-pcbios.py')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-pcbios.py28
1 files changed, 14 insertions, 14 deletions
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