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

  ViewVC Help
Powered by ViewVC 1.1.20