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

Diff of /sys-kernel/linux-extras/linux-extras-2.4.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.5
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# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp
5
6#OKV=original kernel version, KV=patched kernel version
7
8OKV=2.4.6
9KV=2.4.6
10S=${WORKDIR}/linux-${KV}
11S2=${WORKDIR}/linux-${KV}-extras
12if [ $PN = "linux-extras" ]
13then
14 KS=/usr/src/linux-${KV}
15 KS2=/usr/src/linux-${KV}-extras
16else
17 KS=${S}
18 KS2=${S2}
19fi
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 Production-ready
26# ext3 Y ext3 Production-ready
27# MOSIX Y mosix Testing only
28# XFS N xfs Will add soon
29# PCMCIA-CS Y pcmcia Need to move this to its own ebuild
30# ALSA N alsa Need to move this to its own ebuild
31# lm-sensors N lm_sensors Need to move this to its own ebuild
32
33LVMV=0.9.1_beta7
34EXT3V=2.4-0.9.1-246
35MOSV=1.0.5
36# AV=0.5.11
37#JFSV=1.0.0
38#KNV="6.g"
39#PIV="1.d"
40PCV="3.1.27"
41
42[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
43[ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
44[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
45
46# We use build in /usr/src/linux in case of linux-extras
47# so we need no sources
48if [ ! "${PN}" = "linux-extras" ] ; then
49SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
50 http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz
51 http://www.zip.com.au/~akpm/ext3-${EXT3V}.gz
52 http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-1.0.0-patch.tar.gz
53 ftp://ftp.cs.huji.ac.il/users/mosix/MOSIX-${MOSV}.tar.gz"
54 ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMV}.tar.gz
55fi
56# http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz
57# http://www.netroedge.com/~lm78/archive/i2c-${SENV}.tar.gz
58# ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2
59
60if [ "$PN" != "linux-extras" ]
61then
62 PROVIDE="virtual/kernel"
63fi
64#if [ "$PN" != "linux-sources" ]
65#then
66# if [ "`use alsa`" ]
67# then
68# PROVIDE="$PROVIDE virtual/alsa"
69# fi
70#fi
71
72HOMEPAGE="http://www.kernel.org/
73 http://www.netroedge.com/~lm78/
74 http://www.namesys.com
75 http://www.sistina.com/lvm/
76 http://pcmcia-cs.sourceforge.net"
77
78
79#these deps are messed up; fix 'em and add ncurses (required my mosix compile, menuconfig)
80if [ $PN != "linux-extras" ] ; then
81 RDEPEND=">=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
82 DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
83else
84 DEPEND=">=sys-kernel/${PF/extras/sources}"
85fi
86if [ "`use build`" ] && [ $PN = "linux-sources" ] ; then
87 DEPEND=""
88 RDEPEND=""
89fi
90
91# this is not pretty...
92LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
93
94src_unpack() {
95
96 # We only need to unpack for linux and linux-sources
97
98 if [ ! "$PN" = "linux-extras" ]
99 then
100
101 #unpack kernel and apply reiserfs-related patches
102 cd ${WORKDIR}
103 unpack linux-${OKV}.tar.bz2
104 try mv linux linux-${KV}
105 cd ${S}
106# echo "Applying ${KV} patch..."
107# try bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1
108
109# This patch is just *too* unweildy and creates tons of rejects all over the place (boo!)
110# echo "Applying XFS patch..."
111# local x
112# for x in easy only tricky acl-extattr misc
113# do
114# cat ${DISTDIR}/patch-2.4.6-xfs-${x}.bz2 | bzip2 -d | patch -p1
115# done
116
117 dodir /usr/src/linux-${KV}-extras
118
119 if [ "`use mosix`" ]
120 then
121 echo "Applying MOSIX patch..."
122 cd ${S2}
123 mkdir MOSIX-${MOSV}
124 cd MOSIX-${MOSV}
125 unpack MOSIX-${MOSV}.tar.gz
126 cd ${S}
127 try cat ${S2}/MOSIX-${MOSV}/patches.2.4.6 | patch -p0
128 tar -x --no-same-owner -vf ${S2}/MOSIX-${MOSV}/kernel.new.2.4.6.tar
129 cd ${S2}
130 mkdir user
131 tar -x --no-same-owner -vf user.tar -C user
132 rm user.tar
133 fi
134
135 cd ${S}
136 echo "Applying reiserfs-NFS fix..."
137 try cat ${FILESDIR}/2.4.6/linux-2.4.6-reiserfs-NFS.patch | patch -N -p1
138
139 if [ "`use lvm`" ]
140 then
141 #create and apply LVM patch. The tools get built later.
142 cd ${S2}
143 echo "Unpacking and applying LVM patch..."
144 unpack lvm_${LVMV}.tar.gz
145 try cd LVM/${LVMV}
146
147 # I had to hack this in so that LVM will look in the current linux
148 # source directory instead of /usr/src/linux for stuff - pete
149 try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
150 cd PATCHES
151 try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
152 cd ${S}
153 # the -l option allows this patch to apply cleanly (ignore whitespace changes)
154 try patch -l -p1 < ${S2}/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
155 cd ${S}/drivers/md
156 try patch -p0 < ${FILESDIR}/${KV}/lvm.c.diff
157 fi
158
159# if [ "`use alsa`" ]
160# then
161# #unpack alsa drivers
162# echo "Unpacking ALSA drivers..."
163# cd ${S}/extras
164# unpack alsa-driver-${AV}.tar.bz2
165# fi
166
167# if [ "`use lm_sensors`" ]
168# then
169# #unpack and apply the lm_sensors patch
170# echo "Unpacking and applying lm_sensors patch..."
171# cd ${S}/extras
172# unpack lm_sensors-${SENV}.tar.gz
173# unpack i2c-${SENV}.tar.gz
174# try cd i2c-${SENV}
175# try rmdir src
176# try ln -s ../.. src
177# try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
178# cp Makefile Makefile.orig
179# try sed -e \"s:^LINUX=.*:LINUX=src:\" \
180# -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
181# -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
182# -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
183# -e \"s#^PREFIX.*#PREFIX := /usr#\" \
184# -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
185# Makefile.orig > Makefile
186# try cd ${S}/extras/lm_sensors-${SENV}
187# try rmdir src
188# try ln -s ../.. src
189# try ln -s ../i2c-${SENV} i2c-src
190# try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
191# try sed -e \"s:^LINUX=.*:LINUX=src:\" \
192# -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
193# -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
194# -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
195# -e \"s#^PREFIX.*#PREFIX := /usr#\" \
196# -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
197# Makefile.orig > Makefile
198# fi
199 if [ "`use pcmcia-cs`" ]
200 then
201 echo "Unpacking pcmcia-cs tools..."
202 cd ${S2}
203 unpack pcmcia-cs-${PCV}.tar.gz
204 # patch -p0 < ${FILESDIR}/${KV}/pcmcia-cs-${PCV}-gentoo.diff
205 fi
206
207 #JFS patch works; commented out because it's not ready for production use
208 #if [ "`use jfs`" ]
209 #then
210 # echo "Applying JFS patch..."
211 # cd ${WORKDIR}
212 # unpack jfs-${JFSV}-patch.tar.gz
213 # cd ${S}
214 # patch -p1 < ${WORKDIR}/jfs-common-v1.0.0-patch
215 # patch -p1 < ${WORKDIR}/jfs-2.4.5-v1.0.0-patch
216 #fi
217
218 if [ "`use ext3`" ]
219 then
220 echo "Applying ext3 patch..."
221 if [ "`use mosix`" ]
222 then
223 echo
224 echo "There will be one reject; we will fix it. (no worries)"
225 echo
226 fi
227 cd ${S}
228 gzip -dc ${DISTDIR}/ext3-${EXT3V}.gz | patch -l -p1
229 if [ "`use mosix`" ]
230 then
231 echo
232 echo "Fixing reject in include/linux/sched.h..."
233 echo
234 cp ${FILESDIR}/${KV}/sched.h include/linux
235 fi
236 fi
237
238 #get sources ready for compilation or for sitting at /usr/src/linux
239 echo "Preparing for compilation..."
240 cd ${S}
241 #sometimes we have icky kernel symbols; this seems to get rid of them
242 try make mrproper
243
244 #linux-sources needs to be fully configured, too. Not just linux
245 if [ "${PN}" != "linux-extras" ]
246 then
247 #this is the configuration for the default kernel
248 try cp ${FILESDIR}/${KV}/config.bootcd .config
249 try yes \"\" \| make oldconfig
250 echo "Ignore any errors from the yes command above."
251 fi
252
253 #fix silly permissions in tarball
254 cd ${WORKDIR}
255 chown -R 0.0 ${S}
256 chmod -R a+r-w+X,u+w ${S}
257
258 fi
259}
260
261src_compile() {
262 if [ "${PN}" != "linux-sources" ]
263 then
264 if [ $PN = "linux" ]
265 then
266 try make symlinks
267 fi
268 if [ "`use lvm`" ]
269 then
270 #LVM tools are included in the linux and linux-extras pakcages
271 cd ${KS2}/LVM/${LVMV}
272
273 # This is needed for linux-extras
274 if [ -f "Makefile" ]
275 then
276 try make clean
277 fi
278 # I had to hack this in so that LVM will look in the current linux
279 # source directory instead of /usr/src/linux for stuff - pete
280 try CFLAGS=\""${CFLAGS} -I${KS}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}"
281 try make
282 fi
283
284# if [ "`use lm_sensors`" ]
285# then
286# cd ${KS}/extras/lm_sensors-${SENV}
287# try make
288# fi
289
290# Works, just commented out because JFS isn't ready to be used by non-developers
291# if [ "`use jfs`" ]
292# then
293# cd ${S}/fs/jfs/utils
294# try make
295# cd output
296# into /
297# dosbin *
298# doman `find -iname *.8`
299# fi
300
301 if [ "$PN" == "linux" ]
302 then
303 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
304 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" bzImage
305 #LEX=\""flex -l"\" bzImage
306 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" modules
307 #LEX=\""flex -l"\" modules
308 fi
309
310#This is moving into its own package RSN
311# This must come after the kernel compilation in linux
312# if [ "`use alsa`" ]
313# then
314# cd ${KS}/extras/alsa-driver-${AV}
315# # This is needed for linux-extras
316# if [ -f "Makefile.conf" ]
317# then
318# try make clean
319# fi
320# try ./configure --with-kernel=\"${KS}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
321# try make
322# fi
323
324 if [ "`use mosix`" ]
325 then
326 cd ${KS2}/MOSIX-${MOSV}
327 local x
328 for x in lib/moslib sbin/setpe sbin/tune bin/mosrun usr.bin/mon usr.bin/migrate usr.bin/mosctl
329 do
330 cd $x
331 make
332 cd ../..
333 done
334 fi
335
336 if [ "`use pcmcia-cs`" ]
337 then
338 cd ${KS2}/pcmcia-cs-${PCV}
339 # This is needed for linux-extras
340 if [ -f "Makefile" ]
341 then
342 try make clean
343 fi
344 try ./Configure -n --kernel=${KS} --moddir=/lib/modules/${KV} \
345 --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
346 try make all
347 fi
348 else
349 #linux-sources
350 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
351 fi
352}
353
354src_install() {
355 # We install the alsa headers in all three packages
356# if [ "`use alsa`" ]
357# then
358# #i get alsa includes
359# cd ${KS}/extras/alsa-driver-${AV}
360# insinto /usr/src/linux-${KV}/include/linux
361# cd include
362# doins asound.h asoundid.h asequencer.h ainstr_*.h
363# fi
364
365 if [ ! "${PN}" = "linux-sources" ]
366 then
367 dodir /usr/lib
368
369 if [ "`use mosix`" ]
370 then
371 cd ${KS2}/MOSIX-${MOSV}
372 dodir /usr/lib /usr/include
373 dolib.a libmos.a
374 dolib.so libmos.so.0
375 ln -s libmos.so.0 ${D}/usr/lib/libmos.so
376 insinto /usr/include
377 doins *.h
378
379 cd ../../sbin/setpe
380 doman setpe.1
381 into /
382 dosbin setpe
383
384 cd ../tune
385 dosbin tune mtune tunepass tune_kernel prep_tune
386 doman tune.1
387
388 cd ../../bin/mosrun
389 dobin mosrun nomig runhome runon cpujob iojob nodecay slowdecay fastdecay
390 doman mosrun.1
391 local x
392 for x in nomig runhome runon cpujob iojob nodecay slowdecay fastdecay
393 do
394 ln -s mosrun.1.gz ${D}/usr/share/man/man1/${x}.1.gz
395 done
396
397 cd ../../usr.bin/mon
398 into /usr
399 dobin mon
400 doman mon.1
401
402 cd ../migrate
403 dobin migrate
404 doman migrate.1
405
406 cd ../mosctl
407 dobin mosctl
408 doman mosctl.1
409
410 exeinto /etc/rc.d/init.d
411 newexe ${FILESDIR}/${KV}/mosix.init mosix
412
413 cd ${KS2}/MOSIX-${MOSV}
414 for x in lib/moslib sbin/setpe sbin/tune bin/mosrun usr.bin/mon usr.bin/migrate usr.bin/mosctl
415 do
416 cd ${x}
417 make clean
418 cd ../..
419 done
420 fi
421
422 if [ "`use lvm`" ]
423 then
424 cd ${KS2}/LVM/${LVMV}/tools
425
426 try CFLAGS=\""${CFLAGS} -I${KS}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \
427 sbindir=${D}/sbin libdir=${D}/lib
428 #no need for a static library in /lib
429 mv ${D}/lib/*.a ${D}/usr/lib
430 fi
431
432# if [ "`use lm_sensors`" ]
433# then
434# echo "Install sensor tools..."
435# #install sensors tools
436# cd ${KS}/extras/lm_sensors-${SENV}
437# make install
438# fi
439
440 if [ "${PN}" = "linux" ]
441 then
442 dodir /usr/src
443 dodir /usr/src/linux-${KV}
444 cd ${D}/usr/src
445 #grab includes and documentation only
446 echo ">>> Copying includes and documentation..."
447 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
448 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
449
450 #grab compiled kernel
451 dodir /boot/boot
452 insinto /boot/boot
453 cd ${S}
454 doins arch/i386/boot/bzImage
455
456 #grab modules
457 # Do we have a bug in modutils ?
458 # Meanwhile we use this quick fix (achim)
459
460 install -d ${D}/lib/modules/`uname -r`
461 try make INSTALL_MOD_PATH=${D} modules_install
462
463 depmod -b ${D} -F ${S}/System.map ${KV}
464 #rm -rf ${D}/lib/modules/`uname -r`
465 #fix symlink
466 cd ${D}/lib/modules/${KV}
467 rm build
468 ln -sf /usr/src/linux-${KV} build
469 fi
470
471# if [ "`use alsa`" ]
472# then
473# #install ALSA modules
474# cd ${KS}/extras/alsa-driver-${AV}
475# dodoc INSTALL FAQ
476# dodir /lib/modules/${KV}/misc
477# cp modules/*.o ${D}/lib/modules/${KV}/misc
478# fi
479 if [ "`use pcmcia-cs`" ]
480 then
481 #install PCMCIA modules and utilities
482 cd ${KS2}/pcmcia-cs-${PCV}
483 try make PREFIX=${D} MANDIR=${D}/usr/share/man install
484 rm -rf ${D}/etc/rc.d
485 exeinto /etc/rc.d/init.d
486 doexe ${FILESDIR}/${KV}/pcmcia
487 fi
488 else
489 dodir /usr/src
490 cd ${S}
491 #make mrproper
492
493 if [ "`use build`" ] ; then
494 dodir /usr/src/linux-${KV}
495 #grab includes and documentation only
496 echo ">>> Copying includes..."
497 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
498 else
499 echo ">>> Copying sources..."
500 cp -ax ${S} ${D}/usr/src
501 fi
502 fi
503 if [ "$PN" != "linux-extras" ]
504 then
505 #don't overwrite existing .config if present
506 cd ${D}/usr/src/linux-${KV}
507 if [ -e .config ]
508 then
509 cp -a .config .config.eg
510 fi
511 fi
512}
513
514pkg_postinst() {
515 rm -f ${ROOT}/usr/src/linux
516 ln -sf linux-${KV} ${ROOT}/usr/src/linux
517
518 #copy over our .config if one isn't already present
519 cd ${ROOT}/usr/src/linux-${KV}
520 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
521 then
522 cp -a .config.eg .config
523 fi
524}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20