blob: 5516275386b501f373ff9997ec1ac45f205549cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/sys-apps/module-init-tools/module-init-tools-0.9.10-r5.ebuild,v 1.4 2003/06/21 21:19:40 drobbins Exp $
# This ebuild includes backwards compatability for stable 2.4 kernels
IUSE=""
inherit flag-o-matic
inherit eutils
# Note to Azarah:
#
# Hi Azarah :) That "above" and "below" stuff messes up 2.4 modutils too,
# but for different reasons. So I am removing all the weird hacks to keep
# "above" and "below" since they are no longer necessary.
#
# <drobbins@gentoo.org> (24 March 2003)
MYP="${P/_pre1/-pre}"
S="${WORKDIR}/${MYP}"
MODUTILS_PV="2.4.24"
DESCRIPTION="Kernel module tools for the development kernel >=2.5.48"
SRC_URI="mirror://kernel/linux/kernel/people/rusty/modules/${MYP}.tar.bz2
mirror://kernel/linux/utils/kernel/modutils/v2.4/modutils-${MODUTILS_PV}.tar.bz2"
HOMEPAGE="http://www.kernel.org/pub/linux/kernel/people/rusty/modules"
KEYWORDS="x86 amd64 ~ppc ~sparc ~alpha ~mips ~arm"
LICENSE="GPL-2"
SLOT="0"
DEPEND="virtual/glibc"
RDEPEND=">=sys-apps/devfsd-1.3.25-r1"
PROVIDE="virtual/modutils"
pkg_setup() {
check_KV
if [ ! -f /lib/modules/${KV}/modules.dep ]
then
eerror "Please compile and install a kernel first!"
die "Please compile and install a kernel first!"
fi
}
src_unpack() {
unpack ${A}
cd ${S}
# Fix recursive calls to modprobe not honoring -s, -q, -v and -C
epatch ${FILESDIR}/${P}-fix-recursion.patch
# Never output to stdout if logging was requested
epatch ${FILESDIR}/${P}-no-stdout-on-log.patch
cd ${WORKDIR}/modutils-${MODUTILS_PV}
epatch ${FILESDIR}/modutils-2.4.22-no-above-below.patch
cd ${S}
# If we call modprobe with '-C /dev/modules.conf' and the "module name"
# starts with '/dev', modprobe from modutils-2.4.22 do not print any
# errors:
#
# gateway root # modprobe /dev/sd1
# modprobe: Can't locate module /dev/sd1
# gateway root # modprobe -C /etc/modules.conf /dev/sd1
# modprobe: Can't locate module /dev/sd1
# gateway root # modprobe -C /etc/modules.devfs /dev/sd1
# gateway root # modprobe foo
# modprobe: Can't locate module foo
# gateway root # modprobe -C /etc/modules.conf foo
# modprobe: Can't locate module foo
# gateway root # modprobe -C /etc/modules.devfs foo
# modprobe: Can't locate module foo
# gateway root #
# gateway root # modprobe -C /etc/modules.devfs /dev/sd1 && echo yes
# yes
# gateway root # modprobe -C /etc/modules.devfs foo && echo yes
# modprobe: Can't locate module foo
# gateway root #
epatch ${FILESDIR}/${P}-be-quiet-for-devfsd.patch
}
src_compile() {
local myconf
filter-flags -fPIC
einfo "Building modutils..."
cd ${WORKDIR}/modutils-${MODUTILS_PV}
econf \
--disable-strip \
--prefix=/ \
--enable-insmod-static \
--disable-zlib \
${myconf}
emake || die "emake modutils failed"
einfo "Building module-init-tools..."
cd ${S}
econf \
--prefix=/ \
${myconf}
emake || die "emake module-init-tools failed"
}
src_install () {
cd ${WORKDIR}/modutils-${MODUTILS_PV}
einstall prefix="${D}"
docinto modutils-${MODUTILS_PV}
dodoc COPYING CREDITS ChangeLog NEWS README TODO
cd ${S}
# This copies the old version of modutils to *.old so it still works
# with kernels <= 2.4; new versions will execve() the .old version if
# a 2.4 kernel is running...
# This code was borrowed from the module-init-tools Makefile
for f in lsmod modprobe rmmod depmod insmod; do
if [ -L ${D}/sbin/${f} ]; then
ln -sf `ls -l ${D}/sbin/${f} | \
sed 's/.* -> //'`.old ${D}/sbin/${f};
fi;
mv ${D}/sbin/${f} ${D}/sbin/${f}.old;
done
einstall prefix=${D}
# Install the modules.conf2modprobe.conf tool, so we can update
# modprobe.conf.
into /
dosbin ${S}/generate-modprobe.conf
# Create the new modprobe.conf
dodir /etc
rm -f ${D}/etc/modprobe.conf
if [ ! -f ${ROOT}/etc/modprobe.devfs ]; then
# Support file for the devfs hack .. needed else modprobe borks.
# Baselayout-1.8.6.3 or there abouts will have a modules-update that
# will correctly generate /etc/modprobe.devfs ....
echo "### This file is automatically generated by modules-update" \
> ${D}/etc/modprobe.devfs
else
# This is dynamic, so we do not want this in the package ...
rm -f ${D}/etc/modprobe.devfs
fi
docinto
dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
}
pkg_postinst() {
if [ "${ROOT}" = "/" ]; then
einfo "Updating config files..."
if [ -x /sbin/modules-update ]; then
/sbin/modules-update
elif [ -x /sbin/update-modules ]; then
/sbin/update-modules
elif [ -x /usr/sbin/update-modules ]; then
/usr/sbin/update-modules
fi
fi
}
|