lorax/share/efi.tmpl
Will Woods fbd23c4234 add boot config files from anaconda to configdir
This adds the boot config files from anaconda to lorax's configdir.

They've been edited to include a '@ROOT@' placeholder, so lorax can put
the proper root=... argument in place, and to use the @VAR@ convention
everywhere (instead of some using @VAR@ and some using %VAR%).

This should probably fix EFI booting, since the EFI BOOT*.conf was
missing its root=... arg.

Also some default settings were changed in syslinux.cfg (so we don't
have to rewrite those two lines every time).

One last change - the '-magic' arg and ppc 'magic' file have been
dropped, because that's kind of silly and unnecessary.
2011-08-08 20:09:32 -04:00

45 lines
1.6 KiB
Cheetah

<%page args="ANABOOTDIR, KERNELDIR, efiarch"/>
<% EFIBOOTDIR="EFI/BOOT" %>
mkdir ${EFIBOOTDIR}
install boot/efi/EFI/redhat/grub.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/grub/splash.xpm.gz ${EFIBOOTDIR}
## actually make the EFI images
${make_efiboot("images/efidisk.img", include_kernel=True, disk=True)}
${make_efiboot("images/efiboot.img", include_kernel=False)}
## This is kinda gross, but then... so's EFI.
<%def name="make_efiboot(img, include_kernel, disk=False)">
<%
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
eficonf = "%s/BOOT%s.conf" % (EFIBOOTDIR, efiarch)
args = "--label=ANACONDA"
if disk: args += " --disk"
%>
%if include_kernel:
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
install ${ANABOOTDIR}/grub.conf ${eficonf}
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}
%if disk:
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
%else:
## NOTE: this needs to match the boot.iso label (see x86.tmpl)
replace @ROOT@ root=live:CDLABEL=${udev_escape(product.name)} ${eficonf}
%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>