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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Aug 13 22:04:18 2001 UTC (18 years, 6 months ago) by drobbins
Branch: MAIN
Stuff I missed before

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

  ViewVC Help
Powered by ViewVC 1.1.20