Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Vincent Davis Jr <vince@underview.tech>
To: openembedded-core@lists.openembedded.org
Cc: Vincent Davis Jr <vince@underview.tech>
Subject: [PATCH v8 5/9] bootimg_pcbios: cleanup prepare and install syslinux funcs
Date: Thu, 14 Aug 2025 00:25:48 -0400	[thread overview]
Message-ID: <20250814042552.21887-5-vince@underview.tech> (raw)
In-Reply-To: <20250814042552.21887-1-vince@underview.tech>

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.

Signed-off-by: Vincent Davis Jr. <vince@underview.tech>
---
 .../lib/wic/plugins/source/bootimg_pcbios.py  | 25 ++++++++-----------
 1 file 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):
     @classmethod
     def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
                         bootimg_dir, kernel_dir, native_sysroot):
+        full_path = creator._full_path(workdir, disk_name, "direct")
+        logger.debug("Installing MBR on disk %s as %s with size %s bytes",
+                     disk_name, full_path, disk.min_size)
 
-        cls._do_install_syslinux(disk, disk_name, creator, workdir, oe_builddir,
-                                 bootimg_dir, kernel_dir, native_sysroot)
+        cls._do_install_syslinux(creator, bootimg_dir,
+                            native_sysroot, full_path)
 
     @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
@@ -66,9 +69,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
                              oe_builddir, bootimg_dir, kernel_dir,
                              rootfs_dir, native_sysroot):
 
-        cls._do_prepare_syslinux(part, source_params, creator, cr_workdir,
-                                 oe_builddir, bootimg_dir, kernel_dir,
-                                 rootfs_dir, native_sysroot)
+        cls._do_prepare_syslinux(part, cr_workdir, bootimg_dir,
+                                 kernel_dir, native_sysroot)
 
     @classmethod
     def _get_bootloader_config(cls, bootloader, loader):
@@ -144,9 +146,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
         cfg.close()
 
     @classmethod
-    def _do_prepare_syslinux(cls, part, source_params, creator, cr_workdir,
-                             oe_builddir, bootimg_dir, kernel_dir,
-                             rootfs_dir, native_sysroot):
+    def _do_prepare_syslinux(cls, part, cr_workdir, bootimg_dir,
+                             kernel_dir, native_sysroot):
         """
         Called to do the actual content population for a partition i.e. it
         'prepares' the partition to be incorporated into the image.
@@ -218,8 +219,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
         part.source_file = bootimg
 
     @classmethod
-    def _do_install_syslinux(cls, disk, disk_name, creator, workdir, oe_builddir,
-                             bootimg_dir, kernel_dir, native_sysroot):
+    def _do_install_syslinux(cls, creator, bootimg_dir,
+                             native_sysroot, full_path):
         """
         Called after all partitions have been prepared and assembled into a
         disk image.  In this case, we install the MBR.
@@ -240,9 +241,5 @@ class BootimgPcbiosPlugin(SourcePlugin):
                            "have the right MACHINE set in local.conf?  If not, "
                            "is the bootimg_dir path correct?" % mbrfile)
 
-        full_path = creator._full_path(workdir, disk_name, "direct")
-        logger.debug("Installing MBR on disk %s as %s with size %s bytes",
-                     disk_name, full_path, disk.min_size)
-
         dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path)
         exec_cmd(dd_cmd, native_sysroot)
-- 
2.34.1



  parent reply	other threads:[~2025-08-14  4:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14  4:25 [PATCH v8 1/9] bootimg_pcbios: move syslinux install into seperate functions Vincent Davis Jr
2025-08-14  4:25 ` [PATCH v8 2/9] bootimg_pcbios: move syslinux funcs to end of file Vincent Davis Jr
2025-08-14  4:25 ` [PATCH v8 3/9] bootimg_pcbios: seperate bootloader config creation Vincent Davis Jr
2025-08-14  4:25 ` [PATCH v8 4/9] bootimg_pcbios: cleanup _do_configure_syslinux function Vincent Davis Jr
2025-08-14  4:25 ` Vincent Davis Jr [this message]
2025-08-14  4:25 ` [PATCH v8 6/9] bootimg_pcbios: add funcs to configure booting with grub Vincent Davis Jr
2025-08-14  4:25 ` [PATCH v8 7/9] bootimg_pcbios: include grub as an optional bootloader Vincent Davis Jr
2025-08-14  4:25 ` [PATCH v8 8/9] bootimg_pcbios: add help and usage comments Vincent Davis Jr
2025-08-14  4:25 ` [PATCH v8 9/9] oe-selftest: add wic.Wic.test_grub_install_pcbios Vincent Davis Jr

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=20250814042552.21887-5-vince@underview.tech \
    --to=vince@underview.tech \
    --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