lorax: preliminary EFI support

This commit is contained in:
Marek Marczykowski-Górecki 2015-03-24 00:31:22 +01:00
parent 5796c78979
commit ff30f25718
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
4 changed files with 46 additions and 32 deletions

View File

@ -13,19 +13,18 @@ set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
insmod chain
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@
menuentry 'Test media and install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
chainloader @EFIDIR@/xen-check.efi
}
menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
chainloader @EFIDIR@/xen.efi
}

View File

@ -0,0 +1,7 @@
[global]
default=qubes
[qubes]
options=loglvl=all
kernel=vmlinuz @ROOT@ rd.live.check
ramdisk=initrd.img

View File

@ -1,5 +1,6 @@
<%page args="configdir, KERNELDIR, efiarch, isolabel"/>
<%
from string import lower
EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
@ -8,12 +9,14 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/*/xen*.efi ${EFIBOOTDIR}/xen-check.efi
install boot/efi/EFI/*/xen*.efi ${EFIBOOTDIR}/xen.efi
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
install boot/efi/EFI/*/gcd${efiarch|lower}.efi ${EFIBOOTDIR}/grub${efiarch|lower}.efi
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
## actually make the EFI images
${make_efiboot("images/efiboot.img")}
${make_efiboot("images/efiboot.img", include_kernel=True)}
%if domacboot:
${make_efiboot("images/macboot.img", imgtype="apple")}
%endif
@ -23,7 +26,9 @@ ${make_efiboot("images/efiboot.img")}
<%
kdir = EFIBOOTDIR if include_kernel else KERNELDIR
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
args = "--label=ANACONDA"
xenconf = "%s/xen-check.cfg" % (EFIBOOTDIR, )
xenconf_no_check = "%s/xen.cfg" % (EFIBOOTDIR, )
args = "--label=ANACONDA --debug"
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)
%>
@ -32,23 +37,26 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif
install ${configdir}/grub2-efi.cfg ${eficonf}
install ${configdir}/xen-efi.cfg ${xenconf}
replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${xenconf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @EFIDIR@ /${EFIBOOTDIR} ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf}
%if disk:
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf}
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${xenconf}
%else:
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${xenconf}
%endif
copy ${xenconf} ${xenconf_no_check}
replace rd.live.check '' ${xenconf_no_check}
%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>

View File

@ -90,23 +90,23 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
%endif
## ## WHeeeeeeee, EFI.
## ## We could remove the basearch restriction someday..
## <% efiargs=""; efigraft=""; efihybrid="" %>
## %if exists("boot/efi/EFI/fedora/gcdx64.efi") and basearch != 'i386':
## <%
## efiarch = 'X64' if basearch=='x86_64' else 'IA32'
## efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
## images = ["images/efiboot.img"]
## if domacboot:
## images.append("images/macboot.img")
## for img in images:
## efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
## 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, isolabel=isolabel"/>
## %endif
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft=""; efihybrid="" %>
%if exists("boot/efi/EFI/*/gcdx64.efi") and basearch != 'i386':
<%
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
if domacboot:
images.append("images/macboot.img")
for img in images:
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
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, isolabel=isolabel"/>
%endif
## ## make boot.iso
## runcmd mkisofs -o ${outroot}/images/boot.iso \