diff options
| author | Vincent Davis Jr <vince@underview.tech> | 2025-08-14 00:25:46 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-08-14 10:31:11 +0100 |
| commit | 2bcf99792b6a31ece0a6d76d08cc9866bd092fa0 (patch) | |
| tree | 5c9e0f36dc1830809fc6ee33b9bdd05687e18839 /scripts/lib | |
| parent | eb3df0324ad13dfa06feb8336f13aeff74866034 (diff) | |
| download | poky-2bcf99792b6a31ece0a6d76d08cc9866bd092fa0.tar.gz | |
bootimg_pcbios: seperate bootloader config creation
Most bootloaders that will be included in this
wics plugin will require a configuration file
to define kernel params, execute custom
modules, or enable the ability to select
one of multiple boot entries.
Create a seperate generic function to facilitate
finding if a bootloader config file passed through
bootloader --configfile flag. So, that other functions
that are used to create/install a bootloader boot
configuration file can leverage the function.
(From OE-Core rev: 7944e29eb6ab7b80ad3847686dd780100623b196)
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 | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg_pcbios.py b/scripts/lib/wic/plugins/source/bootimg_pcbios.py index 9ad301b008..47fd4b9415 100644 --- a/scripts/lib/wic/plugins/source/bootimg_pcbios.py +++ b/scripts/lib/wic/plugins/source/bootimg_pcbios.py | |||
| @@ -73,6 +73,22 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
| 73 | rootfs_dir, native_sysroot) | 73 | rootfs_dir, native_sysroot) |
| 74 | 74 | ||
| 75 | @classmethod | 75 | @classmethod |
| 76 | def _get_bootloader_config(cls, bootloader, loader): | ||
| 77 | custom_cfg = None | ||
| 78 | |||
| 79 | if bootloader.configfile: | ||
| 80 | custom_cfg = get_custom_config(bootloader.configfile) | ||
| 81 | if custom_cfg: | ||
| 82 | logger.debug("Using custom configuration file %s " | ||
| 83 | "for %s.cfg", bootloader.configfile, | ||
| 84 | loader) | ||
| 85 | return custom_cfg | ||
| 86 | else: | ||
| 87 | raise WicError("configfile is specified but failed to " | ||
| 88 | "get it from %s." % bootloader.configfile) | ||
| 89 | return custom_cfg | ||
| 90 | |||
| 91 | @classmethod | ||
| 76 | def _do_configure_syslinux(cls, part, source_params, creator, cr_workdir, | 92 | def _do_configure_syslinux(cls, part, source_params, creator, cr_workdir, |
| 77 | oe_builddir, bootimg_dir, kernel_dir, | 93 | oe_builddir, bootimg_dir, kernel_dir, |
| 78 | native_sysroot): | 94 | native_sysroot): |
| @@ -86,20 +102,9 @@ class BootimgPcbiosPlugin(SourcePlugin): | |||
| 86 | exec_cmd(install_cmd) | 102 | exec_cmd(install_cmd) |
| 87 | 103 | ||
| 88 | bootloader = creator.ks.bootloader | 104 | bootloader = creator.ks.bootloader |
| 105 | syslinux_conf = cls._get_bootloader_config(bootloader, 'syslinux') | ||
| 89 | 106 | ||
| 90 | custom_cfg = None | 107 | if not syslinux_conf: |
| 91 | if bootloader.configfile: | ||
| 92 | custom_cfg = get_custom_config(bootloader.configfile) | ||
| 93 | if custom_cfg: | ||
| 94 | # Use a custom configuration for grub | ||
| 95 | syslinux_conf = custom_cfg | ||
| 96 | logger.debug("Using custom configuration file %s " | ||
| 97 | "for syslinux.cfg", bootloader.configfile) | ||
| 98 | else: | ||
| 99 | raise WicError("configfile is specified but failed to " | ||
| 100 | "get it from %s." % bootloader.configfile) | ||
| 101 | |||
| 102 | if not custom_cfg: | ||
| 103 | # Create syslinux configuration using parameters from wks file | 108 | # Create syslinux configuration using parameters from wks file |
| 104 | splash = os.path.join(cr_workdir, "/hdd/boot/splash.jpg") | 109 | splash = os.path.join(cr_workdir, "/hdd/boot/splash.jpg") |
| 105 | if os.path.exists(splash): | 110 | if os.path.exists(splash): |
