2011-08-09 00:35:35 +00:00
|
|
|
<%page args="configdir, KERNELDIR, efiarch"/>
|
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"
|
2011-09-06 16:52:46 +00:00
|
|
|
%>
|
2011-05-09 14:47:25 +00:00
|
|
|
|
|
|
|
mkdir ${EFIBOOTDIR}
|
2011-08-02 16:46:01 +00:00
|
|
|
install boot/efi/EFI/redhat/grub.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
2011-05-10 22:21:18 +00:00
|
|
|
install boot/grub/splash.xpm.gz ${EFIBOOTDIR}
|
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")}
|
|
|
|
${make_efiboot("images/macboot.img", imgtype="apple")}
|
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
|
2011-08-02 17:39:06 +00:00
|
|
|
eficonf = "%s/BOOT%s.conf" % (EFIBOOTDIR, efiarch)
|
2011-05-09 14:47:25 +00:00
|
|
|
args = "--label=ANACONDA"
|
|
|
|
if disk: args += " --disk"
|
2011-09-06 16:52:46 +00:00
|
|
|
if imgtype == "apple": args += " --apple --icon=%s" % APPLE_EFI_ICON
|
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
|
2011-08-09 00:35:35 +00:00
|
|
|
install ${configdir}/grub.conf ${eficonf}
|
2011-08-02 17:39:06 +00:00
|
|
|
replace @PRODUCT@ ${product.name} ${eficonf}
|
|
|
|
replace @VERSION@ ${product.version} ${eficonf}
|
|
|
|
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
|
|
|
|
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
|
|
|
|
replace @SPLASHPATH@ /EFI/BOOT/splash.xpm.gz ${eficonf}
|
2011-08-09 00:04:05 +00:00
|
|
|
%if disk:
|
|
|
|
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
|
|
|
|
%else:
|
|
|
|
## NOTE: this needs to match the boot.iso label (see x86.tmpl)
|
2011-10-13 00:08:31 +00:00
|
|
|
replace @ROOT@ 'root=live:CDLABEL=${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>
|