2017-08-22 15:16:39 +00:00
|
|
|
<%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/>
|
2012-07-27 14:45:57 +00:00
|
|
|
<%
|
|
|
|
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}
|
2012-08-21 23:19:45 +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
|
2012-08-23 16:22:43 +00:00
|
|
|
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
|
2012-07-27 14:45:57 +00:00
|
|
|
|
|
|
|
## 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
|
2012-08-21 23:19:45 +00:00
|
|
|
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
|
2012-07-27 14:45:57 +00:00
|
|
|
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
|
2012-08-21 23:19:45 +00:00
|
|
|
install ${configdir}/grub2-efi.cfg ${eficonf}
|
2012-07-27 14:45:57 +00:00
|
|
|
replace @PRODUCT@ '${product.name}' ${eficonf}
|
|
|
|
replace @VERSION@ ${product.version} ${eficonf}
|
2012-08-21 23:19:45 +00:00
|
|
|
replace @KERNELNAME@ vmlinuz ${eficonf}
|
2012-07-27 14:45:57 +00:00
|
|
|
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
|
|
|
|
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
|
2012-08-21 23:19:45 +00:00
|
|
|
replace @ISOLABEL@ '${isolabel}' ${eficonf}
|
2012-07-27 14:45:57 +00:00
|
|
|
%if disk:
|
2012-09-13 23:07:24 +00:00
|
|
|
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
|
2012-07-27 14:45:57 +00:00
|
|
|
%else:
|
2012-09-13 23:07:24 +00:00
|
|
|
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf}
|
2012-07-27 14:45:57 +00:00
|
|
|
%endif
|
2017-08-22 15:16:39 +00:00
|
|
|
%if efiarch32 == 'IA32':
|
2012-07-27 14:45:57 +00:00
|
|
|
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>
|