2015-09-17 11:32:49 +00:00
|
|
|
<%page args="configdir, KERNELDIR, efiarch, isolabel, kver"/>
|
2013-01-24 10:50:02 +00:00
|
|
|
<%
|
2016-04-10 04:00:00 +00:00
|
|
|
EFIARCH_LOWER=efiarch.lower()
|
2013-01-24 10:50:02 +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}
|
|
|
|
mkdir ${EFIBOOTDIR}/fonts/
|
2016-04-10 04:00:00 +00:00
|
|
|
install boot/efi/EFI/*/gcd${EFIARCH_LOWER}.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
2015-09-17 11:34:55 +00:00
|
|
|
## keep also under original name to make mkefiboot --apple happy
|
2016-04-10 04:00:00 +00:00
|
|
|
##install boot/efi/EFI/*/gcd${EFIARCH_LOWER}.efi ${EFIBOOTDIR}/grub${EFIARCH_LOWER}.efi
|
2015-03-23 23:31:22 +00:00
|
|
|
install boot/efi/EFI/*/xen*.efi ${EFIBOOTDIR}/xen.efi
|
2015-09-17 11:35:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
# For Secure Boot restore those files (keep in mind 32MB limit on efiboot.img
|
|
|
|
# imposed by ISO9660, details in #794):
|
|
|
|
#install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
|
2016-04-10 04:00:00 +00:00
|
|
|
#install boot/efi/EFI/*/gcd${EFIARCH_LOWER}.efi ${EFIBOOTDIR}/grub${EFIARCH_LOWER}.efi
|
2015-09-17 11:35:43 +00:00
|
|
|
#install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
|
|
|
|
## actually make the EFI images
|
2015-03-23 23:31:22 +00:00
|
|
|
${make_efiboot("images/efiboot.img", include_kernel=True)}
|
2013-01-24 10:50:02 +00:00
|
|
|
|
2015-09-17 11:35:43 +00:00
|
|
|
## place fonts on ISO9660, but not in efiboot.img to save space
|
|
|
|
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
|
|
|
|
|
2013-01-24 10:50:02 +00:00
|
|
|
## 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
|
|
|
|
eficonf = "%s/grub.cfg" % (EFIBOOTDIR, )
|
2015-09-13 23:06:24 +00:00
|
|
|
xenconf = "%s/xen.cfg" % (EFIBOOTDIR, )
|
2015-03-23 23:31:22 +00:00
|
|
|
args = "--label=ANACONDA --debug"
|
2015-09-17 11:36:21 +00:00
|
|
|
scsi_modules = "3w-9xxx 3w-sas 3w-xxxx BusLogic a100u2w aacraid advansys aic79xx aic7xxx am53c974 arcmsr atp870u bfa bnx2fc csiostor dc395x dmx3191d esas2r esp_scsi fcoe fnic gdth hpsa hptiop hv_storvsc initio ipr ips isci iscsi_boot_sysfs libfc libfcoe libiscsi libosd libsas lpfc megaraid megaraid_mbox megaraid_mm megaraid_sas mpt2sas mpt3sas mvsas mvumi osd pm80xx pmcraid qla1280 qla2xxx qla4xxx raid_class scsi_debug scsi_dh_emc scsi_dh_rdac scsi_transport_fc scsi_transport_iscsi scsi_transport_sas scsi_transport_spi scsi_transport_srp stex sym53c8xx ufshcd virtio_scsi vmw_pvscsi wd719x"
|
|
|
|
extra_modules = "affs befs coda cuse dlm gfs2 mptfc ncpfs nilfs2 ocfs2 ocfs2_dlm ocfs2_dlmfs ocfs2_nodemanager ocfs2_stack_o2cb ocfs2_stack_user ocfs2_stackglue sctp sysv ubifs ufs"
|
2013-01-24 10:50:02 +00:00
|
|
|
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}
|
2016-03-26 20:18:14 +00:00
|
|
|
runcmd chroot ${inroot} mkdir /boot/efi/EFI/qubes
|
2016-03-21 11:38:20 +00:00
|
|
|
runcmd chroot ${inroot} dracut --nomdadmconf --nolvmconf --xz --install '/.buildstamp' --add 'anaconda pollcdrom' --omit "multipath modsign systemd crypt shutdown plymouth fcoe fcoe-uefi nfs iscsi ifcfg" --omit-drivers="${scsi_modules}" --omit-drivers="${extra_modules}" /boot/efi/EFI/qubes/initrd-small.img ${kver}
|
2015-09-17 11:32:49 +00:00
|
|
|
install boot/efi/EFI/qubes/initrd-small.img ${EFIBOOTDIR}/initrd.img
|
2013-01-24 10:50:02 +00:00
|
|
|
%endif
|
|
|
|
install ${configdir}/grub2-efi.cfg ${eficonf}
|
2015-03-23 23:31:22 +00:00
|
|
|
install ${configdir}/xen-efi.cfg ${xenconf}
|
2013-01-24 10:50:02 +00:00
|
|
|
replace @PRODUCT@ '${product.name}' ${eficonf}
|
|
|
|
replace @VERSION@ ${product.version} ${eficonf}
|
|
|
|
replace @KERNELNAME@ vmlinuz ${eficonf}
|
|
|
|
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
|
2015-03-23 23:31:22 +00:00
|
|
|
replace @KERNELPATH@ /${kdir}/vmlinuz ${xenconf}
|
2013-01-24 10:50:02 +00:00
|
|
|
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
|
2015-03-23 23:31:22 +00:00
|
|
|
replace @EFIDIR@ /${EFIBOOTDIR} ${eficonf}
|
2013-01-24 10:50:02 +00:00
|
|
|
replace @ISOLABEL@ '${isolabel}' ${eficonf}
|
|
|
|
%if disk:
|
|
|
|
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf}
|
2015-03-23 23:31:22 +00:00
|
|
|
replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${xenconf}
|
2013-01-24 10:50:02 +00:00
|
|
|
%else:
|
|
|
|
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
|
2015-03-23 23:31:22 +00:00
|
|
|
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${xenconf}
|
2013-01-24 10:50:02 +00:00
|
|
|
%endif
|
|
|
|
%if efiarch == 'IA32':
|
|
|
|
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
|
|
|
|
%endif
|
|
|
|
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
|
|
|
|
</%def>
|