/[gentoo]/xml/htdocs/doc/en/udev-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/udev-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
11This document explains what udev is and how you can use udev to fit your needs. 11This document explains what udev is and how you can use udev to fit your needs.
12</abstract> 12</abstract>
13 13
14<license/> 14<license/>
15 15
16<version>0.1</version> 16<version>0.2</version>
17<date>February 26, 2003</date> 17<date>February 29, 2003</date>
18 18
19<chapter> 19<chapter>
20<title>What is udev?</title> 20<title>What is udev?</title>
21<section> 21<section>
22<title>The /dev Directory</title> 22<title>The /dev Directory</title>
171<title>Requirements</title> 171<title>Requirements</title>
172<body> 172<body>
173 173
174<p> 174<p>
175To be able to use udev on Gentoo, you must install 175To be able to use udev on Gentoo, you must install
176<c>sys-apps/baselayout-1.8.6.13</c> or later and <c>sys-fs/udev</c>. 176<c>sys-apps/baselayout-1.8.6.13-r1</c> or later and <c>sys-fs/udev</c>.
177If necessary, edit <path>/etc/portage/package.keywords</path> so that your 177If necessary, edit <path>/etc/portage/package.keywords</path> so that your
178system uses the ~ARCH tree for those two packages: 178system uses the ~ARCH tree for <c>sys-fs/udev</c>:
179</p> 179</p>
180 180
181<pre caption="/etc/portage/package.keywords"> 181<pre caption="/etc/portage/package.keywords">
182sys-apps/baselayout ~x86
183sys-fs/udev ~x86 182sys-fs/udev ~x86
184</pre> 183</pre>
185 184
186<p> 185<p>
187If you haven't done so already, also install <c>sys-apps/hotplug</c>. 186If you haven't done so already, also install <c>sys-apps/hotplug</c>.
217<section> 216<section>
218<title>Configuration</title> 217<title>Configuration</title>
219<body> 218<body>
220 219
221<p> 220<p>
222First activate <c>hotplug</c> and have it started when you boot up your system:
223</p>
224
225<pre caption="Adding hotplug to the default runlevel">
226<comment>(Make sure that "boot" is used, not "default")</comment>
227# <i>rc-update add hotplug boot</i>
228# <i>/etc/init.d/hotplug start</i>
229</pre>
230
231<p>
232Now, if you're interested in the udev-tweaks Gentoo added to make your life 221If you're interested in the udev-tweaks Gentoo added to make your life
233comfortable, then read no more. You're all set. The Gentoo init scripts won't 222comfortable, then read no more. You're all set. The Gentoo init scripts won't
234run the devfsd daemon and deactivate devfs when you boot up. 223run the devfsd daemon and deactivate devfs when you boot up.
235</p> 224</p>
236 225
237<p> 226<p>
238But if you are a die-hard and want to run a udev-only, no-tweaked system as is 227But if you are a die-hard and want to run a udev-only, no-tweaked system as is
239intended by the udev development, by all means, read on :) 228intended by the udev development (including the difficulties of missing device
229nodes because udev doesn't support them yet), by all means, read on :)
240</p> 230</p>
241 231
242<warn> 232<warn>
243Do <e>not</e> complain if something goes wrong. You're going to remove the hard 233Do <e>not</e> complain if something goes wrong. You're going to remove the hard
244work of many Gentoo developers that hacked our init scripts to get udev playing 234work of many Gentoo developers that hacked our init scripts to get udev playing
245nicely with Gentoo! 235nicely with Gentoo!
246</warn> 236</warn>
247 237
248<p> 238<p>
249First of all we'll deactivate the rules that save the device file nodes from 239First of all we'll deactivate the rules that save the device file nodes.
250<path>/etc/init.d/halt.sh</path> and <path>/sbin/rc</path> by commenting them 240From <c>sys-apps/baselayout-1.8.6.13-r1</c> onwards, you can edit the
251out: 241<c>RC_DEVICE_TARBALL</c> variable in <path>/etc/conf.d/rc</path> and set it to
252</p> 242<c>no</c>:
253
254<pre caption="/etc/init.d/halt.sh">
255# We need to properly terminate devfsd to save the permissions
256if [ -n "`ps --no-heading -C 'devfsd'`" ]
257then
258 ebegin "Stopping devfsd"
259 killall -15 devfsd &amp; &gt; /dev/null
260 eend $?
261elif [ ! -e /dev/.devfsd -a -e /dev/.udev ]
262then
263 ebegin "Saving device nodes"
264 <comment>##cd /dev</comment>
265 <comment>##try tar -jclpf "/tmp/devices-$$.tar.bz2" *</comment>
266 <comment>##try mv -f "/tmp/devices-$$.tar.bz2" /lib/udev-state/devices.tar.bz2</comment>
267 eend 0
268fi
269</pre> 243</p>
270 244
271<pre caption="/sbin/rc"> 245<pre caption="/etc/conf.d/rc">
272# Fix weird bug where there is a /dev/.devfsd in a unmounted /dev 246RC_DEVICE_TARBALL="no"
273mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)"
274if [ -e "/dev/.devfsd" -a "${mymounts}" != "yes" ]
275then
276 rm -f /dev/.devfsd
277fi
278
279if [ "${udev}" = "yes" ]
280then
281 ebegin "Mounting ramfs at /dev"
282 try mount -n -t ramfs none /dev
283 eend $?
284 ebegin "Configuring system to use udev"
285 einfo " Populating /dev with device nodes..."
286 <comment>##try tar -jxpf /lib/udev-state/devices.tar.bz2 -C /dev</comment>
287 populate_udev
288 if [ -e /proc/sys/kernel/hotplug -a -x /sbin/hotplug ]
289 then
290 einfo " Using /sbin/hotplug for udev management..."
291
292 elif [ -e /proc/sys/kernel/hotplug ]
293 then
294 einfo " Setting /sbin/udev as hotplug agent..."
295 echo "/sbin/udev" &gt; /proc/sys/kernel/hotplug
296 else
297 ewarn " Kernel was not compiled with hotplug support!"
298 fi
299 eend 0
300 # Create problematic directories
301 mkdir -p /dev/{pts,shm}
302 # Same thing as /dev/.devfsd
303 touch /dev/.udev
304</pre> 247</pre>
305 248
306<p> 249<p>
307We also need to manually create some device node files in order for our system 250We also need to manually create some device node files in order for our system
308to perform a succesful boot: 251to perform a succesful boot:

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20