mirror of
https://git.yoctoproject.org/poky
synced 2026-03-06 23:39:40 +01:00
wic/bootimg-efi.py: recognize initrd when using grub
Make sure that we're able to use the initrd value specified in the wks file when using grub-efi bootloader with bootimg-efi wic plugin. Fixes [YOCTO #12689] (From OE-Core rev: f1d5bb1f21e11714357aff4ae7e52421e3756c5a) (From OE-Core rev: 941bf7bc40e11cbe9e68ccf14155196713709558) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4b871ee7a7
commit
33eb2fb5cd
@@ -45,7 +45,7 @@ class BootimgEFIPlugin(SourcePlugin):
|
||||
name = 'bootimg-efi'
|
||||
|
||||
@classmethod
|
||||
def do_configure_grubefi(cls, creator, cr_workdir):
|
||||
def do_configure_grubefi(cls, hdddir, creator, cr_workdir, source_params):
|
||||
"""
|
||||
Create loader-specific (grub-efi) config
|
||||
"""
|
||||
@@ -62,6 +62,18 @@ class BootimgEFIPlugin(SourcePlugin):
|
||||
raise WicError("configfile is specified but failed to "
|
||||
"get it from %s." % configfile)
|
||||
|
||||
initrd = source_params.get('initrd')
|
||||
|
||||
if initrd:
|
||||
bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
|
||||
if not bootimg_dir:
|
||||
raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
|
||||
|
||||
cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
|
||||
exec_cmd(cp_cmd, True)
|
||||
else:
|
||||
logger.debug("Ignoring missing initrd")
|
||||
|
||||
if not custom_cfg:
|
||||
# Create grub configuration using parameters from wks file
|
||||
bootloader = creator.ks.bootloader
|
||||
@@ -76,6 +88,10 @@ class BootimgEFIPlugin(SourcePlugin):
|
||||
|
||||
grubefi_conf += "linux %s root=%s rootwait %s\n" \
|
||||
% (kernel, creator.rootdev, bootloader.append)
|
||||
|
||||
if initrd:
|
||||
grubefi_conf += "initrd /%s\n" % initrd
|
||||
|
||||
grubefi_conf += "}\n"
|
||||
|
||||
logger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg",
|
||||
@@ -167,7 +183,7 @@ class BootimgEFIPlugin(SourcePlugin):
|
||||
|
||||
try:
|
||||
if source_params['loader'] == 'grub-efi':
|
||||
cls.do_configure_grubefi(creator, cr_workdir)
|
||||
cls.do_configure_grubefi(hdddir, creator, cr_workdir, source_params)
|
||||
elif source_params['loader'] == 'systemd-boot':
|
||||
cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user