Gentoo Archives: gentoo-commits

From: "Tim Harder (radhermit)" <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-libs/libhugetlbfs: libhugetlbfs-2.16.ebuild ChangeLog
Date: Wed, 22 May 2013 05:52:59
Message-Id: 20130522055252.A47C92171D@flycatcher.gentoo.org
1 radhermit 13/05/22 05:52:52
2
3 Modified: ChangeLog
4 Added: libhugetlbfs-2.16.ebuild
5 Log:
6 Version bump (bug #466880).
7
8 (Portage version: 2.2.0_alpha175/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
9
10 Revision Changes Path
11 1.9 sys-libs/libhugetlbfs/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog?rev=1.9&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog?rev=1.9&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog?r1=1.8&r2=1.9
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v
20 retrieving revision 1.8
21 retrieving revision 1.9
22 diff -u -r1.8 -r1.9
23 --- ChangeLog 6 Jan 2013 23:04:18 -0000 1.8
24 +++ ChangeLog 22 May 2013 05:52:52 -0000 1.9
25 @@ -1,6 +1,11 @@
26 # ChangeLog for sys-libs/libhugetlbfs
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.8 2013/01/06 23:04:18 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.9 2013/05/22 05:52:52 radhermit Exp $
30 +
31 +*libhugetlbfs-2.16 (22 May 2013)
32 +
33 + 22 May 2013; Tim Harder <radhermit@g.o> +libhugetlbfs-2.16.ebuild:
34 + Version bump (bug #466880).
35
36 *libhugetlbfs-2.15 (06 Jan 2013)
37
38
39
40
41 1.1 sys-libs/libhugetlbfs/libhugetlbfs-2.16.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.16.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.16.ebuild?rev=1.1&content-type=text/plain
45
46 Index: libhugetlbfs-2.16.ebuild
47 ===================================================================
48 # Copyright 1999-2013 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.16.ebuild,v 1.1 2013/05/22 05:52:52 radhermit Exp $
51
52 EAPI="4"
53
54 inherit eutils multilib toolchain-funcs
55
56 DESCRIPTION="easy hugepage access"
57 HOMEPAGE="http://libhugetlbfs.sourceforge.net/"
58 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
59
60 LICENSE="GPL-2"
61 SLOT="0"
62 KEYWORDS="~amd64 ~ppc64 ~x86"
63
64 src_prepare() {
65 epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
66 epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
67 epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
68 sed -i \
69 -e '/^PREFIX/s:/local::' \
70 -e '1iBUILDTYPE = NATIVEONLY' \
71 -e '1iV = 1' \
72 -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
73 -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
74 Makefile
75 if [ "$(get_libdir)" == "lib64" ]; then
76 sed -i \
77 -e "/^LIB\(32\)/s:=.*:= lib32:" \
78 Makefile
79 fi
80 }
81
82 src_compile() {
83 tc-export AR CC
84 emake libs tools
85 }
86
87 src_install() {
88 default
89 rm "${D}"/usr/bin/oprofile* || die
90 }
91
92 src_test_alloc_one() {
93 hugeadm="$1"
94 sign="$2"
95 pagesize="$3"
96 pagecount="$4"
97 ${hugeadm} \
98 --pool-pages-max ${pagesize}:${sign}${pagecount} \
99 && \
100 ${hugeadm} \
101 --pool-pages-min ${pagesize}:${sign}${pagecount}
102 return $?
103 }
104
105 # die is NOT allowed in this src_test block after the marked point, so that we
106 # can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
107 src_test() {
108 [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
109 einfo "Building testsuite"
110 emake -j1 tests "Failed to build tests"
111
112 hugeadm='obj/hugeadm'
113 allocated=''
114 rc=0
115 # the testcases need 64MiB per pagesize.
116 MIN_HUGEPAGE_RAM=$((64*1024*1024))
117
118 einfo "Planning allocation"
119 PAGESIZES="$(${hugeadm} --page-sizes-all)"
120
121 # Need to do this before we can create the mountpoints.
122 for pagesize in ${PAGESIZES} ; do
123 # The kernel depends on the location :-(
124 mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
125 addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
126 done
127 addwrite /proc/sys/vm/
128 addwrite /proc/sys/kernel/shmall
129 addwrite /proc/sys/kernel/shmmax
130 addwrite /proc/sys/kernel/shmmni
131
132 einfo "Checking HugeTLB mountpoints"
133 ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
134
135 # -----------------------------------------------------
136 # --------- die is unsafe after this point. -----------
137 # -----------------------------------------------------
138
139 einfo "Starting allocation"
140 for pagesize in ${PAGESIZES} ; do
141 pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
142 einfo " ${pagecount} @ ${pagesize}"
143 addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
144 src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
145 rc=$?
146 if [[ $rc -eq 0 ]]; then
147 allocated="${allocated} ${pagesize}:${pagecount}"
148 else
149 eerror "Failed to add ${pagecount} pages of size ${pagesize}"
150 fi
151 done
152
153 einfo "Allocation status"
154 ${hugeadm} --pool-list
155
156 if [[ -n "${allocated}" ]]; then
157 # All our allocations worked, so time to run.
158 einfo "Starting tests"
159 cd "${S}"/tests
160 TESTOPTS="-t func"
161 case $ARCH in
162 amd64|ppc64)
163 TESTOPTS="${TESTOPTS} -b 64"
164 ;;
165 x86)
166 TESTOPTS="${TESTOPTS} -b 32"
167 ;;
168 esac
169 # This needs a bit of work to give a nice exit code still.
170 ./run_tests.py ${TESTOPTS}
171 rc=$?
172 else
173 eerror "Failed to make HugeTLB allocations."
174 rc=1
175 fi
176
177 einfo "Cleaning up memory"
178 cd "${S}"
179 # Cleanup memory allocation
180 for alloc in ${allocated} ; do
181 pagesize="${alloc/:*}"
182 pagecount="${alloc/*:}"
183 einfo " ${pagecount} @ ${pagesize}"
184 src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
185 done
186
187 # ---------------------------------------------------------
188 # --------- die is safe again after this point. -----------
189 # ---------------------------------------------------------
190
191 return $rc
192 }