ipxe-1.0.0_p20130925.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit toolchain-funcs eutils savedconfig
  5. GIT_REV="cba22d36b77da53890bd65fdadd0e63925687af0"
  6. GIT_SHORT="cba22d3"
  7. DESCRIPTION="Open source network boot (PXE) firmware"
  8. HOMEPAGE="http://ipxe.org"
  9. SRC_URI="https://git.ipxe.org/ipxe.git/snapshot/${GIT_REV}.tar.bz2 -> ${P}-${GIT_SHORT}.tar.bz2"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="amd64 x86"
  13. IUSE="efi ipv6 iso lkrn +qemu undi usb vmware"
  14. DEPEND="dev-lang/perl
  15. sys-libs/zlib
  16. iso? (
  17. sys-boot/syslinux
  18. virtual/cdrtools
  19. )"
  20. RDEPEND=""
  21. S="${WORKDIR}/ipxe-${GIT_SHORT}/src"
  22. src_prepare() {
  23. epatch "${FILESDIR}"/${P}-git-version.patch #482804
  24. epatch "${FILESDIR}"/${P}-no-pie.patch #585752
  25. }
  26. src_configure() {
  27. cat <<-EOF > "${S}"/config/local/general.h
  28. #undef BANNER_TIMEOUT
  29. #define BANNER_TIMEOUT 0
  30. EOF
  31. use ipv6 && echo "#define NET_PROTO_IPV6" >> "${S}"/config/local/general.h
  32. if use vmware; then
  33. cat <<-EOF >> "${S}"/config/local/general.h
  34. #define VMWARE_SETTINGS
  35. #define CONSOLE_VMWARE
  36. EOF
  37. fi
  38. restore_config config/local/general.h
  39. tc-ld-disable-gold
  40. }
  41. src_compile() {
  42. ipxemake() {
  43. # Q='' makes the build verbose since that's what everyone loves now
  44. emake Q='' \
  45. CC="$(tc-getCC)" \
  46. LD="$(tc-getLD)" \
  47. AR="$(tc-getAR)" \
  48. OBJCOPY="$(tc-getOBJCOPY)" \
  49. RANLIB="$(tc-getRANLIB)" \
  50. OBJDUMP="$(tc-getOBJDUMP)" \
  51. HOST_CC="$(tc-getBUILD_CC)" \
  52. "$@"
  53. }
  54. export NO_WERROR=1
  55. if use qemu; then
  56. ipxemake bin/808610de.rom # pxe-e1000.rom (old)
  57. ipxemake bin/8086100e.rom # pxe-e1000.rom
  58. ipxemake bin/80861209.rom # pxe-eepro100.rom
  59. ipxemake bin/10500940.rom # pxe-ne2k_pci.rom
  60. ipxemake bin/10222000.rom # pxe-pcnet.rom
  61. ipxemake bin/10ec8139.rom # pxe-rtl8139.rom
  62. ipxemake bin/1af41000.rom # pxe-virtio.rom
  63. fi
  64. if use vmware; then
  65. ipxemake bin/8086100f.mrom # e1000
  66. ipxemake bin/808610d3.mrom # e1000e
  67. ipxemake bin/10222000.mrom # vlance
  68. ipxemake bin/15ad07b0.rom # vmxnet3
  69. fi
  70. use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
  71. use iso && ipxemake bin/ipxe.iso
  72. use undi && ipxemake bin/undionly.kpxe
  73. use usb && ipxemake bin/ipxe.usb
  74. use lkrn && ipxemake bin/ipxe.lkrn
  75. }
  76. src_install() {
  77. insinto /usr/share/ipxe/
  78. if use qemu || use vmware; then
  79. doins bin/*.rom
  80. fi
  81. use vmware && doins bin/*.mrom
  82. use efi && doins bin-efi/*.efi
  83. use iso && doins bin/*.iso
  84. use undi && doins bin/*.kpxe
  85. use usb && doins bin/*.usb
  86. use lkrn && doins bin/*.lkrn
  87. save_config config/local/general.h
  88. }