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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Dec 6 19:02:36 2001 UTC (18 years, 1 month ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
no more linux-extras

1 # Copyright 1999-2001 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License, v2 or later
3 # Maintainer: System Team <system@gentoo.org>
4 # Author: Daniel Robbins <drobbins@gentoo.org>
5 # $Header: /home/cvsroot/gentoo-x86/sys-kernel/linux-extras/linux-extras-2.4.10-r3.ebuild,v 1.1 2001/10/12 03:59:47 drobbins Exp $
6
7 #OKV=original kernel version, KV=patched kernel version. They can be the same.
8
9 OKV=2.4.10
10 KV=2.4.10
11 S=${WORKDIR}/linux-${KV}
12 S2=${WORKDIR}/linux-${KV}-extras
13 if [ $PN = "linux-extras" ]
14 then
15 KS=${ROOT}usr/src/linux-${KV}
16 KS2=${ROOT}usr/src/linux-${KV}-extras
17 else
18 KS=${S}
19 KS2=${S2}
20 fi
21
22 # Kernel Features Enabled USE Variable Status
23 #
24 # Reiserfs Y - Production-ready
25 # JFS N jfs Testing-only (commented out for now)
26 # LVM Y lvm Production-ready
27 # ext3 Y ext3 Production-ready
28 # MOSIX N mosix Testing only, probably quite stable
29 # XFS N xfs will probably need to be placed in a separate kernel
30 # PCMCIA-CS N pcmcia Need to move this to its own ebuild
31 # lm-sensors N lm_sensors Need to move this to its own ebuild
32
33 LVMV=1.0.1-rc4
34
35 #[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
36 [ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
37 #[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
38
39 # We use build in /usr/src/linux in case of linux-extras
40 # so we need no sources
41 [ ! "${PN}" = "linux-extras" ] && SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
42 http://www.ibiblio.org/gentoo/distfiles/lvm-${LVMV}-${KV}.patch.bz2
43 ftp://ftp.sistina.com/pub/LVM/1.0/lvm_${LVMV}.tar.gz
44 http://www.tech9.net/rml/linux/preempt-kernel-rml-2.4.10-7.patch
45 http://www.uow.edu.au/~andrewm/linux/2.4.10-low-latency.patch.gz
46 http://www.uow.edu.au/~andrewm/linux/ext3-dir-speedup.patch
47 http://lameter.com/kernel/ext3-2.4.10.gz"
48
49 [ "$PN" != "linux-extras" ] && PROVIDE="virtual/kernel"
50
51 HOMEPAGE="http://www.kernel.org/
52 http://www.namesys.com
53 http://www.sistina.com/lvm/"
54
55 DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
56 #these deps are messed up; fix 'em and add ncurses (required my mosix compile, menuconfig)
57 if [ $PN = "linux" ]
58 then
59 # 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"
60 RDEPEND=">=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
61 elif [ $PN = "linux-sources" ]
62 then
63 if [ "`use build`" ]
64 then
65 DEPEND=""
66 RDEPEND=""
67 else
68 #ncurses is required for "make menuconfig"
69 RDEPEND=">=sys-libs/ncurses-5.2"
70 fi
71 elif [ $PN = "linux-extras" ]
72 then
73 #linux-extras/headers requires a rev of the current kernel sources to be installed
74 RDEPEND="~sys-kernel/linux-sources-${PV}"
75 elif [ $PN = "linux-headers" ]
76 then
77 DEPEND=""
78 RDEPEND=""
79 fi
80
81 # this is not pretty...
82 [ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${KS}/include"
83
84 src_unpack() {
85 [ "$PN" = "linux-extras" ] && return
86 mkdir ${S2}
87
88 #unpack kernel and apply reiserfs-related patches
89 cd ${WORKDIR}
90 unpack linux-${OKV}.tar.bz2
91 mv linux linux-${KV} || die
92 cd ${S}
93 if [ "$KV" != "$OKV" ]
94 then
95 echo "Applying ${KV} patch..."
96 bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1 || die
97 fi
98 dodir /usr/src/linux-${KV}-extras
99
100 #specific to 2.4.10; preempt and ext3 patches
101 cd ${S}
102 patch -p1 < ${DISTDIR}/preempt-kernel-rml-2.4.10-7.patch
103 cat ${DISTDIR}/ext3-2.4.10.gz | gzip -dc | patch -p1 || die
104 #the LVM patch is included to replace the old version, irregardless if USE lvm is set
105 cat ${DISTDIR}/lvm-${LVMV}-${KV}.patch.bz2 | bzip2 -d | patch -N -l -p1
106 #|| die
107 #we removed || die because any stuff that hits -N causes an error code of 1
108 cd ${S2}
109 unpack lvm_${LVMV}.tar.gz
110 #get sources ready for compilation or for sitting at /usr/src/linux
111
112 #apply low-latency patch
113 cd ${S}
114 cat ${DISTDIR}/2.4.10-low-latency.patch.gz | gzip -d | patch -p1 || die
115
116 #apply Ted T'so's ext3 directory speedup patch.
117 cat ${DISTDIR}/ext3-dir-speedup.patch | patch -p1 || die
118
119 echo "Preparing for compilation..."
120 cd ${S}
121
122 #sometimes we have icky kernel symbols; this seems to get rid of them
123 make mrproper || die
124
125 #linux-sources needs to be fully configured, too. Not just linux
126 #this is the configuration for the default kernel
127 cp ${PORTDIR}/sys-kernel/linux-sources/files/config.default .config || die
128 yes "" | make oldconfig
129 echo "Ignore any errors from the yes command above."
130
131 #fix silly permissions in tarball
132 cd ${WORKDIR}
133 chown -R 0.0 *
134 chmod -R a+r-w+X,u+w *
135 }
136
137 src_compile() {
138 if [ "${PN}" = "linux-headers" ]
139 then
140 cd ${KS}
141 make include/linux/autoconf.h include/linux/version.h || die
142 elif [ "${PN}" = "linux-sources" ]
143 then
144 echo
145 else
146 if [ $PN = "linux" ]
147 then
148 cd ${KS}
149 make symlinks || die
150 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep || die
151 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage || die
152 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules || die
153 fi
154 #LVM tools are included in the linux and linux-extras pakcages
155 cd ${KS2}/LVM/${LVMV}
156
157 # This is needed for linux-extras
158 if [ -f "Makefile" ]
159 then
160 make clean || die
161 fi
162 # I had to hack this in so that LVM will look in the current linux
163 # source directory instead of /usr/src/linux for stuff - pete
164 CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}" || die
165 make || die
166 fi
167 }
168
169 src_install() {
170 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
171 then
172 dodir /usr/lib
173
174 cd ${KS2}/LVM/${LVMV}/tools
175 CFLAGS="${CFLAGS} -I${KS}/include" make install -e prefix=${D} mandir=${D}/usr/share/man sbindir=${D}/sbin libdir=${D}/lib || die
176 #no need for a static library in /lib
177 mv ${D}/lib/*.a ${D}/usr/lib
178
179 if [ "${PN}" = "linux" ]
180 then
181 dodir /usr/src/linux-${KV}
182 cd ${D}/usr/src
183 #grab includes and documentation only
184 echo ">>> Copying includes and documentation..."
185 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
186 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
187
188 #grab compiled kernel
189 dodir /boot/boot
190 insinto /boot/boot
191 cd ${S}
192 doins arch/i386/boot/bzImage
193
194 #grab modules
195 # Do we have a bug in modutils ?
196 # Meanwhile we use this quick fix (achim)
197
198 install -d ${D}/lib/modules/`uname -r`
199 make INSTALL_MOD_PATH=${D} modules_install || die
200
201 cd ${S}
202 depmod -b ${D} -F ${S}/System.map ${KV}
203 #rm -rf ${D}/lib/modules/`uname -r`
204 #fix symlink
205 cd ${D}/lib/modules/${KV}
206 rm build
207 ln -sf /usr/src/linux-${KV} build
208 fi
209
210 cd ${KS2}/cloop-${CLOOPV}
211 insinto /lib/modules/${KV}/kernel/drivers/block
212 doins cloop.o
213 into /usr
214 dobin create_compressed_fs extract_compressed_fs
215
216 elif [ "$PN" = "linux-sources" ]
217 then
218 dodir /usr/src
219 cd ${S}
220 echo ">>> Copying sources..."
221 cp -ax ${WORKDIR}/* ${D}/usr/src
222 elif [ "$PN" = "linux-headers" ]
223 then
224 dodir /usr/include/linux
225 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
226 dodir /usr/include/asm
227 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
228 fi
229 if [ -d ${D}/usr/src/linux-${KV} ]
230 then
231 #don't overwrite existing .config if present
232 cd ${D}/usr/src/linux-${KV}
233 if [ -e .config ]
234 then
235 cp -a .config .config.eg
236 fi
237 fi
238 }
239
240 pkg_preinst() {
241 if [ "$PN" = "linux-headers" ]
242 then
243 if [ -L ${ROOT}usr/include/linux ]
244 then
245 rm ${ROOT}usr/include/linux
246 fi
247 if [ -L ${ROOT}usr/include/asm ]
248 then
249 rm ${ROOT}usr/include/asm
250 fi
251 fi
252 }
253
254 pkg_postinst() {
255 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
256 then
257 return
258 fi
259 rm -f ${ROOT}/usr/src/linux
260 ln -sf linux-${KV} ${ROOT}/usr/src/linux
261
262 #copy over our .config if one isn't already present
263 cd ${ROOT}/usr/src/linux-${KV}
264 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
265 then
266 cp -a .config.eg .config
267 fi
268 }

  ViewVC Help
Powered by ViewVC 1.1.20