memtest86+-5.01-r3.ebuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit mount-boot eutils toolchain-funcs
  5. DESCRIPTION="Memory tester based on memtest86"
  6. HOMEPAGE="http://www.memtest.org/"
  7. SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="-* ~amd64 ~x86"
  11. IUSE="floppy iso serial"
  12. BOOTDIR="/boot/memtest86plus"
  13. QA_PRESTRIPPED="${BOOTDIR}/memtest"
  14. QA_FLAGS_IGNORED="${BOOTDIR}/memtest"
  15. RDEPEND="floppy? ( >=sys-boot/grub-0.95:0 sys-fs/mtools )"
  16. DEPEND="iso? ( app-cdr/cdrtools )"
  17. src_prepare() {
  18. sed -i -e 's,0x10000,0x100000,' memtest.lds || die
  19. epatch "${FILESDIR}/${P}-gcc-473.patch" \
  20. "${FILESDIR}/${P}-hardcoded_cc.patch"
  21. epatch "${FILESDIR}"/${P}-no-scp.patch
  22. epatch "${FILESDIR}"/${P}-io-extern-inline.patch #548312
  23. epatch "${FILESDIR}"/${P}-reboot-def.patch #548312
  24. epatch "${FILESDIR}"/${P}-no-clean.patch #557890
  25. epatch "${FILESDIR}"/${P}-no-C-headers.patch #592638
  26. epatch "${FILESDIR}"/${P}-test-random-cflags.patch #590974
  27. sed -i 's:genisoimage:mkisofs:' makeiso.sh || die
  28. if use serial ; then
  29. sed -i \
  30. -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
  31. config.h \
  32. || die "sed failed"
  33. fi
  34. }
  35. src_configure() {
  36. tc-ld-disable-gold #580212
  37. tc-export AS CC LD
  38. }
  39. src_compile() {
  40. emake
  41. if use iso ; then
  42. ./makeiso.sh || die
  43. fi
  44. }
  45. src_test() { :; }
  46. src_install() {
  47. insinto "${BOOTDIR}"
  48. use iso && newins mt*.iso memtest.iso
  49. doins memtest memtest.bin
  50. exeinto /etc/grub.d
  51. newexe "${FILESDIR}"/39_${PN}-r1 39_${PN}
  52. dodoc README README.build-process FAQ changelog
  53. if use floppy ; then
  54. dobin "${FILESDIR}"/make-memtest86+-boot-floppy
  55. doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
  56. fi
  57. }
  58. pkg_postinst() {
  59. mount-boot_pkg_postinst
  60. elog "memtest86+ has been installed in ${BOOTDIR}/"
  61. elog "You may wish to update your bootloader configs by adding these lines:"
  62. elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
  63. elog " as /etc/grub.d/39_${PN}"
  64. elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
  65. elog " > title=${PN}"
  66. elog " > root (hd?,?)"
  67. elog " > kernel ${BOOTDIR}/memtest.bin"
  68. elog " - For lilo:"
  69. elog " > image = ${BOOTDIR}/memtest.bin"
  70. elog " > label = ${PN}"
  71. elog ""
  72. elog "Note: For older configs, you might have to change from 'memtest' to 'memtest.bin'."
  73. }