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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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.2: +1 -1 lines
FILE REMOVED
massive cleanup

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-r2.ebuild,v 1.2 2001/10/08 01:50:29 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://lameter.com/kernel/ext3-2.4.10.gz"
47
48 [ "$PN" != "linux-extras" ] && PROVIDE="virtual/kernel"
49
50 HOMEPAGE="http://www.kernel.org/
51 http://www.namesys.com
52 http://www.sistina.com/lvm/"
53
54 DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
55 #these deps are messed up; fix 'em and add ncurses (required my mosix compile, menuconfig)
56 if [ $PN = "linux" ]
57 then
58 # 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"
59 RDEPEND=">=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
60 elif [ $PN = "linux-sources" ]
61 then
62 if [ "`use build`" ]
63 then
64 DEPEND=""
65 RDEPEND=""
66 else
67 #ncurses is required for "make menuconfig"
68 RDEPEND=">=sys-libs/ncurses-5.2"
69 fi
70 elif [ $PN = "linux-extras" ]
71 then
72 #linux-extras/headers requires a rev of the current kernel sources to be installed
73 RDEPEND="~sys-kernel/linux-sources-${PV}"
74 elif [ $PN = "linux-headers" ]
75 then
76 DEPEND=""
77 RDEPEND=""
78 fi
79
80 # this is not pretty...
81 [ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${KS}/include"
82
83 src_unpack() {
84 [ "$PN" = "linux-extras" ] && return
85 mkdir ${S2}
86
87 #unpack kernel and apply reiserfs-related patches
88 cd ${WORKDIR}
89 unpack linux-${OKV}.tar.bz2
90 mv linux linux-${KV} || die
91 cd ${S}
92 if [ "$KV" != "$OKV" ]
93 then
94 echo "Applying ${KV} patch..."
95 bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1 || die
96 fi
97 dodir /usr/src/linux-${KV}-extras
98
99 #specific to 2.4.10; preempt and ext3 patches
100 cd ${S}
101 patch -p1 < ${DISTDIR}/preempt-kernel-rml-2.4.10-7.patch
102 cat ${DISTDIR}/ext3-2.4.10.gz | gzip -dc | patch -p1 || die
103 #the LVM patch is included to replace the old version, irregardless if USE lvm is set
104 cat ${DISTDIR}/lvm-${LVMV}-${KV}.patch.bz2 | bzip2 -d | patch -N -l -p1
105 #|| die
106 #we removed || die because any stuff that hits -N causes an error code of 1
107 cd ${S2}
108 unpack lvm_${LVMV}.tar.gz
109 #get sources ready for compilation or for sitting at /usr/src/linux
110
111 #apply low-latency patch
112 cd ${S}
113 cat ${DISTDIR}/2.4.10-low-latency.patch.gz | gzip -d | patch -p1
114
115 echo "Preparing for compilation..."
116 cd ${S}
117
118 #sometimes we have icky kernel symbols; this seems to get rid of them
119 make mrproper || die
120
121 #linux-sources needs to be fully configured, too. Not just linux
122 #this is the configuration for the default kernel
123 cp ${PORTDIR}/sys-kernel/linux-sources/files/config.default .config || die
124 yes "" | make oldconfig
125 echo "Ignore any errors from the yes command above."
126
127 #fix silly permissions in tarball
128 cd ${WORKDIR}
129 chown -R 0.0 *
130 chmod -R a+r-w+X,u+w *
131 }
132
133 src_compile() {
134 if [ "${PN}" = "linux-headers" ]
135 then
136 cd ${KS}
137 make include/linux/autoconf.h include/linux/version.h || die
138 elif [ "${PN}" = "linux-sources" ]
139 then
140 echo
141 else
142 if [ $PN = "linux" ]
143 then
144 cd ${KS}
145 make symlinks || die
146 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep || die
147 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage || die
148 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules || die
149 fi
150 #LVM tools are included in the linux and linux-extras pakcages
151 cd ${KS2}/LVM/${LVMV}
152
153 # This is needed for linux-extras
154 if [ -f "Makefile" ]
155 then
156 make clean || die
157 fi
158 # I had to hack this in so that LVM will look in the current linux
159 # source directory instead of /usr/src/linux for stuff - pete
160 CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}" || die
161 make || die
162 fi
163 }
164
165 src_install() {
166 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
167 then
168 dodir /usr/lib
169
170 cd ${KS2}/LVM/${LVMV}/tools
171 CFLAGS="${CFLAGS} -I${KS}/include" make install -e prefix=${D} mandir=${D}/usr/share/man sbindir=${D}/sbin libdir=${D}/lib || die
172 #no need for a static library in /lib
173 mv ${D}/lib/*.a ${D}/usr/lib
174
175 if [ "${PN}" = "linux" ]
176 then
177 dodir /usr/src/linux-${KV}
178 cd ${D}/usr/src
179 #grab includes and documentation only
180 echo ">>> Copying includes and documentation..."
181 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
182 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
183
184 #grab compiled kernel
185 dodir /boot/boot
186 insinto /boot/boot
187 cd ${S}
188 doins arch/i386/boot/bzImage
189
190 #grab modules
191 # Do we have a bug in modutils ?
192 # Meanwhile we use this quick fix (achim)
193
194 install -d ${D}/lib/modules/`uname -r`
195 make INSTALL_MOD_PATH=${D} modules_install || die
196
197 cd ${S}
198 depmod -b ${D} -F ${S}/System.map ${KV}
199 #rm -rf ${D}/lib/modules/`uname -r`
200 #fix symlink
201 cd ${D}/lib/modules/${KV}
202 rm build
203 ln -sf /usr/src/linux-${KV} build
204 fi
205
206 cd ${KS2}/cloop-${CLOOPV}
207 insinto /lib/modules/${KV}/kernel/drivers/block
208 doins cloop.o
209 into /usr
210 dobin create_compressed_fs extract_compressed_fs
211
212 elif [ "$PN" = "linux-sources" ]
213 then
214 dodir /usr/src
215 cd ${S}
216 echo ">>> Copying sources..."
217 cp -ax ${WORKDIR}/* ${D}/usr/src
218 elif [ "$PN" = "linux-headers" ]
219 then
220 dodir /usr/include/linux
221 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
222 dodir /usr/include/asm
223 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
224 fi
225 if [ -d ${D}/usr/src/linux-${KV} ]
226 then
227 #don't overwrite existing .config if present
228 cd ${D}/usr/src/linux-${KV}
229 if [ -e .config ]
230 then
231 cp -a .config .config.eg
232 fi
233 fi
234 }
235
236 pkg_preinst() {
237 if [ "$PN" = "linux-headers" ]
238 then
239 if [ -L ${ROOT}usr/include/linux ]
240 then
241 rm ${ROOT}usr/include/linux
242 fi
243 if [ -L ${ROOT}usr/include/asm ]
244 then
245 rm ${ROOT}usr/include/asm
246 fi
247 fi
248 }
249
250 pkg_postinst() {
251 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
252 then
253 return
254 fi
255 rm -f ${ROOT}/usr/src/linux
256 ln -sf linux-${KV} ${ROOT}/usr/src/linux
257
258 #copy over our .config if one isn't already present
259 cd ${ROOT}/usr/src/linux-${KV}
260 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
261 then
262 cp -a .config.eg .config
263 fi
264 }

  ViewVC Help
Powered by ViewVC 1.1.20