livemedia-creator: update templates for grub2-efi support

This commit is contained in:
Brian C. Lane 2012-08-21 16:19:45 -07:00
parent 340349b763
commit 9323836c38
3 changed files with 42 additions and 6 deletions

View File

@ -0,0 +1,31 @@
set default="0"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=5
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry '@PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@
initrdefi @INITRDPATH@
}
menuentry 'Test this media & start @PRODUCT@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ quiet rd.live.check
initrdefi @INITRDPATH@
}

View File

@ -1,4 +1,4 @@
<%page args="configdir, KERNELDIR, efiarch"/>
<%page args="configdir, KERNELDIR, efiarch, isolabel"/>
<%
EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
@ -6,7 +6,10 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
%>
mkdir ${EFIBOOTDIR}
install boot/efi/EFI/redhat/grub.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
mkdir ${EFIBOOTDIR}/fonts/
install boot/efi/EFI/fedora/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/fedora/grub-cd.efi ${EFIBOOTDIR}/grubx64.efi
install boot/efi/EFI/fedora/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
install boot/grub/splash.xpm.gz ${EFIBOOTDIR}
## actually make the EFI images
@ -19,7 +22,7 @@ ${make_efiboot("images/efiboot.img")}
<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')">
<%
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
eficonf = "%s/BOOT%s.conf" % (EFIBOOTDIR, efiarch)
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
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)
@ -28,12 +31,14 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
install ${configdir}/grub.conf ${eficonf}
install ${configdir}/grub2-efi.cfg ${eficonf}
replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @SPLASHPATH@ /EFI/BOOT/splash.xpm.gz ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf}
%if disk:
## FIXME: using root= causes problems with product.img (see bug 811979)
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}

View File

@ -49,7 +49,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft=""; efihybrid="" %>
%if exists("boot/efi/EFI/redhat/grub.efi") and basearch != 'i386':
%if exists("boot/efi/EFI/fedora/grub-cd.efi") and basearch != 'i386':
<%
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
@ -61,7 +61,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
efigraft += " {0}={1}/{0}".format(img,outroot)
efihybrid = "--uefi --mac" if domacboot else "--uefi"
%>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch"/>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/>
%endif
## make boot.iso