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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Oct 6 04:41:00 2001 UTC (18 years, 4 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
update-o-rama?

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.ebuild,v 1.1 2001/09/28 05:48:53 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-rc2
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/patch-rml-2.4.10-preempt-kernel-1
45 http://www.tech9.net/rml/linux/patch-rml-2.4.10-preempt-ptrace-and-jobs-fix-2
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}/patch-rml-2.4.10-preempt-kernel-1 || die
102 patch -p1 < ${DISTDIR}/patch-rml-2.4.10-preempt-ptrace-and-jobs-fix-2 || die
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 echo "Preparing for compilation..."
112 cd ${S}
113
114 #sometimes we have icky kernel symbols; this seems to get rid of them
115 make mrproper || die
116
117 #linux-sources needs to be fully configured, too. Not just linux
118 #this is the configuration for the default kernel
119 cp ${PORTDIR}/sys-kernel/linux-sources/files/config.default .config || die
120 yes "" | make oldconfig
121 echo "Ignore any errors from the yes command above."
122
123 #fix silly permissions in tarball
124 cd ${WORKDIR}
125 chown -R 0.0 *
126 chmod -R a+r-w+X,u+w *
127 }
128
129 src_compile() {
130 if [ "${PN}" = "linux-headers" ]
131 then
132 cd ${KS}
133 make include/linux/autoconf.h include/linux/version.h || die
134 elif [ "${PN}" = "linux-sources" ]
135 then
136 echo
137 else
138 if [ $PN = "linux" ]
139 then
140 cd ${KS}
141 make symlinks || die
142 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep || die
143 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage || die
144 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules || die
145 fi
146 #LVM tools are included in the linux and linux-extras pakcages
147 cd ${KS2}/LVM/${LVMV}
148
149 # This is needed for linux-extras
150 if [ -f "Makefile" ]
151 then
152 make clean || die
153 fi
154 # I had to hack this in so that LVM will look in the current linux
155 # source directory instead of /usr/src/linux for stuff - pete
156 CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}" || die
157 make || die
158 fi
159 }
160
161 src_install() {
162 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
163 then
164 dodir /usr/lib
165
166 cd ${KS2}/LVM/${LVMV}/tools
167 CFLAGS="${CFLAGS} -I${KS}/include" make install -e prefix=${D} mandir=${D}/usr/share/man sbindir=${D}/sbin libdir=${D}/lib || die
168 #no need for a static library in /lib
169 mv ${D}/lib/*.a ${D}/usr/lib
170
171 if [ "${PN}" = "linux" ]
172 then
173 dodir /usr/src/linux-${KV}
174 cd ${D}/usr/src
175 #grab includes and documentation only
176 echo ">>> Copying includes and documentation..."
177 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
178 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
179
180 #grab compiled kernel
181 dodir /boot/boot
182 insinto /boot/boot
183 cd ${S}
184 doins arch/i386/boot/bzImage
185
186 #grab modules
187 # Do we have a bug in modutils ?
188 # Meanwhile we use this quick fix (achim)
189
190 install -d ${D}/lib/modules/`uname -r`
191 make INSTALL_MOD_PATH=${D} modules_install || die
192
193 cd ${S}
194 depmod -b ${D} -F ${S}/System.map ${KV}
195 #rm -rf ${D}/lib/modules/`uname -r`
196 #fix symlink
197 cd ${D}/lib/modules/${KV}
198 rm build
199 ln -sf /usr/src/linux-${KV} build
200 fi
201
202 cd ${KS2}/cloop-${CLOOPV}
203 insinto /lib/modules/${KV}/kernel/drivers/block
204 doins cloop.o
205 into /usr
206 dobin create_compressed_fs extract_compressed_fs
207
208 elif [ "$PN" = "linux-sources" ]
209 then
210 dodir /usr/src
211 cd ${S}
212 echo ">>> Copying sources..."
213 cp -ax ${WORKDIR}/* ${D}/usr/src
214 elif [ "$PN" = "linux-headers" ]
215 then
216 dodir /usr/include/linux
217 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
218 dodir /usr/include/asm
219 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
220 fi
221 if [ -d ${D}/usr/src/linux-${KV} ]
222 then
223 #don't overwrite existing .config if present
224 cd ${D}/usr/src/linux-${KV}
225 if [ -e .config ]
226 then
227 cp -a .config .config.eg
228 fi
229 fi
230 }
231
232 pkg_preinst() {
233 if [ "$PN" = "linux-headers" ]
234 then
235 if [ -L ${ROOT}usr/include/linux ]
236 then
237 rm ${ROOT}usr/include/linux
238 fi
239 if [ -L ${ROOT}usr/include/asm ]
240 then
241 rm ${ROOT}usr/include/asm
242 fi
243 fi
244 }
245
246 pkg_postinst() {
247 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
248 then
249 return
250 fi
251 rm -f ${ROOT}/usr/src/linux
252 ln -sf linux-${KV} ${ROOT}/usr/src/linux
253
254 #copy over our .config if one isn't already present
255 cd ${ROOT}/usr/src/linux-${KV}
256 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
257 then
258 cp -a .config.eg .config
259 fi
260 }

  ViewVC Help
Powered by ViewVC 1.1.20