summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/plugins/source/bootimg_pcbios.py31
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):