summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/mkefidisk.sh26
-rw-r--r--scripts/lib/wic/plugins/source/bootimg-efi.py22
2 files changed, 23 insertions, 25 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index a175895d81..800733f0af 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -384,7 +384,7 @@ EFIDIR="$BOOTFS_MNT/EFI/BOOT"
384cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy vmlinuz" 384cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy vmlinuz"
385# Copy the efi loader and configs (booti*.efi and grub.cfg if it exists) 385# Copy the efi loader and configs (booti*.efi and grub.cfg if it exists)
386cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy EFI dir" 386cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy EFI dir"
387# Silently ignore a missing gummiboot loader dir (we might just be a GRUB image) 387# Silently ignore a missing systemd-boot loader dir (we might just be a GRUB image)
388cp -r $HDDIMG_MNT/loader $BOOTFS_MNT >$OUT 2>&1 388cp -r $HDDIMG_MNT/loader $BOOTFS_MNT >$OUT 2>&1
389 389
390# Update the boot loaders configurations for an installed image 390# Update the boot loaders configurations for an installed image
@@ -410,25 +410,25 @@ if [ -e "$GRUB_CFG" ]; then
410 sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG 410 sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG
411fi 411fi
412 412
413# Look for a gummiboot installation 413# Look for a systemd-boot installation
414GUMMI_ENTRIES="$BOOTFS_MNT/loader/entries" 414SYSTEMD_BOOT_ENTRIES="$BOOTFS_MNT/loader/entries"
415GUMMI_CFG="$GUMMI_ENTRIES/boot.conf" 415SYSTEMD_BOOT_CFG="$SYSTEMD_BOOT_ENTRIES/boot.conf"
416if [ -d "$GUMMI_ENTRIES" ]; then 416if [ -d "$SYSTEMD_BOOT_ENTRIES" ]; then
417 info "Configuring Gummiboot" 417 info "Configuring SystemD-boot"
418 # remove the install target if it exists 418 # remove the install target if it exists
419 rm $GUMMI_ENTRIES/install.conf >$OUT 2>&1 419 rm $SYSTEMD_BOOT_ENTRIES/install.conf >$OUT 2>&1
420 420
421 if [ ! -e "$GUMMI_CFG" ]; then 421 if [ ! -e "$SYSTEMD_BOOT_CFG" ]; then
422 echo "ERROR: $GUMMI_CFG not found" 422 echo "ERROR: $SYSTEMD_BOOT_CFG not found"
423 fi 423 fi
424 424
425 sed -i "/initrd /d" $GUMMI_CFG 425 sed -i "/initrd /d" $SYSTEMD_BOOT_CFG
426 sed -i "s@ root=[^ ]*@ @" $GUMMI_CFG 426 sed -i "s@ root=[^ ]*@ @" $SYSTEMD_BOOT_CFG
427 sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GUMMI_CFG 427 sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $SYSTEMD_BOOT_CFG
428fi 428fi
429 429
430# Ensure we have at least one EFI bootloader configured 430# Ensure we have at least one EFI bootloader configured
431if [ ! -e $GRUB_CFG ] && [ ! -e $GUMMI_CFG ]; then 431if [ ! -e $GRUB_CFG ] && [ ! -e $SYSTEMD_BOOT_CFG ]; then
432 die "No EFI bootloader configuration found" 432 die "No EFI bootloader configuration found"
433fi 433fi
434 434
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, \
36class BootimgEFIPlugin(SourcePlugin): 36class 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: