diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index beb74d7a71..0eb86a079f 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py | |||
@@ -45,7 +45,7 @@ class BootimgEFIPlugin(SourcePlugin): | |||
45 | name = 'bootimg-efi' | 45 | name = 'bootimg-efi' |
46 | 46 | ||
47 | @classmethod | 47 | @classmethod |
48 | def do_configure_grubefi(cls, creator, cr_workdir): | 48 | def do_configure_grubefi(cls, hdddir, creator, cr_workdir, source_params): |
49 | """ | 49 | """ |
50 | Create loader-specific (grub-efi) config | 50 | Create loader-specific (grub-efi) config |
51 | """ | 51 | """ |
@@ -62,6 +62,18 @@ class BootimgEFIPlugin(SourcePlugin): | |||
62 | raise WicError("configfile is specified but failed to " | 62 | raise WicError("configfile is specified but failed to " |
63 | "get it from %s." % configfile) | 63 | "get it from %s." % configfile) |
64 | 64 | ||
65 | initrd = source_params.get('initrd') | ||
66 | |||
67 | if initrd: | ||
68 | bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") | ||
69 | if not bootimg_dir: | ||
70 | raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") | ||
71 | |||
72 | cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir) | ||
73 | exec_cmd(cp_cmd, True) | ||
74 | else: | ||
75 | logger.debug("Ignoring missing initrd") | ||
76 | |||
65 | if not custom_cfg: | 77 | if not custom_cfg: |
66 | # Create grub configuration using parameters from wks file | 78 | # Create grub configuration using parameters from wks file |
67 | bootloader = creator.ks.bootloader | 79 | bootloader = creator.ks.bootloader |
@@ -76,6 +88,10 @@ class BootimgEFIPlugin(SourcePlugin): | |||
76 | 88 | ||
77 | grubefi_conf += "linux %s root=%s rootwait %s\n" \ | 89 | grubefi_conf += "linux %s root=%s rootwait %s\n" \ |
78 | % (kernel, creator.rootdev, bootloader.append) | 90 | % (kernel, creator.rootdev, bootloader.append) |
91 | |||
92 | if initrd: | ||
93 | grubefi_conf += "initrd /%s\n" % initrd | ||
94 | |||
79 | grubefi_conf += "}\n" | 95 | grubefi_conf += "}\n" |
80 | 96 | ||
81 | logger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg", | 97 | logger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg", |
@@ -167,7 +183,7 @@ class BootimgEFIPlugin(SourcePlugin): | |||
167 | 183 | ||
168 | try: | 184 | try: |
169 | if source_params['loader'] == 'grub-efi': | 185 | if source_params['loader'] == 'grub-efi': |
170 | cls.do_configure_grubefi(creator, cr_workdir) | 186 | cls.do_configure_grubefi(hdddir, creator, cr_workdir, source_params) |
171 | elif source_params['loader'] == 'systemd-boot': | 187 | elif source_params['loader'] == 'systemd-boot': |
172 | cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params) | 188 | cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params) |
173 | else: | 189 | else: |