2012-07-25 15:51:24 +00:00
|
|
|
<%page args="configdir, KERNELDIR, efiarch, isolabel"/>
|
2011-09-06 16:52:46 +00:00
|
|
|
<%
|
|
|
|
EFIBOOTDIR="EFI/BOOT"
|
2011-10-31 18:57:44 +00:00
|
|
|
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
|
2012-05-02 17:09:20 +00:00
|
|
|
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
2011-09-06 16:52:46 +00:00
|
|
|
%>
|
2011-05-09 14:47:25 +00:00
|
|
|
|
|
|
|
mkdir ${EFIBOOTDIR}
|
2012-07-25 15:51:24 +00:00
|
|
|
mkdir ${EFIBOOTDIR}/fonts/
|
2014-02-20 04:33:08 +00:00
|
|
|
%if efiarch == 'AARCH64':
|
|
|
|
install boot/efi/EFI/*/grubaa64.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
|
|
|
install boot/efi/EFI/*/grubaa64.efi ${EFIBOOTDIR}/grubaa64.efi
|
|
|
|
%else:
|
2012-08-23 16:22:43 +00:00
|
|
|
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
2012-11-30 09:22:27 +00:00
|
|
|
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
|
2012-08-23 21:54:19 +00:00
|
|
|
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
|
2014-02-20 04:33:08 +00:00
|
|
|
%endif
|
2012-08-23 16:22:43 +00:00
|
|
|
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
|
2014-02-28 16:02:18 +00:00
|
|
|
%if exists("usr/share/shim/lockdown.efi"):
|
|
|
|
install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
|
|
|
|
%endif
|
2011-05-09 14:47:25 +00:00
|
|
|
|
|
|
|
## actually make the EFI images
|
2011-09-06 16:52:46 +00:00
|
|
|
${make_efiboot("images/efiboot.img")}
|
2012-05-17 15:27:28 +00:00
|
|
|
%if domacboot:
|
|
|
|
${make_efiboot("images/macboot.img", imgtype="apple")}
|
|
|
|
%endif
|
2011-05-09 14:47:25 +00:00
|
|
|
|
|
|
|
## This is kinda gross, but then... so's EFI.
|
2011-09-06 16:52:46 +00:00
|
|
|
<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')">
|
2011-05-09 14:47:25 +00:00
|
|
|
<%
|
|
|
|
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
|
2012-07-25 15:51:24 +00:00
|
|
|
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
|
2011-05-09 14:47:25 +00:00
|
|
|
args = "--label=ANACONDA"
|
|
|
|
if disk: args += " --disk"
|
2012-05-02 17:09:20 +00:00
|
|
|
if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version)
|
2011-05-09 14:47:25 +00:00
|
|
|
%>
|
|
|
|
%if include_kernel:
|
|
|
|
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
|
2011-05-10 22:21:18 +00:00
|
|
|
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
|
2011-05-09 14:47:25 +00:00
|
|
|
%endif
|
2014-02-28 16:02:18 +00:00
|
|
|
%if exists("usr/share/shim/lockdown.efi"):
|
|
|
|
install ${configdir}/grub2-efi-lockdown.cfg ${eficonf}
|
|
|
|
%else:
|
|
|
|
install ${configdir}/grub2-efi.cfg ${eficonf}
|
|
|
|
%endif
|
2012-03-07 10:27:11 +00:00
|
|
|
replace @PRODUCT@ '${product.name}' ${eficonf}
|
2011-08-02 17:39:06 +00:00
|
|
|
replace @VERSION@ ${product.version} ${eficonf}
|
2012-07-25 15:51:24 +00:00
|
|
|
replace @KERNELNAME@ vmlinuz ${eficonf}
|
2011-08-02 17:39:06 +00:00
|
|
|
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
|
|
|
|
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
|
2012-07-25 15:51:24 +00:00
|
|
|
replace @ISOLABEL@ '${isolabel}' ${eficonf}
|
2011-08-09 00:04:05 +00:00
|
|
|
%if disk:
|
2012-08-22 23:59:03 +00:00
|
|
|
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf}
|
2011-08-09 00:04:05 +00:00
|
|
|
%else:
|
2012-08-22 23:59:03 +00:00
|
|
|
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
|
2011-08-09 00:04:05 +00:00
|
|
|
%endif
|
2011-05-09 14:47:25 +00:00
|
|
|
%if efiarch == 'IA32':
|
2011-08-02 17:39:06 +00:00
|
|
|
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
|
2011-05-09 14:47:25 +00:00
|
|
|
%endif
|
|
|
|
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
|
|
|
|
%if include_kernel:
|
|
|
|
remove ${EFIBOOTDIR}/vmlinuz
|
2011-05-10 22:21:18 +00:00
|
|
|
remove ${EFIBOOTDIR}/initrd.img
|
2011-05-09 14:47:25 +00:00
|
|
|
%endif
|
|
|
|
</%def>
|