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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Oct 15 00:06:44 2001 UTC (18 years, 4 months ago) by azarah
Branch: MAIN
add ACPI updates to 2.4.10-r3

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

  ViewVC Help
Powered by ViewVC 1.1.20