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

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

  ViewVC Help
Powered by ViewVC 1.1.20