diff options
Diffstat (limited to 'scripts/lib/wic/plugins/source/bootimg-efi.py')
-rw-r--r-- | scripts/lib/wic/plugins/source/bootimg-efi.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py index 4adb80becc..305e910d6a 100644 --- a/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/scripts/lib/wic/plugins/source/bootimg-efi.py | |||
@@ -36,7 +36,7 @@ from wic.utils.oe.misc import exec_cmd, exec_native_cmd, get_bitbake_var, \ | |||
36 | class BootimgEFIPlugin(SourcePlugin): | 36 | class BootimgEFIPlugin(SourcePlugin): |
37 | """ | 37 | """ |
38 | Create EFI boot partition. | 38 | Create EFI boot partition. |
39 | This plugin supports GRUB 2 and gummiboot bootloaders. | 39 | This plugin supports GRUB 2 and systemd-boot bootloaders. |
40 | """ | 40 | """ |
41 | 41 | ||
42 | name = 'bootimg-efi' | 42 | name = 'bootimg-efi' |
@@ -82,7 +82,7 @@ class BootimgEFIPlugin(SourcePlugin): | |||
82 | cfg.close() | 82 | cfg.close() |
83 | 83 | ||
84 | @classmethod | 84 | @classmethod |
85 | def do_configure_gummiboot(cls, hdddir, creator, cr_workdir): | 85 | def do_configure_systemdboot(cls, hdddir, creator, cr_workdir): |
86 | """ | 86 | """ |
87 | Create loader-specific systemd-boot/gummiboot config | 87 | Create loader-specific systemd-boot/gummiboot config |
88 | """ | 88 | """ |
@@ -98,7 +98,7 @@ class BootimgEFIPlugin(SourcePlugin): | |||
98 | loader_conf += "default boot\n" | 98 | loader_conf += "default boot\n" |
99 | loader_conf += "timeout %d\n" % bootloader.timeout | 99 | loader_conf += "timeout %d\n" % bootloader.timeout |
100 | 100 | ||
101 | msger.debug("Writing gummiboot config %s/hdd/boot/loader/loader.conf" \ | 101 | msger.debug("Writing systemd-boot config %s/hdd/boot/loader/loader.conf" \ |
102 | % cr_workdir) | 102 | % cr_workdir) |
103 | cfg = open("%s/hdd/boot/loader/loader.conf" % cr_workdir, "w") | 103 | cfg = open("%s/hdd/boot/loader/loader.conf" % cr_workdir, "w") |
104 | cfg.write(loader_conf) | 104 | cfg.write(loader_conf) |
@@ -109,16 +109,16 @@ class BootimgEFIPlugin(SourcePlugin): | |||
109 | if configfile: | 109 | if configfile: |
110 | custom_cfg = get_custom_config(configfile) | 110 | custom_cfg = get_custom_config(configfile) |
111 | if custom_cfg: | 111 | if custom_cfg: |
112 | # Use a custom configuration for gummiboot | 112 | # Use a custom configuration for systemd-boot |
113 | boot_conf = custom_cfg | 113 | boot_conf = custom_cfg |
114 | msger.debug("Using custom configuration file " | 114 | msger.debug("Using custom configuration file " |
115 | "%s for gummiboots's boot.conf" % configfile) | 115 | "%s for systemd-boots's boot.conf" % configfile) |
116 | else: | 116 | else: |
117 | msger.error("configfile is specified but failed to " | 117 | msger.error("configfile is specified but failed to " |
118 | "get it from %s." % configfile) | 118 | "get it from %s." % configfile) |
119 | 119 | ||
120 | if not custom_cfg: | 120 | if not custom_cfg: |
121 | # Create gummiboot configuration using parameters from wks file | 121 | # Create systemd-boot configuration using parameters from wks file |
122 | kernel = "/bzImage" | 122 | kernel = "/bzImage" |
123 | 123 | ||
124 | boot_conf = "" | 124 | boot_conf = "" |
@@ -127,7 +127,7 @@ class BootimgEFIPlugin(SourcePlugin): | |||
127 | boot_conf += "options LABEL=Boot root=%s %s\n" % \ | 127 | boot_conf += "options LABEL=Boot root=%s %s\n" % \ |
128 | (creator.rootdev, bootloader.append) | 128 | (creator.rootdev, bootloader.append) |
129 | 129 | ||
130 | msger.debug("Writing gummiboot config %s/hdd/boot/loader/entries/boot.conf" \ | 130 | msger.debug("Writing systemd-boot config %s/hdd/boot/loader/entries/boot.conf" \ |
131 | % cr_workdir) | 131 | % cr_workdir) |
132 | cfg = open("%s/hdd/boot/loader/entries/boot.conf" % cr_workdir, "w") | 132 | cfg = open("%s/hdd/boot/loader/entries/boot.conf" % cr_workdir, "w") |
133 | cfg.write(boot_conf) | 133 | cfg.write(boot_conf) |
@@ -149,9 +149,8 @@ class BootimgEFIPlugin(SourcePlugin): | |||
149 | try: | 149 | try: |
150 | if source_params['loader'] == 'grub-efi': | 150 | if source_params['loader'] == 'grub-efi': |
151 | cls.do_configure_grubefi(hdddir, creator, cr_workdir) | 151 | cls.do_configure_grubefi(hdddir, creator, cr_workdir) |
152 | elif source_params['loader'] == 'gummiboot' \ | 152 | elif source_params['loader'] == 'systemd-boot': |
153 | or source_params['loader'] == 'systemd-boot': | 153 | cls.do_configure_systemdboot(hdddir, creator, cr_workdir) |
154 | cls.do_configure_gummiboot(hdddir, creator, cr_workdir) | ||
155 | else: | 154 | else: |
156 | msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader']) | 155 | msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader']) |
157 | except KeyError: | 156 | except KeyError: |
@@ -190,8 +189,7 @@ class BootimgEFIPlugin(SourcePlugin): | |||
190 | exec_cmd(cp_cmd, True) | 189 | exec_cmd(cp_cmd, True) |
191 | shutil.move("%s/grub.cfg" % cr_workdir, | 190 | shutil.move("%s/grub.cfg" % cr_workdir, |
192 | "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir) | 191 | "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir) |
193 | elif source_params['loader'] == 'gummiboot' \ | 192 | elif source_params['loader'] == 'systemd-boot': |
194 | or source_params['loader'] == 'systemd-boot': | ||
195 | cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir) | 193 | cp_cmd = "cp %s/EFI/BOOT/* %s/EFI/BOOT" % (bootimg_dir, hdddir) |
196 | exec_cmd(cp_cmd, True) | 194 | exec_cmd(cp_cmd, True) |
197 | else: | 195 | else: |