/[gentoo-x86]/sys-kernel/linux-extras/linux-extras-2.4.8.8.ebuild
Gentoo

Contents of /sys-kernel/linux-extras/linux-extras-2.4.8.8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Aug 22 21:36:53 2001 UTC (18 years, 7 months ago) by drobbins
Branch: MAIN
lots of new stuff

1 # Copyright 1999-2000 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License, v2 or later
3 # Author Daniel Robbins <drobbins@gentoo.org>
4 # $Header: /home/cvsroot/gentoo-x86/sys-kernel/linux-sources/linux-sources-2.4.6-r3.ebuild,v 1.1 2001/08/13 22:04:18 drobbins Exp $
5
6 #OKV=original kernel version, KV=patched kernel version
7
8 OKV=2.4.8
9 KV=2.4.8-ac8
10 S=${WORKDIR}/linux-${KV}
11 S2=${WORKDIR}/linux-${KV}-extras
12 if [ $PN = "linux-extras" ]
13 then
14 KS=${ROOT}usr/src/linux-${KV}
15 KS2=${ROOT}usr/src/linux-${KV}-extras
16 else
17 KS=${S}
18 KS2=${S2}
19 fi
20
21 # Kernel Features Enabled USE Variable Status
22 #
23 # Reiserfs Y - Production-ready
24 # JFS N jfs Testing-only (commented out for now)
25 # LVM Y lvm almost production-ready (still has race conditions during pvmove)
26 # ext3 Y ext3 Production-ready
27 # MOSIX Y mosix Testing only
28 # XFS N xfs Will add soon
29 # PCMCIA-CS N pcmcia Need to move this to its own ebuild
30 # lm-sensors N lm_sensors Need to move this to its own ebuild
31
32 LVMV=1.0.1-rc1
33 #EXT3V=2.4-0.9.2-246
34 #MOSV=1.1.2
35 CLOOPV=0.61
36 CLOOPAV=0.61-1
37 # AV=0.5.11
38 #JFSV=1.0.0
39 #KNV="6.g"
40 #PIV="1.d"
41 #PCV="3.1.27"
42
43 [ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
44 [ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
45 [ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
46
47 # We use build in /usr/src/linux in case of linux-extras
48 # so we need no sources
49 if [ ! "${PN}" = "linux-extras" ] ; then
50 SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
51 http://www.kernel.org/pub/linux/kernel/people/alan/linux-2.4/${OKV}/patch-${KV}.bz2
52 ftp://ftp.sistina.com/pub/LVM/1.0/lvm_${LVMV}.tar.gz
53 http://www.knopper.net/download/knoppix/cloop_${CLOOPAV}.tar.gz"
54 fi
55 # http://www.zip.com.au/~akpm/ext3-${EXT3V}.gz
56 # http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-1.0.0-patch.tar.gz
57 # ftp://ftp.cs.huji.ac.il/users/mosix/MOSIX-${MOSV}.tar.gz
58 # http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz
59 # http://www.netroedge.com/~lm78/archive/i2c-${SENV}.tar.gz
60 # http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz
61
62 if [ "$PN" != "linux-extras" ]
63 then
64 PROVIDE="virtual/kernel"
65 fi
66
67 HOMEPAGE="http://www.kernel.org/
68 http://www.namesys.com
69 http://www.sistina.com/lvm/"
70
71 DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
72 #these deps are messed up; fix 'em and add ncurses (required my mosix compile, menuconfig)
73 if [ $PN = "linux" ]
74 then
75 # RDEPEND="mosix? ( ~sys-apps/mosix-user-${MOSV} ) >=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
76 RDEPEND=">=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
77 elif [ $PN = "linux-sources" ]
78 then
79 if [ "`use build`" ]
80 then
81 DEPEND=""
82 RDEPEND=""
83 else
84 #ncurses is required for "make menuconfig"
85 RDEPEND=">=sys-libs/ncurses-5.2"
86 fi
87 elif [ $PN = "linux-extras" ]
88 then
89 #linux-extras/headers requires a rev of the current kernel sources to be installed
90 RDEPEND="~sys-kernel/linux-sources-${PV}"
91 elif [ $PN = "linux-headers" ]
92 then
93 DEPEND=""
94 RDEPEND=""
95 fi
96
97 # this is not pretty...
98 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${KS}/include"
99
100 src_unpack() {
101 if [ "$PN" = "linux-extras" ]
102 then
103 return
104 fi
105
106 mkdir ${S2}
107
108 #unpack kernel and apply reiserfs-related patches
109 cd ${WORKDIR}
110 unpack linux-${OKV}.tar.bz2
111 try mv linux linux-${KV}
112 cd ${S}
113 if [ "$KV" != "$OKV" ]
114 then
115 echo "Applying ${KV} patch..."
116 bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1 || die
117 fi
118 dodir /usr/src/linux-${KV}-extras
119
120 #### Mosix
121 # if [ "`use mosix`" ]
122 # then
123 # echo "Applying MOSIX patch..."
124 # cd ${S2}
125 # mkdir MOSIX-${MOSV}
126 # cd MOSIX-${MOSV}
127 # tar xzf MOSIX-${MOSV}.tar.gz patches.${OKV} kernel.new.${OKV}.tar
128 # cd ${S}
129 # try cat ${S2}/MOSIX-${MOSV}/patches.${KV} | patch -p0
130 # tar -x --no-same-owner -vf ${S2}/MOSIX-${MOSV}/kernel.new.${KV}.tar
131 # fi
132 #### Mosix
133 if [ "`use lvm`" ]
134 then
135 #create and apply LVM patch. The tools get built later.
136 cd ${S2}
137 echo "Unpacking and applying LVM patch..."
138 unpack lvm_${LVMV}.tar.gz
139 cd LVM/${LVMV}
140
141 # I had to hack this in so that LVM will look in the current linux
142 # source directory instead of /usr/src/linux for stuff - pete
143 CFLAGS="${CFLAGS} -I${S}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}" || die
144 cd PATCHES
145 make KERNEL_VERSION=${KV} KERNEL_DIR=${S} || die
146 cd ${S}
147 # the -l option allows this patch to apply cleanly (ignore whitespace changes)
148 # the -N option is an "auto no" to previously applied stuff. Needed for 2.4.8-ac8
149 patch -N -l -p1 < ${S2}/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
150 #|| die
151 #we removed || die because any stuff that hits -N causes an error code of 1
152 fi
153
154 # if [ "`use lm_sensors`" ]
155 # then
156 # #unpack and apply the lm_sensors patch
157 # echo "Unpacking and applying lm_sensors patch..."
158 # cd ${S}/extras
159 # unpack lm_sensors-${SENV}.tar.gz
160 # unpack i2c-${SENV}.tar.gz
161 # cd i2c-${SENV}
162 # try rmdir src
163 # try ln -s ../.. src
164 # try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
165 # cp Makefile Makefile.orig
166 # try sed -e \"s:^LINUX=.*:LINUX=src:\" \
167 # -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
168 # -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
169 # -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
170 # -e \"s#^PREFIX.*#PREFIX := /usr#\" \
171 # -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
172 # Makefile.orig > Makefile
173 # cd ${S}/extras/lm_sensors-${SENV}
174 # try rmdir src
175 # try ln -s ../.. src
176 # try ln -s ../i2c-${SENV} i2c-src
177 # try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
178 # try sed -e \"s:^LINUX=.*:LINUX=src:\" \
179 # -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
180 # -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
181 # -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
182 # -e \"s#^PREFIX.*#PREFIX := /usr#\" \
183 # -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
184 # Makefile.orig > Makefile
185 # fi
186 # if [ "`use pcmcia-cs`" ]
187 # then
188 # echo "Unpacking pcmcia-cs tools..."
189 # cd ${S2}
190 # unpack pcmcia-cs-${PCV}.tar.gz
191 # patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff
192 # fi
193
194 #JFS patch works; commented out because it's not ready for production use
195 #if [ "`use jfs`" ]
196 #then
197 # echo "Applying JFS patch..."
198 # cd ${WORKDIR}
199 # unpack jfs-${JFSV}-patch.tar.gz
200 # cd ${S}
201 # patch -p1 < ${WORKDIR}/jfs-common-v1.0.0-patch
202 # patch -p1 < ${WORKDIR}/jfs-2.4.5-v1.0.0-patch
203 #fi
204
205 # if [ "`use ext3`" ]
206 # then
207 # echo "Applying ext3 patch..."
208 ### Mosix
209 # if [ "`use mosix`" ]
210 # then
211 # echo
212 # echo "There will be one reject; we will fix it. (no worries)"
213 # echo
214 # fi
215 ### Mosix
216 # cd ${S}
217 # gzip -dc ${DISTDIR}/ext3-${EXT3V}.gz | patch -l -p1
218 ### Mosix
219 # if [ "`use mosix`" ]
220 # then
221 # echo
222 # echo "Fixing reject in include/linux/sched.h..."
223 # echo
224 # cp ${FILESDIR}/${PVR}/sched.h include/linux
225 # fi
226 ### Mosix
227 # fi
228
229 cd ${S2}
230 unpack cloop_${CLOOPAV}.tar.gz
231
232 #get sources ready for compilation or for sitting at /usr/src/linux
233 echo "Preparing for compilation..."
234 cd ${S}
235 #sometimes we have icky kernel symbols; this seems to get rid of them
236 try make mrproper
237
238 #linux-sources needs to be fully configured, too. Not just linux
239 #this is the configuration for the default kernel
240 try cp ${FILESDIR}/${PVR}/config.bootcd .config
241 yes "" | make oldconfig
242 echo "Ignore any errors from the yes command above."
243
244 #fix silly permissions in tarball
245 cd ${WORKDIR}
246 chown -R 0.0 *
247 chmod -R a+r-w+X,u+w *
248 }
249
250 src_compile() {
251 if [ "${PN}" = "linux-sources" ] || [ "${PN}" = "linux-headers" ]
252 then
253 cd ${KS}
254 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep
255 else
256 if [ $PN = "linux" ]
257 then
258 cd ${KS}
259 try make symlinks
260 fi
261 if [ "`use lvm`" ]
262 then
263 #LVM tools are included in the linux and linux-extras pakcages
264 cd ${KS2}/LVM/${LVMV}
265
266 # This is needed for linux-extras
267 if [ -f "Makefile" ]
268 then
269 try make clean
270 fi
271 # I had to hack this in so that LVM will look in the current linux
272 # source directory instead of /usr/src/linux for stuff - pete
273 CFLAGS="${CFLAGS} -I${KS}/include" try ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}"
274 try make
275 fi
276
277 # if [ "`use lm_sensors`" ]
278 # then
279 # cd ${KS}/extras/lm_sensors-${SENV}
280 # try make
281 # fi
282
283 # Works, just commented out because JFS isn't ready to be used by non-developers
284 # if [ "`use jfs`" ]
285 # then
286 # cd ${S}/fs/jfs/utils
287 # try make
288 # cd output
289 # into /
290 # dosbin *
291 # doman `find -iname *.8`
292 # fi
293
294 if [ "$PN" == "linux" ]
295 then
296 cd ${KS}
297 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep
298 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage
299 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules
300 fi
301
302 # if [ "`use pcmcia-cs`" ]
303 # then
304 # cd ${KS2}/pcmcia-cs-${PCV}
305 # # This is needed for linux-extras
306 # if [ -f "Makefile" ]
307 # then
308 # try make clean
309 # fi
310 # try ./Configure -n --kernel=${KS} --moddir=/lib/modules/${KV} \
311 # --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
312 # try make all
313 # fi
314
315 cd ${KS2}/cloop-${CLOOPV}
316 make KERNEL_DIR=${KS}
317 fi
318 }
319
320 src_install() {
321 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
322 then
323 dodir /usr/lib
324
325 if [ "`use lvm`" ]
326 then
327 cd ${KS2}/LVM/${LVMV}/tools
328
329 CFLAGS="${CFLAGS} -I${KS}/include" try make install -e prefix=${D} mandir=${D}/usr/share/man \
330 sbindir=${D}/sbin libdir=${D}/lib
331 #no need for a static library in /lib
332 mv ${D}/lib/*.a ${D}/usr/lib
333 fi
334
335 # if [ "`use lm_sensors`" ]
336 # then
337 # echo "Install sensor tools..."
338 # #install sensors tools
339 # cd ${KS}/extras/lm_sensors-${SENV}
340 # make install
341 # fi
342
343 if [ "${PN}" = "linux" ]
344 then
345 dodir /usr/src/linux-${KV}
346 cd ${D}/usr/src
347 #grab includes and documentation only
348 echo ">>> Copying includes and documentation..."
349 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
350 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
351
352 #grab compiled kernel
353 dodir /boot/boot
354 insinto /boot/boot
355 cd ${S}
356 doins arch/i386/boot/bzImage
357
358 #grab modules
359 # Do we have a bug in modutils ?
360 # Meanwhile we use this quick fix (achim)
361
362 install -d ${D}/lib/modules/`uname -r`
363 try make INSTALL_MOD_PATH=${D} modules_install
364
365 cd ${S}
366 depmod -b ${D} -F ${S}/System.map ${KV}
367 #rm -rf ${D}/lib/modules/`uname -r`
368 #fix symlink
369 cd ${D}/lib/modules/${KV}
370 rm build
371 ln -sf /usr/src/linux-${KV} build
372 fi
373
374 # if [ "`use pcmcia-cs`" ]
375 # then
376 # #install PCMCIA modules and utilities
377 # cd ${KS2}/pcmcia-cs-${PCV}
378 # try make PREFIX=${D} MANDIR=${D}/usr/share/man install
379 # rm -rf ${D}/etc/rc.d
380 # exeinto /etc/rc.d/init.d
381 # doexe ${FILESDIR}/${KV}/pcmcia
382 # fi
383
384 cd ${KS2}/cloop-${CLOOPV}
385 insinto /lib/modules/${KV}/kernel/drivers/block
386 doins cloop.o
387 into /usr
388 dobin create_compressed_fs extract_compressed_fs
389
390 if [ "`use bootcd`" ]
391 then
392 rm -rf ${D}/usr/include ${D}/usr/lib/lib*.a ${D}/usr/src
393 fi
394
395 elif [ "$PN" = "linux-sources" ]
396 then
397 dodir /usr/src
398 cd ${S}
399
400 if [ "`use build`" ] ; then
401
402 #if we install linux-sources in "build" mode, then only kernel headers
403 #are installed. And they are installed to /usr/include as system defaults
404 #rather than to /usr/src/linux-${KV}
405
406 dodir /usr/include/linux
407 dodir /usr/include/asm
408 #grab includes and documentation only
409 echo ">>> Copying includes to /usr/include..."
410 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
411 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
412 else
413 echo ">>> Copying sources..."
414 cp -ax ${WORKDIR}/* ${D}/usr/src
415 fi
416 elif [ "$PN" = "linux-headers" ]
417 then
418 #the linux-headers package basically takes a "snapshot" of your current linux headers
419 dodir /usr/include/linux
420 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
421 dodir /usr/include/asm
422 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
423 fi
424 if [ -d ${D}/usr/src/linux-${KV} ]
425 then
426 #don't overwrite existing .config if present
427 cd ${D}/usr/src/linux-${KV}
428 if [ -e .config ]
429 then
430 cp -a .config .config.eg
431 fi
432 fi
433 }
434
435 pkg_preinst() {
436 if [ "$PN" = "linux-headers" ]
437 then
438 if [ -L ${ROOT}usr/include/linux ]
439 then
440 rm ${ROOT}usr/include/linux
441 fi
442 if [ -L ${ROOT}usr/include/asm ]
443 then
444 rm ${ROOT}usr/include/asm
445 fi
446 fi
447 }
448
449 pkg_postinst() {
450 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
451 then
452 return
453 fi
454 rm -f ${ROOT}/usr/src/linux
455 ln -sf linux-${KV} ${ROOT}/usr/src/linux
456
457 #copy over our .config if one isn't already present
458 cd ${ROOT}/usr/src/linux-${KV}
459 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
460 then
461 cp -a .config.eg .config
462 fi
463 }

  ViewVC Help
Powered by ViewVC 1.1.20