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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Fri Oct 12 03:59:47 2001 UTC (18 years, 3 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
massive cleanup

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-extras/linux-extras-2.4.6-r2.ebuild,v 1.9 2001/08/08 01:03:33 pete Exp $
5
6 #OKV=original kernel version, KV=patched kernel version
7
8 OKV=2.4.6
9 KV=2.4.6
10 S=${WORKDIR}/linux-${KV}
11 S2=${WORKDIR}/linux-${KV}-extras
12 if [ $PN = "linux-extras" ] || [ $PN = "linux-headers" ]
13 then
14 KS=/usr/src/linux-${KV}
15 KS2=/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=0.9.1_beta7
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.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.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMV}.tar.gz
54 http://www.knopper.net/download/knoppix/cloop_${CLOOPAV}.tar.gz"
55 fi
56 # ftp://ftp.cs.huji.ac.il/users/mosix/MOSIX-${MOSV}.tar.gz
57 # http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz
58 # http://www.netroedge.com/~lm78/archive/i2c-${SENV}.tar.gz
59 # http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz
60
61 if [ "$PN" != "linux-extras" ]
62 then
63 PROVIDE="virtual/kernel"
64 fi
65
66 HOMEPAGE="http://www.kernel.org/
67 http://www.netroedge.com/~lm78/
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" ] || [ $PN = "linux-headers" ]
88 then
89 #linux-extras/headers requires a rev of the current kernel sources to be installed
90 DEPEND="~sys-kernel/linux-sources-${PV}"
91 fi
92
93 # this is not pretty...
94 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${KS}/include"
95
96 src_unpack() {
97 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
98 then
99 return
100 fi
101
102 mkdir ${S2}
103
104 #unpack kernel and apply reiserfs-related patches
105 cd ${WORKDIR}
106 unpack linux-${OKV}.tar.bz2
107 try mv linux linux-${KV}
108 cd ${S}
109 if [ "$KV" != "$OKV" ]
110 then
111 echo "Applying ${KV} patch..."
112 try bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1
113 fi
114 # This patch is just *too* unweildy and creates tons of rejects all over the place (boo!)
115 # echo "Applying XFS patch..."
116 # local x
117 # for x in easy only tricky acl-extattr misc
118 # do
119 # cat ${DISTDIR}/patch-2.4.6-xfs-${x}.bz2 | bzip2 -d | patch -p1
120 # done
121
122 dodir /usr/src/linux-${KV}-extras
123
124 #### Mosix
125 # if [ "`use mosix`" ]
126 # then
127 # echo "Applying MOSIX patch..."
128 # cd ${S2}
129 # mkdir MOSIX-${MOSV}
130 # cd MOSIX-${MOSV}
131 # tar xzf MOSIX-${MOSV}.tar.gz patches.${OKV} kernel.new.${OKV}.tar
132 # cd ${S}
133 # try cat ${S2}/MOSIX-${MOSV}/patches.${KV} | patch -p0
134 # tar -x --no-same-owner -vf ${S2}/MOSIX-${MOSV}/kernel.new.${KV}.tar
135 # fi
136 #### Mosix
137
138 cd ${S}
139 echo "Applying reiserfs-NFS fix..."
140 try cat ${FILESDIR}/${PVR}/linux-${KV}-reiserfs-NFS.patch | patch -N -p1
141
142 if [ "`use lvm`" ]
143 then
144 #create and apply LVM patch. The tools get built later.
145 cd ${S2}
146 echo "Unpacking and applying LVM patch..."
147 unpack lvm_${LVMV}.tar.gz
148 cd LVM/${LVMV}
149
150 # I had to hack this in so that LVM will look in the current linux
151 # source directory instead of /usr/src/linux for stuff - pete
152 CFLAGS="${CFLAGS} -I${S}/include" try ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
153 cd PATCHES
154 try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
155 cd ${S}
156 # the -l option allows this patch to apply cleanly (ignore whitespace changes)
157 try patch -l -p1 < ${S2}/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
158 cd ${S}/drivers/md
159 try patch -p0 < ${FILESDIR}/${PVR}/lvm.c.diff
160 fi
161
162 # if [ "`use lm_sensors`" ]
163 # then
164 # #unpack and apply the lm_sensors patch
165 # echo "Unpacking and applying lm_sensors patch..."
166 # cd ${S}/extras
167 # unpack lm_sensors-${SENV}.tar.gz
168 # unpack i2c-${SENV}.tar.gz
169 # cd i2c-${SENV}
170 # try rmdir src
171 # try ln -s ../.. src
172 # try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
173 # cp Makefile Makefile.orig
174 # try sed -e \"s:^LINUX=.*:LINUX=src:\" \
175 # -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
176 # -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
177 # -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
178 # -e \"s#^PREFIX.*#PREFIX := /usr#\" \
179 # -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
180 # Makefile.orig > Makefile
181 # cd ${S}/extras/lm_sensors-${SENV}
182 # try rmdir src
183 # try ln -s ../.. src
184 # try ln -s ../i2c-${SENV} i2c-src
185 # try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
186 # try sed -e \"s:^LINUX=.*:LINUX=src:\" \
187 # -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
188 # -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
189 # -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
190 # -e \"s#^PREFIX.*#PREFIX := /usr#\" \
191 # -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
192 # Makefile.orig > Makefile
193 # fi
194 # if [ "`use pcmcia-cs`" ]
195 # then
196 # echo "Unpacking pcmcia-cs tools..."
197 # cd ${S2}
198 # unpack pcmcia-cs-${PCV}.tar.gz
199 # patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff
200 # fi
201
202 #JFS patch works; commented out because it's not ready for production use
203 #if [ "`use jfs`" ]
204 #then
205 # echo "Applying JFS patch..."
206 # cd ${WORKDIR}
207 # unpack jfs-${JFSV}-patch.tar.gz
208 # cd ${S}
209 # patch -p1 < ${WORKDIR}/jfs-common-v1.0.0-patch
210 # patch -p1 < ${WORKDIR}/jfs-2.4.5-v1.0.0-patch
211 #fi
212
213 if [ "`use ext3`" ]
214 then
215 echo "Applying ext3 patch..."
216 ### Mosix
217 # if [ "`use mosix`" ]
218 # then
219 # echo
220 # echo "There will be one reject; we will fix it. (no worries)"
221 # echo
222 # fi
223 ### Mosix
224 cd ${S}
225 gzip -dc ${DISTDIR}/ext3-${EXT3V}.gz | patch -l -p1
226 ### Mosix
227 # if [ "`use mosix`" ]
228 # then
229 # echo
230 # echo "Fixing reject in include/linux/sched.h..."
231 # echo
232 # cp ${FILESDIR}/${PVR}/sched.h include/linux
233 # fi
234 ### Mosix
235 fi
236
237 cd ${S2}
238 unpack cloop_${CLOOPAV}.tar.gz
239
240 #get sources ready for compilation or for sitting at /usr/src/linux
241 echo "Preparing for compilation..."
242 cd ${S}
243 #sometimes we have icky kernel symbols; this seems to get rid of them
244 try make mrproper
245
246 #linux-sources needs to be fully configured, too. Not just linux
247 #this is the configuration for the default kernel
248 try cp ${FILESDIR}/${PVR}/config.bootcd .config
249 yes "" | make oldconfig
250 echo "Ignore any errors from the yes command above."
251
252 #fix silly permissions in tarball
253 cd ${WORKDIR}
254 chown -R 0.0 *
255 chmod -R a+r-w+X,u+w *
256 }
257
258 src_compile() {
259 if [ "${PN}" = "linux-sources" ] || [ "${PN}" = "linux-headers" ]
260 then
261 cd ${KS}
262 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep
263 else
264 if [ $PN = "linux" ]
265 then
266 cd ${KS}
267 try make symlinks
268 fi
269 if [ "`use lvm`" ]
270 then
271 #LVM tools are included in the linux and linux-extras pakcages
272 cd ${KS2}/LVM/${LVMV}
273
274 # This is needed for linux-extras
275 if [ -f "Makefile" ]
276 then
277 try make clean
278 fi
279 # I had to hack this in so that LVM will look in the current linux
280 # source directory instead of /usr/src/linux for stuff - pete
281 CFLAGS="${CFLAGS} -I${KS}/include" try ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}"
282 try make
283 fi
284
285 # if [ "`use lm_sensors`" ]
286 # then
287 # cd ${KS}/extras/lm_sensors-${SENV}
288 # try make
289 # fi
290
291 # Works, just commented out because JFS isn't ready to be used by non-developers
292 # if [ "`use jfs`" ]
293 # then
294 # cd ${S}/fs/jfs/utils
295 # try make
296 # cd output
297 # into /
298 # dosbin *
299 # doman `find -iname *.8`
300 # fi
301
302 if [ "$PN" == "linux" ]
303 then
304 cd ${KS}
305 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep
306 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage
307 try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules
308 fi
309
310 # if [ "`use pcmcia-cs`" ]
311 # then
312 # cd ${KS2}/pcmcia-cs-${PCV}
313 # # This is needed for linux-extras
314 # if [ -f "Makefile" ]
315 # then
316 # try make clean
317 # fi
318 # try ./Configure -n --kernel=${KS} --moddir=/lib/modules/${KV} \
319 # --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
320 # try make all
321 # fi
322
323 cd ${KS2}/cloop-${CLOOPV}
324 make KERNEL_DIR=${KS}
325 fi
326 }
327
328 src_install() {
329 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
330 then
331 dodir /usr/lib
332
333 if [ "`use lvm`" ]
334 then
335 cd ${KS2}/LVM/${LVMV}/tools
336
337 CFLAGS="${CFLAGS} -I${KS}/include" try make install -e prefix=${D} mandir=${D}/usr/share/man \
338 sbindir=${D}/sbin libdir=${D}/lib
339 #no need for a static library in /lib
340 mv ${D}/lib/*.a ${D}/usr/lib
341 fi
342
343 # if [ "`use lm_sensors`" ]
344 # then
345 # echo "Install sensor tools..."
346 # #install sensors tools
347 # cd ${KS}/extras/lm_sensors-${SENV}
348 # make install
349 # fi
350
351 if [ "${PN}" = "linux" ]
352 then
353 dodir /usr/src/linux-${KV}
354 cd ${D}/usr/src
355 #grab includes and documentation only
356 echo ">>> Copying includes and documentation..."
357 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
358 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
359
360 #grab compiled kernel
361 dodir /boot/boot
362 insinto /boot/boot
363 cd ${S}
364 doins arch/i386/boot/bzImage
365
366 #grab modules
367 # Do we have a bug in modutils ?
368 # Meanwhile we use this quick fix (achim)
369
370 install -d ${D}/lib/modules/`uname -r`
371 try make INSTALL_MOD_PATH=${D} modules_install
372
373 cd ${S}
374 depmod -b ${D} -F ${S}/System.map ${KV}
375 #rm -rf ${D}/lib/modules/`uname -r`
376 #fix symlink
377 cd ${D}/lib/modules/${KV}
378 rm build
379 ln -sf /usr/src/linux-${KV} build
380 fi
381
382 # if [ "`use pcmcia-cs`" ]
383 # then
384 # #install PCMCIA modules and utilities
385 # cd ${KS2}/pcmcia-cs-${PCV}
386 # try make PREFIX=${D} MANDIR=${D}/usr/share/man install
387 # rm -rf ${D}/etc/rc.d
388 # exeinto /etc/rc.d/init.d
389 # doexe ${FILESDIR}/${KV}/pcmcia
390 # fi
391
392 cd ${KS2}/cloop-${CLOOPV}
393 insinto /lib/modules/${KV}/kernel/drivers/block
394 doins cloop.o
395 into /usr
396 dobin create_compressed_fs extract_compressed_fs
397
398 if [ "`use bootcd`" ]
399 then
400 rm -rf ${D}/usr/include ${D}/usr/lib/lib*.a ${D}/usr/src
401 fi
402
403 elif [ "$PN" = "linux-sources" ]
404 then
405 dodir /usr/src
406 cd ${S}
407
408 if [ "`use build`" ] ; then
409 dodir /usr/src/linux-${KV}
410 #grab includes and documentation only
411 echo ">>> Copying includes..."
412 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
413 else
414 echo ">>> Copying sources..."
415 cp -ax ${WORKDIR}/* ${D}/usr/src
416 fi
417 elif [ "$PN" = "linux-headers" ]
418 then
419 #the linux-headers package basically takes a "snapshot" of your current linux headers
420 dodir /usr/include/linux
421 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
422 dodir /usr/include/asm
423 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
424 fi
425 if [ -d ${D}/usr/src/linux-${KV} ]
426 then
427 #don't overwrite existing .config if present
428 cd ${D}/usr/src/linux-${KV}
429 if [ -e .config ]
430 then
431 cp -a .config .config.eg
432 fi
433 fi
434 }
435
436 pkg_preinst() {
437 if [ "$PN" = "linux-headers" ]
438 then
439 if [ -L ${ROOT}usr/include/linux ]
440 then
441 rm ${ROOT}usr/include/linux
442 fi
443 if [ -L ${ROOT}usr/include/asm ]
444 then
445 rm ${ROOT}usr/include/asm
446 fi
447 fi
448 }
449
450 pkg_postinst() {
451 rm -f ${ROOT}/usr/src/linux
452 ln -sf linux-${KV} ${ROOT}/usr/src/linux
453
454 #copy over our .config if one isn't already present
455 cd ${ROOT}/usr/src/linux-${KV}
456 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
457 then
458 cp -a .config.eg .config
459 fi
460 }

  ViewVC Help
Powered by ViewVC 1.1.20