diff options
author | Vincent Davis Jr <vince@underview.tech> | 2025-08-14 00:25:48 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-14 10:31:11 +0100 |
commit | 8b64e77f0025ecbe73931d31030f6dd55dffe9d6 (patch) | |
tree | 196401c6ed34d77b25907af6946040689394baad /scripts/lib | |
parent | a51e188be3000e082a7c977e32f249cc829e8453 (diff) | |
download | poky-8b64e77f0025ecbe73931d31030f6dd55dffe9d6.tar.gz |
bootimg_pcbios: cleanup prepare and install syslinux funcs
This commit:
1. Removes unrequired function params from
* _do_prepare_syslinux
* _do_install_syslinux
Reason is that they aren't required by
the function.
2. Moves finding of resulting wic image
back into do_install_disk task. As
the same code may be leverage to install
other bootloaders to the resulting disk.
(From OE-Core rev: 27e3fc1ef5304278254d2288ffc99e1757dd4053)
Signed-off-by: Vincent Davis Jr. <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg_pcbios.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg_pcbios.py b/scripts/lib/wic/plugins/source/bootimg_pcbios.py index 887a548cde..a4fabec0ae 100644 --- a/scripts/lib/wic/plugins/source/bootimg_pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg_pcbios.py | |||
@@ -50,9 +50,12 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
50 | @classmethod | 50 | @classmethod |
51 | def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir, | 51 | def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir, |
52 | bootimg_dir, kernel_dir, native_sysroot): | 52 | bootimg_dir, kernel_dir, native_sysroot): |
53 | full_path = creator._full_path(workdir, disk_name, "direct") | ||
54 | logger.debug("Installing MBR on disk %s as %s with size %s bytes", | ||
55 | disk_name, full_path, disk.min_size) | ||
53 | 56 | ||
54 | cls._do_install_syslinux(disk, disk_name, creator, workdir, oe_builddir, | 57 | cls._do_install_syslinux(creator, bootimg_dir, |
55 | bootimg_dir, kernel_dir, native_sysroot) | 58 | native_sysroot, full_path) |
56 | 59 | ||
57 | @classmethod | 60 | @classmethod |
58 | def do_configure_partition(cls, part, source_params, creator, cr_workdir, | 61 | def do_configure_partition(cls, part, source_params, creator, cr_workdir, |
@@ -66,9 +69,8 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
66 | oe_builddir, bootimg_dir, kernel_dir, | 69 | oe_builddir, bootimg_dir, kernel_dir, |
67 | rootfs_dir, native_sysroot): | 70 | rootfs_dir, native_sysroot): |
68 | 71 | ||
69 | cls._do_prepare_syslinux(part, source_params, creator, cr_workdir, | 72 | cls._do_prepare_syslinux(part, cr_workdir, bootimg_dir, |
70 | oe_builddir, bootimg_dir, kernel_dir, | 73 | kernel_dir, native_sysroot) |
71 | rootfs_dir, native_sysroot) | ||
72 | 74 | ||
73 | @classmethod | 75 | @classmethod |
74 | def _get_bootloader_config(cls, bootloader, loader): | 76 | def _get_bootloader_config(cls, bootloader, loader): |
@@ -144,9 +146,8 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
144 | cfg.close() | 146 | cfg.close() |
145 | 147 | ||
146 | @classmethod | 148 | @classmethod |
147 | def _do_prepare_syslinux(cls, part, source_params, creator, cr_workdir, | 149 | def _do_prepare_syslinux(cls, part, cr_workdir, bootimg_dir, |
148 | oe_builddir, bootimg_dir, kernel_dir, | 150 | kernel_dir, native_sysroot): |
149 | rootfs_dir, native_sysroot): | ||
150 | """ | 151 | """ |
151 | Called to do the actual content population for a partition i.e. it | 152 | Called to do the actual content population for a partition i.e. it |
152 | 'prepares' the partition to be incorporated into the image. | 153 | 'prepares' the partition to be incorporated into the image. |
@@ -218,8 +219,8 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
218 | part.source_file = bootimg | 219 | part.source_file = bootimg |
219 | 220 | ||
220 | @classmethod | 221 | @classmethod |
221 | def _do_install_syslinux(cls, disk, disk_name, creator, workdir, oe_builddir, | 222 | def _do_install_syslinux(cls, creator, bootimg_dir, |
222 | bootimg_dir, kernel_dir, native_sysroot): | 223 | native_sysroot, full_path): |
223 | """ | 224 | """ |
224 | Called after all partitions have been prepared and assembled into a | 225 | Called after all partitions have been prepared and assembled into a |
225 | disk image. In this case, we install the MBR. | 226 | disk image. In this case, we install the MBR. |
@@ -240,9 +241,5 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
240 | "have the right MACHINE set in local.conf? If not, " | 241 | "have the right MACHINE set in local.conf? If not, " |
241 | "is the bootimg_dir path correct?" % mbrfile) | 242 | "is the bootimg_dir path correct?" % mbrfile) |
242 | 243 | ||
243 | full_path = creator._full_path(workdir, disk_name, "direct") | ||
244 | logger.debug("Installing MBR on disk %s as %s with size %s bytes", | ||
245 | disk_name, full_path, disk.min_size) | ||
246 | |||
247 | dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path) | 244 | dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path) |
248 | exec_cmd(dd_cmd, native_sysroot) | 245 | exec_cmd(dd_cmd, native_sysroot) |