Magellan Linux

Annotation of /trunk/core/udev/udev-135-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 348 - (hide annotations) (download)
Mon Dec 22 23:05:02 2008 UTC (15 years, 5 months ago) by niro
File size: 6317 byte(s)
-rev bump to 135-r1
1 niro 348 # $Header: /magellan-cvs/smage/udev/udev-119-r2.smage2,v 1.3 2008/06/18 21:49:46 niro Exp $
2    
3     PNAME="udev"
4     PVER="135"
5     PBUILD="r1"
6    
7     PCATEGORIE="sys-fs"
8     STATE="unstable"
9    
10     DESCRIPTION="A Userspace Implementation for dynamic /dev nodes."
11     HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
12    
13     DEPEND=">= virtual/glibc
14     >= sys-apps/initscripts-0.4.11"
15    
16     SDEPEND=">= virtual/kernel-sources"
17    
18     SRCFILE="${PNAME}-${PVER}.tar.bz2"
19     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
20    
21     CONFIG_SRCFILE="config-${PNAME}-${PVER}-${PBUILD}.tar.bz2"
22     CONFIG_SRCDIR="${BUILDDIR}/config-${PNAME}-${PVER}-${PBUILD}"
23    
24     # global var: ${LINUX_SOURCES}
25     # location where they are
26     [[ -z ${LINUX_SOURCES} ]] && LINUX_SOURCES="/usr/src/linux"
27    
28     sminclude mtools
29    
30     SRC_URI=(
31     http://www.kernel.org/pub/linux/utils/kernel/hotplug/${SRCFILE}
32     mirror://${PNAME}/${SRCFILE}
33     mirror://${PNAME}/${CONFIG_SRCFILE}
34     )
35    
36     UP2DATE="updatecmd http://www.kernel.org/pub/linux/utils/kernel/hotplug | grep ${PNAME}- | lasttarball"
37    
38     src_prepare()
39     {
40     munpack ${SRCFILE} || die
41     munpack ${CONFIG_SRCFILE} || die
42     }
43    
44     src_compile()
45     {
46     cd ${SRCDIR}
47    
48     mconfigure \
49     --exec-prefix= \
50     --with-libdir-name=$(mlibdir) \
51     --enable-logging \
52     --without-selinux \
53     || die
54    
55     mmake || die
56     }
57    
58     src_install()
59     {
60     cd ${SRCDIR}
61     mmake DESTDIR=${BINDIR} install || die
62    
63     # install our config
64     cd ${CONFIG_SRCDIR}
65     make DESTDIR=${BINDIR} install || die
66    
67     # create symlinks for these utilities to /sbin
68     # where multipath-tools expect them to be
69     mlink ../lib/udev/vol_id /sbin/ || die
70     mlink ../lib/udev/scsi_id /sbin/ || die
71    
72     # mark some dirs undeletable
73     mkeepdir /etc/udev/rules.d || die
74     mkeepdir /lib/udev/state || die
75     mkeepdir /lib/udev/devices || die
76    
77     # CONFIG_PROTECT_MASK for /etc/udev/rules.d
78     minstalldir /etc/env.d || die
79     echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > ${BINDIR}/etc/env.d/02udev || die
80    
81     # create some nodes that we know we need
82     mknod ${BINDIR}/lib/udev/devices/null c 1 3 || die
83     chmod 666 ${BINDIR}/lib/udev/devices/null || die
84     # hey, that's my birthday :)
85     touch -t 198002220222 ${BINDIR}/lib/udev/devices/null || die
86    
87     mknod ${BINDIR}/lib/udev/devices/zero c 1 5 || die
88     chmod 666 ${BINDIR}/lib/udev/devices/zero || die
89     touch -t 198002220222 ${BINDIR}/lib/udev/devices/zero || die
90    
91     mknod ${BINDIR}/lib/udev/devices/console c 5 1 || die
92     chmod 600 ${BINDIR}/lib/udev/devices/console || die
93     chown root:tty ${BINDIR}/lib/udev/devices/console || die
94     touch -t 198002220222 ${BINDIR}/lib/udev/devices/console || die
95    
96     mknod ${BINDIR}/lib/udev/devices/urandom c 1 9 || die
97     chmod 666 ${BINDIR}/lib/udev/devices/urandom || die
98     touch -t 198002220222 ${BINDIR}/lib/udev/devices/urandom || die
99    
100     cd ${SRCDIR}
101     minstalldocs COPYING ChangeLog NEWS README TODO docs/writing_udev_rules/* || die
102     }
103    
104     preinstall()
105     {
106     if [[ ! -z $(magequery -n hotplug) ]]
107     then
108     echo -e ${COLRED}
109     echo -e "Error: sys-apps/hotplug is installed!!"
110     echo -e "hotplug is now fully provided by udev itself and it is not recommend to use this anymore."
111     echo -e "Please uninstall sys-apps/hotplug first!"
112     echo -e ${COLDEFAULT}
113     die "sys-apps/hotplug found!"
114     fi
115    
116     if [[ -d ${MROOT}/lib/udev-state ]]
117     then
118     mv -f ${MROOT}/lib/udev-state/* ${MROOT}/lib/udev/state/
119     rm -r ${MROOT}/lib/udev-state
120     fi
121    
122     if [[ -f ${MROOT}/etc/udev/udev.config ]] &&
123     [[ ! -f ${MROOT}/etc/udev/udev.rules ]]
124     then
125     mv -f ${MROOT}/etc/udev/udev.config ${MROOT}/etc/udev/udev.rules
126     fi
127    
128     # delete the old udev.hotplug symlink if it is present
129     if [[ -h ${MROOT}/etc/hotplug.d/default/udev.hotplug ]]
130     then
131     rm -f ${MROOT}/etc/hotplug.d/default/udev.hotplug
132     fi
133    
134     # delete the old wait_for_sysfs.hotplug symlink if it is present
135     if [[ -h ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]]
136     then
137     rm -f ${MROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug
138     fi
139    
140     # delete the old 10-udev.hotplug symlink if it is present
141     if [[ -h ${MROOT}/etc/hotplug.d/default/10-udev.hotplug ]]
142     then
143     rm -f ${MROOT}/etc/hotplug.d/default/10-udev.hotplug
144     fi
145    
146     # delete the deprectated udev-late rc-script
147     [[ -x ${MROOT}/sbin/rc-config ]] && ${MROOT}/sbin/rc-config del udev-late
148    
149     # delete obsolete hotplug.dev script
150     if [[ -f ${MROOT}/etc/dev.d/net/hotplug.dev ]]
151     then
152     rm -f ${MROOT}/etc/dev.d/net/hotplug.dev
153     fi
154    
155     # delete all udev.rules which are moved from /etc/udev to /lib/udev
156     local rule
157     for rule in 40-arch-s390.rules \
158     61-persistent-storage-edd.rules \
159     75-persistent-net-generator.rules \
160     64-md-raid.rules \
161     65-permissions.rules \
162     64-device-mapper.rules \
163     40-alsa.rules \
164     40-zaptel.rules \
165     60-persistent-input.rules \
166     40-arch-ia64.rules \
167     05-udev-early.rules \
168     40-arch-ppc.rules \
169     60-cdrom_id.rules \
170     40-pilot-links.rules \
171     95-udev-late.rules \
172     40-magellan.rules \
173     50-udev-default.rules \
174     80-drivers.rules \
175     30-kernel-compat.rules \
176     40-video.rules \
177     60-persistent-storage-tape.rules \
178     75-cd-aliases-generator.rules \
179     60-persistent-storage.rules
180     do
181     # delete obsolete hotplug.dev script
182     if [[ -f ${MROOT}/etc/udev/rules.d/${rule} ]]
183     then
184     rm -f ${MROOT}/etc/udev/rules.d/${rule}
185     fi
186     done
187     }
188    
189     postinstall()
190     {
191     # create some nodes that we need if they not exist
192     [[ ! -e ${MROOT}/lib/udev/devices/null ]] &&
193     mknod ${MROOT}/lib/udev/devices/null c 1 3
194     chmod 666 ${MROOT}/lib/udev/devices/null
195     touch -t 198002220222 ${MROOT}/lib/udev/devices/null
196    
197     [[ ! -e ${MROOT}/lib/udev/devices/zero ]] &&
198     mknod ${MROOT}/lib/udev/devices/zero c 1 5
199     chmod 666 ${MROOT}/lib/udev/devices/zero
200     touch -t 198002220222 ${MROOT}/lib/udev/devices/zero
201    
202     [[ ! -e ${MROOT}/lib/udev/devices/console ]] &&
203     mknod ${MROOT}/lib/udev/devices/console c 5 1
204     chmod 600 ${MROOT}/lib/udev/devices/console
205     chown root:tty ${MROOT}/lib/udev/devices/console
206     touch -t 198002220222 ${MROOT}/lib/udev/devices/console
207    
208     [[ ! -e ${MROOT}/lib/udev/devices/urandom ]] &&
209     mknod ${MROOT}/lib/udev/devices/urandom c 1 9
210     chmod 666 ${MROOT}/lib/udev/devices/urandom
211     touch -t 198002220222 ${MROOT}/lib/udev/devices/urandom
212    
213     # after install/uprade, udev *must* be reloaded if already running
214     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] &&
215     [[ -n $(pidof udevd) ]] && [[ ${MAGE_BOOTSTRAP} != true ]]
216     then
217     echo "MROOT=/; restarting udev daemon ..."
218     killall -15 udevd &> /dev/null
219     sleep 1
220     killall -9 udevd &> /dev/null
221     /sbin/udevd --daemon
222     fi
223     }

Properties

Name Value
svn:keywords Id