From a65fd2b9d58a9b7dc4c17a557eee555356334c2c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 26 May 2025 12:56:59 +0100 Subject: wic: Update after plugin name changes Update the plugin names to account for the "-" to "_" plugin name change. (From OE-Core rev: afa1b5c9f6ed17c021e37a54d0d6abee50a60bf9) Signed-off-by: Richard Purdie --- .../lib/wic/plugins/source/bootimg_biosplusefi.py | 30 +++++++++++----------- scripts/lib/wic/plugins/source/bootimg_efi.py | 12 ++++----- .../lib/wic/plugins/source/bootimg_partition.py | 4 +-- scripts/lib/wic/plugins/source/bootimg_pcbios.py | 4 +-- .../lib/wic/plugins/source/isoimage_isohybrid.py | 10 ++++---- 5 files changed, 30 insertions(+), 30 deletions(-) (limited to 'scripts/lib/wic/plugins/source') diff --git a/scripts/lib/wic/plugins/source/bootimg_biosplusefi.py b/scripts/lib/wic/plugins/source/bootimg_biosplusefi.py index 5bd7390680..4279ddded8 100644 --- a/scripts/lib/wic/plugins/source/bootimg_biosplusefi.py +++ b/scripts/lib/wic/plugins/source/bootimg_biosplusefi.py @@ -13,7 +13,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # DESCRIPTION -# This implements the 'bootimg-biosplusefi' source plugin class for 'wic' +# This implements the 'bootimg_biosplusefi' source plugin class for 'wic' # # AUTHORS # William Bourque @@ -34,7 +34,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): Note it is possible to create an image that can boot from both legacy BIOS and EFI by defining two partitions : one with arg - --source bootimg-efi and another one with --source bootimg-pcbios. + --source bootimg_efi and another one with --source bootimg_pcbios. However, this method has the obvious downside that it requires TWO partitions to be created on the storage device. Both partitions will also be marked as "bootable" which does not work on @@ -45,7 +45,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): the first partition will be duplicated into the second, even though it will not be used at all. - Also, unlike "isoimage-isohybrid" that also does BIOS and EFI, this plugin + Also, unlike "isoimage_isohybrid" that also does BIOS and EFI, this plugin allows you to have more than only a single rootfs partitions and does not turn the rootfs into an initramfs RAM image. @@ -53,32 +53,32 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): does not have the limitations listed above. The plugin is made so it does tries not to reimplement what's already - been done in other plugins; as such it imports "bootimg-pcbios" - and "bootimg-efi". - Plugin "bootimg-pcbios" is used to generate legacy BIOS boot. - Plugin "bootimg-efi" is used to generate the UEFI boot. Note that it + been done in other plugins; as such it imports "bootimg_pcbios" + and "bootimg_efi". + Plugin "bootimg_pcbios" is used to generate legacy BIOS boot. + Plugin "bootimg_efi" is used to generate the UEFI boot. Note that it requires a --sourceparams argument to know which loader to use; refer - to "bootimg-efi" code/documentation for the list of loader. + to "bootimg_efi" code/documentation for the list of loader. Imports are handled with "SourceFileLoader" from importlib as it is otherwise very difficult to import module that has hyphen "-" in their filename. The SourcePlugin() methods used in the plugins (do_install_disk, do_configure_partition, do_prepare_partition) are then called on both, - beginning by "bootimg-efi". + beginning by "bootimg_efi". Plugin options, such as "--sourceparams" can still be passed to a plugin, as long they does not cause issue in the other plugin. Example wic configuration: - part /boot --source bootimg-biosplusefi --sourceparams="loader=grub-efi"\\ + part /boot --source bootimg_biosplusefi --sourceparams="loader=grub-efi"\\ --ondisk sda --label os_boot --active --align 1024 --use-uuid """ - name = 'bootimg-biosplusefi' + name = 'bootimg_biosplusefi' - __PCBIOS_MODULE_NAME = "bootimg-pcbios" - __EFI_MODULE_NAME = "bootimg-efi" + __PCBIOS_MODULE_NAME = "bootimg_pcbios" + __EFI_MODULE_NAME = "bootimg_efi" __imgEFIObj = None __imgBiosObj = None @@ -100,7 +100,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): """ - # Import bootimg-pcbios (class name "BootimgPcbiosPlugin") + # Import bootimg_pcbios (class name "BootimgPcbiosPlugin") modulePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), cls.__PCBIOS_MODULE_NAME + ".py") loader = SourceFileLoader(cls.__PCBIOS_MODULE_NAME, modulePath) @@ -108,7 +108,7 @@ class BootimgBiosPlusEFIPlugin(SourcePlugin): loader.exec_module(mod) cls.__imgBiosObj = mod.BootimgPcbiosPlugin() - # Import bootimg-efi (class name "BootimgEFIPlugin") + # Import bootimg_efi (class name "BootimgEFIPlugin") modulePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), cls.__EFI_MODULE_NAME + ".py") loader = SourceFileLoader(cls.__EFI_MODULE_NAME, modulePath) diff --git a/scripts/lib/wic/plugins/source/bootimg_efi.py b/scripts/lib/wic/plugins/source/bootimg_efi.py index 38da5080fb..cf16705a28 100644 --- a/scripts/lib/wic/plugins/source/bootimg_efi.py +++ b/scripts/lib/wic/plugins/source/bootimg_efi.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-2.0-only # # DESCRIPTION -# This implements the 'bootimg-efi' source plugin class for 'wic' +# This implements the 'bootimg_efi' source plugin class for 'wic' # # AUTHORS # Tom Zanussi @@ -32,7 +32,7 @@ class BootimgEFIPlugin(SourcePlugin): This plugin supports GRUB 2 and systemd-boot bootloaders. """ - name = 'bootimg-efi' + name = 'bootimg_efi' @classmethod def _copy_additional_files(cls, hdddir, initrd, dtb): @@ -230,9 +230,9 @@ class BootimgEFIPlugin(SourcePlugin): elif source_params['loader'] == 'uefi-kernel': pass else: - raise WicError("unrecognized bootimg-efi loader: %s" % source_params['loader']) + raise WicError("unrecognized bootimg_efi loader: %s" % source_params['loader']) except KeyError: - raise WicError("bootimg-efi requires a loader, none specified") + raise WicError("bootimg_efi requires a loader, none specified") if get_bitbake_var("IMAGE_EFI_BOOT_FILES") is None: logger.debug('No boot files defined in IMAGE_EFI_BOOT_FILES') @@ -365,7 +365,7 @@ class BootimgEFIPlugin(SourcePlugin): out = exec_cmd(cp_cmd, True) logger.debug("uefi-kernel files:\n%s" % out) else: - raise WicError("unrecognized bootimg-efi loader: %s" % + raise WicError("unrecognized bootimg_efi loader: %s" % source_params['loader']) # must have installed at least one EFI bootloader @@ -375,7 +375,7 @@ class BootimgEFIPlugin(SourcePlugin): raise WicError("No EFI loaders installed to ESP partition. Check that grub-efi, systemd-boot or similar is installed.") except KeyError: - raise WicError("bootimg-efi requires a loader, none specified") + raise WicError("bootimg_efi requires a loader, none specified") startup = os.path.join(kernel_dir, "startup.nsh") if os.path.exists(startup): diff --git a/scripts/lib/wic/plugins/source/bootimg_partition.py b/scripts/lib/wic/plugins/source/bootimg_partition.py index 589853a439..cc121a78f0 100644 --- a/scripts/lib/wic/plugins/source/bootimg_partition.py +++ b/scripts/lib/wic/plugins/source/bootimg_partition.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-2.0-only # # DESCRIPTION -# This implements the 'bootimg-partition' source plugin class for +# This implements the 'bootimg_partition' source plugin class for # 'wic'. The plugin creates an image of boot partition, copying over # files listed in IMAGE_BOOT_FILES bitbake variable. # @@ -31,7 +31,7 @@ class BootimgPartitionPlugin(SourcePlugin): listed in IMAGE_BOOT_FILES bitbake variable. """ - name = 'bootimg-partition' + name = 'bootimg_partition' image_boot_files_var_name = 'IMAGE_BOOT_FILES' @classmethod diff --git a/scripts/lib/wic/plugins/source/bootimg_pcbios.py b/scripts/lib/wic/plugins/source/bootimg_pcbios.py index a207a83530..21f41e00bb 100644 --- a/scripts/lib/wic/plugins/source/bootimg_pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg_pcbios.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-2.0-only # # DESCRIPTION -# This implements the 'bootimg-pcbios' source plugin class for 'wic' +# This implements the 'bootimg_pcbios' source plugin class for 'wic' # # AUTHORS # Tom Zanussi @@ -27,7 +27,7 @@ class BootimgPcbiosPlugin(SourcePlugin): Create MBR boot partition and install syslinux on it. """ - name = 'bootimg-pcbios' + name = 'bootimg_pcbios' @classmethod def _get_bootimg_dir(cls, bootimg_dir, dirname): diff --git a/scripts/lib/wic/plugins/source/isoimage_isohybrid.py b/scripts/lib/wic/plugins/source/isoimage_isohybrid.py index 607356ad13..5d42eb5d3e 100644 --- a/scripts/lib/wic/plugins/source/isoimage_isohybrid.py +++ b/scripts/lib/wic/plugins/source/isoimage_isohybrid.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-2.0-only # # DESCRIPTION -# This implements the 'isoimage-isohybrid' source plugin class for 'wic' +# This implements the 'isoimage_isohybrid' source plugin class for 'wic' # # AUTHORS # Mihaly Varga @@ -35,7 +35,7 @@ class IsoImagePlugin(SourcePlugin): bootloader files. Example kickstart file: - part /boot --source isoimage-isohybrid --sourceparams="loader=grub-efi, \\ + part /boot --source isoimage_isohybrid --sourceparams="loader=grub-efi, \\ image_name= IsoImage" --ondisk cd --label LIVECD bootloader --timeout=10 --append=" " @@ -45,7 +45,7 @@ class IsoImagePlugin(SourcePlugin): extension added by direct imeger plugin) and a file named IsoImage-cd.iso """ - name = 'isoimage-isohybrid' + name = 'isoimage_isohybrid' @classmethod def do_configure_syslinux(cls, creator, cr_workdir): @@ -340,10 +340,10 @@ class IsoImagePlugin(SourcePlugin): cls.do_configure_grubefi(part, creator, target_dir) else: - raise WicError("unrecognized bootimg-efi loader: %s" % + raise WicError("unrecognized bootimg_efi loader: %s" % source_params['loader']) except KeyError: - raise WicError("bootimg-efi requires a loader, none specified") + raise WicError("bootimg_efi requires a loader, none specified") # Create efi.img that contains bootloader files for EFI booting # if ISODIR didn't exist or didn't contains it -- cgit v1.2.3-54-g00ecf