mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-22 13:19:20 +01:00
Replacing MAKEDEV with make_devices.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3236 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
e8692c5ee7
commit
540fd314f0
@ -1 +1,2 @@
|
|||||||
<para>For its installation MAKEDEV depends on: Bash, Coreutils.</para>
|
<para>For its installation Make_devices depends on: Bash, Bzip2,
|
||||||
|
Coreutils.</para>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<sect2><title>Short description</title>
|
<sect2><title>Short description</title>
|
||||||
|
|
||||||
<para><command>MAKEDEV</command> is a script for creating the necessary
|
<para><command>make_devices</command> is a script for creating a basic set of
|
||||||
static device nodes, usually residing in the <filename>/dev</filename>
|
static device nodes, usually residing in the <filename
|
||||||
directory.</para>
|
class="directory">/dev</filename> directory.</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
<literallayout>Official download location for MAKEDEV (&makedev-version;):
|
<literallayout>Official download location for Make_devices (&makedev-version;):
|
||||||
<ulink url="&http-down;"/></literallayout>
|
<ulink url="&http-down;"/></literallayout>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<sect2><title> </title><para> </para></sect2>
|
<sect2><title> </title><para> </para></sect2>
|
||||||
|
|
||||||
<sect2 id="contents-makedev"><title>Contents of MAKEDEV</title>
|
<sect2 id="contents-makedev"><title>Contents of Make_devices</title>
|
||||||
|
|
||||||
<para><emphasis>Installed script</emphasis>: MAKEDEV</para>
|
<para><emphasis>Installed script</emphasis>: make_devices</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
|
<listitem><para>February 7th, 2004 [alex]: Chapter 6 - Creating devices:
|
||||||
|
replaced the MAKEDEV script with the make_devices script. Contributed by
|
||||||
|
Matthias Benkmann.</para></listitem>
|
||||||
|
|
||||||
<listitem><para>February 5th, 2004 [alex]: Chapter 6 - Simplified the final
|
<listitem><para>February 5th, 2004 [alex]: Chapter 6 - Simplified the final
|
||||||
install of the kernel headers to just copying them from the temporary tools
|
install of the kernel headers to just copying them from the temporary tools
|
||||||
directory.</para></listitem>
|
directory.</para></listitem>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<sect1 id="ch-system-MAKEDEV" xreflabel="Makedev">
|
<sect1 id="ch-system-MAKEDEV" xreflabel="Make_devices">
|
||||||
<title>Creating devices with Makedev-&makedev-version;</title>
|
<title>Creating devices with Make_devices-&makedev-version;</title>
|
||||||
<?dbhtml filename="makedev.html" dir="chapter06"?>
|
<?dbhtml filename="makedevices.html" dir="chapter06"?>
|
||||||
|
|
||||||
<para>The MAKEDEV package contains a script for making device nodes.</para>
|
<para>The Make_devices package contains a script for creating device
|
||||||
|
nodes.</para>
|
||||||
|
|
||||||
<screen>&buildtime; &makedev-time;
|
<screen>&buildtime; &makedev-time;
|
||||||
&diskspace; &makedev-compsize;</screen>
|
&diskspace; &makedev-compsize;</screen>
|
||||||
@ -15,62 +16,79 @@
|
|||||||
<sect2>
|
<sect2>
|
||||||
<title>Making devices</title>
|
<title>Making devices</title>
|
||||||
|
|
||||||
<para>Note that unpacking the <filename>MAKEDEV-&makedev-version;.bz2</filename>
|
<para>Note that unpacking the
|
||||||
file doesn't create a directory for you to <command>cd</command> into, as
|
<filename>make_devices-&makedev-version;.bz2</filename> file doesn't
|
||||||
the file contains only a shell script.</para>
|
create a directory for you to <command>cd</command> into, as the file
|
||||||
|
contains only a shell script.</para>
|
||||||
|
|
||||||
<para>Install the <command>MAKEDEV</command> script:</para>
|
<para>Install the <filename>make_devices</filename> script:</para>
|
||||||
|
|
||||||
<screen><userinput>bzcat MAKEDEV-&makedev-version;.bz2 > /dev/MAKEDEV
|
<screen><userinput>bzcat make_devices-&makedev-version;.bz2 > /dev/make_devices
|
||||||
chmod 754 /dev/MAKEDEV</userinput></screen>
|
chmod 754 /dev/make_devices</userinput></screen>
|
||||||
|
|
||||||
<para>Run the script to create the device files:</para>
|
<para>Device nodes are special files: things that can generate or receive data.
|
||||||
|
They usually correspond to physical pieces of hardware, and can be created by
|
||||||
|
issuing commands of the form: <command>mknod -m mode name type major
|
||||||
|
minor</command>. In such a command, <emphasis>mode</emphasis> is the usual
|
||||||
|
octal read/write/execute permissions triplet, and <emphasis>name</emphasis> is
|
||||||
|
the name of the device file to be created. It may seem surprising, but the
|
||||||
|
device name is actually arbitrary, except that most programs rely on devices
|
||||||
|
such as <filename>/dev/null</filename> having their usual names. The remaining
|
||||||
|
three parameters tell the kernel what piece of hardware the device node
|
||||||
|
actually refers to. The <emphasis>type</emphasis> is a letter, either b or c,
|
||||||
|
indicating whether the device is accessed in blocks (such as a hard disk) or
|
||||||
|
character by character (such as the console). And <emphasis>major</emphasis>
|
||||||
|
and <emphasis>minor</emphasis> are numbers, together forming a code that
|
||||||
|
identifies the device to the kernel. A list of the currently assigned device
|
||||||
|
numbers for Linux can be found in the file <filename>devices.txt</filename> in
|
||||||
|
the <filename class="directory">Documentation</filename> subdirectory of the
|
||||||
|
kernel sources.</para>
|
||||||
|
|
||||||
|
<para>Note that the same major/minor combination are usually assigned to both a
|
||||||
|
block and a character device. These are, however, completely unrelated devices
|
||||||
|
that cannot be interchanged. A device is identified by the type/major/minor
|
||||||
|
triple, not just the major/minor pair, so when creating a device node it is
|
||||||
|
important to choose the correct <emphasis>type</emphasis> of device.</para>
|
||||||
|
|
||||||
|
<para>Because looking up the type/major/minor triples and using
|
||||||
|
<command>mknod</command> manually is tedious and error-prone, the
|
||||||
|
<filename>make_devices</filename> script has been created. It contains a whole
|
||||||
|
series of <command>mknod</command> commands, one for each device, complete with
|
||||||
|
recommended name, permissions and group assignment. It has been set up so that
|
||||||
|
only a minimal set of commonly used devices is enabled and the other lines are
|
||||||
|
commented out. You should open <filename>make_devices</filename> in an editor
|
||||||
|
and customize it to your needs. This takes some time, but is very simple. When
|
||||||
|
you are satisfied, run the script to create the device files:</para>
|
||||||
|
|
||||||
<screen><userinput>cd /dev
|
<screen><userinput>cd /dev
|
||||||
./MAKEDEV -v generic-nopty</userinput></screen>
|
./make_devices</userinput></screen>
|
||||||
|
|
||||||
<para>The meaning of the arguments:</para>
|
<para>(The FHS states that there should be a <filename>MAKEDEV</filename>
|
||||||
|
script present in the <filename class="directory">/dev</filename> directory.
|
||||||
|
But the FHS is mistaken: it should not dictate anything about files, and limit
|
||||||
|
itself to directories.)</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<para>If you had success with mounting the devpts file system earlier in <xref
|
||||||
<listitem><para><userinput>-v</userinput>: This tells the script to run in
|
linkend="ch-system-proc"/>, you can continue with the next section. If you were
|
||||||
verbose mode.</para></listitem>
|
unable to mount devpts, now is the time to try the alternatives. If your kernel
|
||||||
|
supports the devfs file system, run the following command to mount
|
||||||
<listitem><para><userinput>generic-nopty</userinput>: This instructs
|
|
||||||
<command>MAKEDEV</command> to create a generic selection of commonly used
|
|
||||||
device special files, except for the ptyXX and ttyXX range of files. We don't
|
|
||||||
need those files because we are going to use Unix98 PTYs via the
|
|
||||||
<emphasis>devpts</emphasis> file system.</para></listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
|
|
||||||
<para>If it turns out that some special device <filename>zzz</filename> that
|
|
||||||
you need is missing, try running <userinput>./MAKEDEV -v zzz</userinput>.
|
|
||||||
Alternatively, you may create devices via the <command>mknod</command>
|
|
||||||
program. Please refer to its man and info pages if you need more
|
|
||||||
information.</para>
|
|
||||||
|
|
||||||
<para>If you wish your system to be FHS-compliant, then the
|
|
||||||
<filename>MAKEDEV</filename> script has to remain present in the
|
|
||||||
<filename class="directory">/dev</filename> directory. This way it is always
|
|
||||||
available for making extra device nodes.</para>
|
|
||||||
|
|
||||||
<para>Additionally, if you were unable to mount the devpts file system earlier
|
|
||||||
in <xref linkend="ch-system-proc"/>, now is the time to try the alternatives. If
|
|
||||||
your kernel supports the devfs file system, run the following command to mount
|
|
||||||
devfs:</para>
|
devfs:</para>
|
||||||
|
|
||||||
<screen><userinput>mount -t devfs devfs /dev</userinput></screen>
|
<screen><userinput>mount -t devfs devfs /dev</userinput></screen>
|
||||||
|
|
||||||
<para>This will mount the devfs file system over the top of the new static
|
<para>This will mount the devfs file system over the top of the new static
|
||||||
<filename>/dev</filename> structure. This poses no problems, as the device nodes
|
<filename>/dev</filename> structure. This poses no problems, as the device
|
||||||
created are still present, they are just hidden by the new devfs
|
nodes created are still present, they are just hidden by the new devfs file
|
||||||
file system.</para>
|
system.</para>
|
||||||
|
|
||||||
<para>If this still doesn't work, the only option left is to use the MAKEDEV
|
<para>If that didn't work either, the only option left is to create a few ptyXX
|
||||||
script to create the ptyXX and ttyXX range of files that would otherwise not be
|
and ttyXX device nodes. To do this, open <filename>make_devices</filename> in
|
||||||
needed. Ensure you are still in the <filename>/dev</filename> directory then run
|
your editor, go to the section "Pseudo-TTY masters" and enable as many ptyXX
|
||||||
<userinput>./MAKEDEV -v pty</userinput>. The downside of this is, we are
|
devices as you think you will need (one for every active xterm, ssh connection,
|
||||||
creating an extra 512 device special files which will not be needed when we
|
telnet connection, and so on). In the immediately following section "Pseudo-TTY
|
||||||
finally boot into the finished LFS system.</para>
|
slaves", enable the corresponding ttyXX devices. When you are done, rerun
|
||||||
|
<command>./make_devices</command> from inside <filename>/dev</filename> to have
|
||||||
|
it create the new devices.</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
<!ENTITY aa-makedev-dep SYSTEM "../appendixa/makedev-dep.xml">
|
<!ENTITY aa-makedev-dep SYSTEM "../appendixa/makedev-dep.xml">
|
||||||
<!ENTITY aa-makedev-down SYSTEM "../appendixa/makedev-down.xml">
|
<!ENTITY aa-makedev-down SYSTEM "../appendixa/makedev-down.xml">
|
||||||
|
|
||||||
<!ENTITY makedev-version "1.7">
|
<!ENTITY makedev-version "1.1">
|
||||||
<!ENTITY makedev-depversion "1.7">
|
<!ENTITY makedev-depversion "1.1">
|
||||||
<!ENTITY makedev-contversion "1.7">
|
<!ENTITY makedev-contversion "1.1">
|
||||||
<!ENTITY makedev-package "MAKEDEV-&makedev-version;.bz2">
|
<!ENTITY makedev-package "Make_devices-&makedev-version;.bz2">
|
||||||
<!ENTITY makedev-size "8 KB">
|
<!ENTITY makedev-size "20 KB">
|
||||||
|
|
||||||
<!ENTITY makedev-compsize "50 KB">
|
<!ENTITY makedev-compsize "160 KB">
|
||||||
<!ENTITY makedev-time "0.1 SBU">
|
<!ENTITY makedev-time "1 SBU">
|
||||||
|
Loading…
Reference in New Issue
Block a user