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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Jul 11 07:06:10 2001 UTC (18 years, 7 months ago) by drobbins
Branch: MAIN
linux-extras-2.4.6

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

  ViewVC Help
Powered by ViewVC 1.1.20