1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/>
- <%
- 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/
- %if efiarch64:
- install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
- install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
- install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
- %endif
- %if efiarch32:
- install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
- install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
- install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
- %endif
- install boot/grub2/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
- ## Change files permission under ${EFIBOOTDIR}, OL bug 28945615
- chmod ${EFIBOOTDIR}/*.EFI 555
- chmod ${EFIBOOTDIR}/*.efi 555
- chmod ${EFIBOOTDIR}/fonts/ 555
- chmod ${EFIBOOTDIR}/fonts/unicode.pf2 555
- ## actually make the EFI images
- ${make_efiboot("images/efiboot.img")}
- %if domacboot:
- ${make_efiboot("images/macboot.img", imgtype="apple")}
- %endif
- ## 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, )
- 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)
- %>
- %if include_kernel:
- copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
- copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
- %endif
- 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 @ISOLABEL@ '${isolabel}' ${eficonf}
- %if disk:
- replace @ROOT@ inst.stage2=hd:LABEL=ANACONDA ${eficonf}
- %else:
- replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
- %endif
- %if efiarch32 == '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>
|