]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
bootimg_pcbios: move syslinux install into seperate functions
authorVincent Davis Jr <vince@underview.tech>
Thu, 14 Aug 2025 04:25:44 +0000 (00:25 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Aug 2025 09:30:39 +0000 (10:30 +0100)
Current oe-core bootimg_pcbios wics plugin
only supports installing syslinux directly
into the resulting wic image.

This commit seperates syslinux installation from
class BootimgPcbiosPlugin(SourcePlugin) override
functions in preparation of supporting the installation
of other bootloaders to the resulting wics plugin
such as:
* grub
* extlinux

Being moved now to make it easier to include
future bootloaders.

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/plugins/source/bootimg_pcbios.py

index 21f41e00bbbb6f9df8d8bd4dcc4ebd227243bc13..6bde7a67d39f1892bf04eb90a2d8d57c5d7e622b 100644 (file)
@@ -50,10 +50,18 @@ class BootimgPcbiosPlugin(SourcePlugin):
     @classmethod
     def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
                         bootimg_dir, kernel_dir, native_sysroot):
+
+        cls._do_install_syslinux(disk, disk_name, creator, workdir, oe_builddir,
+                                 bootimg_dir, kernel_dir, native_sysroot)
+
+    @classmethod
+    def _do_install_syslinux(cls, disk, disk_name, creator, workdir, oe_builddir,
+                             bootimg_dir, kernel_dir, native_sysroot):
         """
         Called after all partitions have been prepared and assembled into a
         disk image.  In this case, we install the MBR.
         """
+
         bootimg_dir = cls._get_bootimg_dir(bootimg_dir, 'syslinux')
         mbrfile = "%s/syslinux/" % bootimg_dir
         if creator.ptable_format == 'msdos':
@@ -80,9 +88,19 @@ class BootimgPcbiosPlugin(SourcePlugin):
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
                                oe_builddir, bootimg_dir, kernel_dir,
                                native_sysroot):
+
+        cls._do_configure_syslinux(part, source_params, creator, cr_workdir,
+                                   oe_builddir, bootimg_dir, kernel_dir,
+                                   native_sysroot)
+
+    @classmethod
+    def _do_configure_syslinux(cls, part, source_params, creator, cr_workdir,
+                               oe_builddir, bootimg_dir, kernel_dir,
+                               native_sysroot):
         """
         Called before do_prepare_partition(), creates syslinux config
         """
+
         hdddir = "%s/hdd/boot" % cr_workdir
 
         install_cmd = "install -d %s" % hdddir
@@ -138,6 +156,15 @@ class BootimgPcbiosPlugin(SourcePlugin):
     def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
                              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)
+
+    @classmethod
+    def _do_prepare_syslinux(cls, part, source_params, creator, cr_workdir,
+                             oe_builddir, bootimg_dir, kernel_dir,
+                             rootfs_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.