lorax/share/efi.tmpl
Brian C. Lane ee71bc9b11 Use BOOTAA64.efi for AARCH64 bootloader filename (#1080113)
Need to stay withing the FAT filename 8.3 limits

Resolves: rhbz#1080113
2014-07-30 17:04:46 -07:00

67 lines
2.4 KiB
Cheetah

<%page args="configdir, KERNELDIR, efiarch, isolabel"/>
<%
EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
%>
mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
%if efiarch == 'AARCH64':
install boot/efi/EFI/*/grubaa64.efi ${EFIBOOTDIR}/BOOTAA64.efi
install boot/efi/EFI/*/grubaa64.efi ${EFIBOOTDIR}/grubaa64.efi
%else:
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
%endif
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
%if exists("usr/share/shim/lockdown.efi"):
install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
%endif
## actually make the EFI images
${make_efiboot("images/efiboot.img")}
%if domacboot:
${make_efiboot("images/macboot.img", imgtype="apple")}
%endif
## This is kinda gross, but then... so's EFI.
<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')">
<%
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
args = "--label=ANACONDA"
if disk: args += " --disk"
if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version)
%>
%if include_kernel:
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
%if exists("usr/share/shim/lockdown.efi"):
install ${configdir}/grub2-efi-lockdown.cfg ${eficonf}
%else:
install ${configdir}/grub2-efi.cfg ${eficonf}
%endif
replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf}
%if disk:
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf}
%else:
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
%endif
%if efiarch == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel:
remove ${EFIBOOTDIR}/vmlinuz
remove ${EFIBOOTDIR}/initrd.img
%endif
</%def>