2017-08-22 15:16:39 +00:00
|
|
|
<%page args="configdir, KERNELDIR, efiarch32, efiarch64, 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/
|
2017-08-22 15:16:39 +00:00
|
|
|
%if efiarch64:
|
|
|
|
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
|
|
|
|
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
|
|
|
|
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
|
|
|
|
%endif
|
|
|
|
%if efiarch32:
|
|
|
|
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
|
|
|
|
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
|
|
|
|
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
|
|
|
|
%endif
|
2021-07-08 23:10:10 +00:00
|
|
|
install boot/grub2/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
|
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, )
|
2014-04-24 17:56:41 +00:00
|
|
|
args = "--label=ANACONDA --debug"
|
2011-05-09 14:47:25 +00:00
|
|
|
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
|
2012-07-25 15:51:24 +00:00
|
|
|
install ${configdir}/grub2-efi.cfg ${eficonf}
|
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
|
2017-08-22 15:16:39 +00:00
|
|
|
%if efiarch32 == '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>
|