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

Contents of /sys-kernel/linux-extras/linux-extras-2.4.14-r2.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.14-r2.ebuild,v 1.1 2001/11/18 12:32:17 azarah Exp $
6
7 #OKV=original kernel version, KV=patched kernel version. They can be the same.
8
9 OKV=2.4.14
10 KV=2.4.14
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 # Patch Versions
34 ACPIV=20011109
35 LVMV=1.0.1-rc4
36 EXT3V=0.9.15
37 LOWLV=2.4.14
38 PREEV="${KV}-2"
39
40 EXT3P="ext3-2.4-${EXT3V}-`echo ${KV} |sed -e 's:\.::g' -e 's:-::'`"
41
42 [ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
43 [ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
44 [ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
45
46 # We use build in /usr/src/linux in case of linux-extras
47 # so we need no sources
48 [ ! "${PN}" = "linux-extras" ] && SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
49 ftp://ftp.sistina.com/pub/LVM/1.0/lvm_${LVMV}.tar.gz
50 ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/2.4/preempt-kernel-rml-${PREEV}.patch
51 http://www.uow.edu.au/~andrewm/linux/${LOWLV}-low-latency.patch.gz
52 http://www.zip.com.au/~akpm/${EXT3P}.gz
53 http://developer.intel.com/technology/iapc/acpi/downloads/acpi-${ACPIV}.diff.gz"
54
55 # Make live easier for creating the LVM patch when packaging
56 # The patch will be copied to /tmp/kpatches. Maybe some other
57 # stuff can make use of this?
58 [ "$MAKEPATCH" != "yes" ] && SRC_URI="${SRC_URI}
59 http://www.ibiblio.org/gentoo/distfiles/lvm-${LVMV}-${PVR}.patch.bz2"
60
61 [ "$PN" != "linux-extras" ] && PROVIDE="virtual/kernel"
62
63 HOMEPAGE="http://www.kernel.org/
64 http://www.namesys.com
65 http://www.sistina.com/lvm/
66 http://developer.intel.com/technology/iapc/acpi/"
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-${MOSV} ) >=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
73 RDEPEND=">=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
74 elif [ $PN = "linux-sources" ]
75 then
76 if [ "`use build`" ]
77 then
78 DEPEND=""
79 RDEPEND=""
80 else
81 #ncurses is required for "make menuconfig"
82 RDEPEND=">=sys-libs/ncurses-5.2"
83 fi
84 elif [ $PN = "linux-extras" ]
85 then
86 #linux-extras/headers requires a rev of the current kernel sources to be installed
87 RDEPEND="~sys-kernel/linux-sources-${PV}"
88 elif [ $PN = "linux-headers" ]
89 then
90 DEPEND=""
91 RDEPEND=""
92 fi
93
94 # this is not pretty...
95 [ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${KS}/include"
96
97 src_unpack() {
98
99 [ "$PN" = "linux-extras" ] && return
100 mkdir ${S2}
101
102 #unpack kernel and apply reiserfs-related patches
103 cd ${WORKDIR}
104 unpack linux-${OKV}.tar.bz2
105 mv linux linux-${KV} || die
106 cd ${S}
107 if [ "$KV" != "$OKV" ]
108 then
109 echo "Applying ${KV} patch..."
110 bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1 || die
111 fi
112 dodir /usr/src/linux-${KV}-extras
113
114 #specific to 2.4.10; preempt and ext3 patches
115 cd ${S}
116 patch -p1 < ${DISTDIR}/preempt-kernel-rml-${PREEV}.patch
117 cat ${DISTDIR}/${EXT3P}.gz | gzip -dc | patch -p1 || die
118
119 #get LVM sources ready for compile or sitting at /usr/src;
120 #generate the kernel patch, and apply it
121 cd ${S2}
122 unpack lvm_${LVMV}.tar.gz
123
124 #Generate the patch, and cp it to /tmp/kpatches
125 if [ "$MAKEPATCH" = "yes" ] ; then
126 local S_LVM="${S2}/LVM/${LVMV}"
127 cd ${S_LVM}
128 ./configure --with-kernel_dir=${S} || die
129 cd ${S_LVM}/PATCHES
130 mv Makefile Makefile.orig
131 sed -e 's:/usr/src/linux:${S}:' Makefile.orig >Makefile || die
132 make || die
133 mv ${S_LVM}/PATCHES/lvm-${LVMV}-${KV}.patch ${WORKDIR}
134 mv Makefile.orig Makefile
135 cd ${S_LVM}
136 make distclean
137 #the LVM patch is included to replace the old version, irregardless if USE lvm is set
138 cd ${S}
139 patch -l -p1 <${WORKDIR}/lvm-${LVMV}-${KV}.patch || die
140 mkdir /tmp/kpatches
141 bzip2 -c ${WORKDIR}/lvm-${LVMV}-${KV}.patch >/tmp/kpatches/lvm-${LVMV}-${PVR}.patch.bz2
142
143 #normar merge, just patch with patch from gentoo mirror
144 else
145 cd ${S}
146 cat ${DISTDIR}/lvm-${LVMV}-${PVR}.patch.bz2 | bzip2 -dc | patch -l -p1 || die
147 fi
148
149 #apply low-latency patch
150 cd ${S}
151 cat ${DISTDIR}/${LOWLV}-low-latency.patch.gz | gzip -d | patch -p1 || die
152
153 #apply ACPI updates
154 cat ${DISTDIR}/acpi-${ACPIV}.diff.gz | gzip -d | patch -p1 || die
155
156 #fix problem compiling ${S}/drivers/block/loop.c as module
157 patch -p1 <${FILESDIR}/2.4.14-loop.c.diff || die
158
159 echo "Preparing for compilation..."
160 cd ${S}
161
162 #sometimes we have icky kernel symbols; this seems to get rid of them
163 make mrproper || die
164
165 #linux-sources needs to be fully configured, too. Not just linux
166 #this is the configuration for the default kernel
167 cp ${PORTDIR}/sys-kernel/linux-sources/files/config.default .config || die
168 yes "" | make oldconfig
169 echo "Ignore any errors from the yes command above."
170
171 #fix silly permissions in tarball
172 cd ${WORKDIR}
173 chown -R 0.0 *
174 chmod -R a+r-w+X,u+w *
175
176 # Gentoo Linux uses /boot, so fix 'make install' to work properly
177 #seems they cant make up their mind if it should be a space or tab
178 cd ${S}
179 mv Makefile Makefile.orig
180 sed -e 's/#export\tINSTALL_PATH/export\tINSTALL_PATH/' \
181 Makefile.orig >Makefile || die # test, remove me if Makefile ok
182 rm Makefile.orig
183 }
184
185 src_compile() {
186
187 if [ "${PN}" = "linux-headers" ]
188 then
189 cd ${KS}
190 make include/linux/autoconf.h include/linux/version.h || die
191 elif [ "${PN}" = "linux-sources" ]
192 then
193 echo
194 else
195 if [ $PN = "linux" ]
196 then
197 cd ${KS}
198 make symlinks || die
199 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep || die
200 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage || die
201 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules || die
202 fi
203 #LVM tools are included in the linux and linux-extras pakcages
204 cd ${KS2}/LVM/${LVMV}
205
206 # This is needed for linux-extras
207 if [ -f "Makefile" ]
208 then
209 make clean || die
210 fi
211 # I had to hack this in so that LVM will look in the current linux
212 # source directory instead of /usr/src/linux for stuff - pete
213 CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}" || die
214 make || die
215 fi
216 }
217
218 src_install() {
219
220 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
221 then
222 dodir /usr/lib
223
224 cd ${KS2}/LVM/${LVMV}/tools
225 CFLAGS="${CFLAGS} -I${KS}/include" make install -e prefix=${D} mandir=${D}/usr/share/man sbindir=${D}/sbin libdir=${D}/lib || die
226 #no need for a static library in /lib
227 mv ${D}/lib/*.a ${D}/usr/lib
228
229 if [ "${PN}" = "linux" ]
230 then
231 dodir /usr/src/linux-${KV}
232 cd ${D}/usr/src
233 #grab includes and documentation only
234 echo ">>> Copying includes and documentation..."
235 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
236 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
237
238 #grab compiled kernel
239 dodir /boot/boot
240 insinto /boot/boot
241 cd ${S}
242 doins arch/i386/boot/bzImage
243
244 #grab modules
245 # Do we have a bug in modutils ?
246 # Meanwhile we use this quick fix (achim)
247
248 install -d ${D}/lib/modules/`uname -r`
249 make INSTALL_MOD_PATH=${D} modules_install || die
250
251 cd ${S}
252 depmod -b ${D} -F ${S}/System.map ${KV}
253 #rm -rf ${D}/lib/modules/`uname -r`
254 #fix symlink
255 cd ${D}/lib/modules/${KV}
256 rm build
257 ln -sf /usr/src/linux-${KV} build
258 fi
259
260 cd ${KS2}/cloop-${CLOOPV}
261 insinto /lib/modules/${KV}/kernel/drivers/block
262 doins cloop.o
263 into /usr
264 dobin create_compressed_fs extract_compressed_fs
265
266 elif [ "$PN" = "linux-sources" ]
267 then
268 dodir /usr/src
269 cd ${S}
270 echo ">>> Copying sources..."
271 cp -ax ${WORKDIR}/* ${D}/usr/src
272 elif [ "$PN" = "linux-headers" ]
273 then
274 dodir /usr/include/linux
275 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
276 dodir /usr/include/asm
277 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
278 fi
279 if [ -d ${D}/usr/src/linux-${KV} ]
280 then
281 #don't overwrite existing .config if present
282 cd ${D}/usr/src/linux-${KV}
283 if [ -e .config ]
284 then
285 cp -a .config .config.eg
286 fi
287 fi
288 }
289
290 pkg_preinst() {
291
292 if [ "$PN" = "linux-headers" ]
293 then
294 if [ -L ${ROOT}usr/include/linux ]
295 then
296 rm ${ROOT}usr/include/linux
297 fi
298 if [ -L ${ROOT}usr/include/asm ]
299 then
300 rm ${ROOT}usr/include/asm
301 fi
302 fi
303 }
304
305 pkg_postinst() {
306
307 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
308 then
309 return
310 fi
311 rm -f ${ROOT}/usr/src/linux
312 ln -sf linux-${KV} ${ROOT}/usr/src/linux
313
314 #copy over our .config if one isn't already present
315 cd ${ROOT}/usr/src/linux-${KV}
316 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
317 then
318 cp -a .config.eg .config
319 fi
320 }

  ViewVC Help
Powered by ViewVC 1.1.20