2012-08-21 23:19:45 +00:00
|
|
|
<%page args="configdir, KERNELDIR, efiarch, 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/
|
2012-08-23 16:22:43 +00:00
|
|
|
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
2012-08-23 21:54:19 +00:00
|
|
|
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
|
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
|
|
|
|
%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>
|