From 540fd314f00433a16f39240e47f4af19b74297e8 Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Sat, 7 Feb 2004 14:55:52 +0000 Subject: Replacing MAKEDEV with make_devices. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3236 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- appendixa/makedev-dep.xml | 3 +- appendixa/makedev-desc.xml | 6 +- appendixa/makedev-down.xml | 2 +- appendixa/makedev-shortdesc.xml | 4 +- chapter01/changelog.xml | 4 ++ chapter06/makedev.xml | 122 +++++++++++++++++++++++----------------- entities/makedev.ent | 14 ++--- 7 files changed, 89 insertions(+), 66 deletions(-) diff --git a/appendixa/makedev-dep.xml b/appendixa/makedev-dep.xml index 68e48bf52..1cf303245 100644 --- a/appendixa/makedev-dep.xml +++ b/appendixa/makedev-dep.xml @@ -1 +1,2 @@ -For its installation MAKEDEV depends on: Bash, Coreutils. +For its installation Make_devices depends on: Bash, Bzip2, +Coreutils. diff --git a/appendixa/makedev-desc.xml b/appendixa/makedev-desc.xml index d68e9adb4..8c16ef1df 100644 --- a/appendixa/makedev-desc.xml +++ b/appendixa/makedev-desc.xml @@ -1,8 +1,8 @@ Short description -MAKEDEV is a script for creating the necessary -static device nodes, usually residing in the /dev -directory. +make_devices is a script for creating a basic set of +static device nodes, usually residing in the /dev directory. diff --git a/appendixa/makedev-down.xml b/appendixa/makedev-down.xml index 1e0e6a63c..807fae824 100644 --- a/appendixa/makedev-down.xml +++ b/appendixa/makedev-down.xml @@ -1,2 +1,2 @@ -Official download location for MAKEDEV (&makedev-version;): +Official download location for Make_devices (&makedev-version;): diff --git a/appendixa/makedev-shortdesc.xml b/appendixa/makedev-shortdesc.xml index 882fe7f33..8544ef40e 100644 --- a/appendixa/makedev-shortdesc.xml +++ b/appendixa/makedev-shortdesc.xml @@ -1,7 +1,7 @@    -Contents of MAKEDEV +Contents of Make_devices -Installed script: MAKEDEV +Installed script: make_devices diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index ea37d74cc..5c874531b 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -6,6 +6,10 @@ +February 7th, 2004 [alex]: Chapter 6 - Creating devices: +replaced the MAKEDEV script with the make_devices script. Contributed by +Matthias Benkmann. + February 5th, 2004 [alex]: Chapter 6 - Simplified the final install of the kernel headers to just copying them from the temporary tools directory. diff --git a/chapter06/makedev.xml b/chapter06/makedev.xml index 0763e8c8f..3fce5fb6a 100644 --- a/chapter06/makedev.xml +++ b/chapter06/makedev.xml @@ -1,8 +1,9 @@ - -Creating devices with Makedev-&makedev-version; - + +Creating devices with Make_devices-&makedev-version; + -The MAKEDEV package contains a script for making device nodes. +The Make_devices package contains a script for creating device +nodes. &buildtime; &makedev-time; &diskspace; &makedev-compsize; @@ -15,62 +16,79 @@ Making devices -Note that unpacking the MAKEDEV-&makedev-version;.bz2 -file doesn't create a directory for you to cd into, as -the file contains only a shell script. +Note that unpacking the +make_devices-&makedev-version;.bz2 file doesn't +create a directory for you to cd into, as the file +contains only a shell script. + +Install the make_devices script: + +bzcat make_devices-&makedev-version;.bz2 > /dev/make_devices +chmod 754 /dev/make_devices + +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: mknod -m mode name type major +minor. In such a command, mode is the usual +octal read/write/execute permissions triplet, and name 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 /dev/null having their usual names. The remaining +three parameters tell the kernel what piece of hardware the device node +actually refers to. The type 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 major +and minor 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 devices.txt in +the Documentation subdirectory of the +kernel sources. + +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 type of device. + +Because looking up the type/major/minor triples and using +mknod manually is tedious and error-prone, the +make_devices script has been created. It contains a whole +series of mknod 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 make_devices 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: -Install the MAKEDEV script: - -bzcat MAKEDEV-&makedev-version;.bz2 > /dev/MAKEDEV -chmod 754 /dev/MAKEDEV +cd /dev +./make_devices -Run the script to create the device files: +(The FHS states that there should be a MAKEDEV +script present in the /dev directory. +But the FHS is mistaken: it should not dictate anything about files, and limit +itself to directories.) -cd /dev -./MAKEDEV -v generic-nopty - -The meaning of the arguments: - - --v: This tells the script to run in -verbose mode. - -generic-nopty: This instructs -MAKEDEV 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 -devpts file system. - - -If it turns out that some special device zzz that -you need is missing, try running ./MAKEDEV -v zzz. -Alternatively, you may create devices via the mknod -program. Please refer to its man and info pages if you need more -information. - -If you wish your system to be FHS-compliant, then the -MAKEDEV script has to remain present in the -/dev directory. This way it is always -available for making extra device nodes. - -Additionally, if you were unable to mount the devpts file system earlier -in , now is the time to try the alternatives. If -your kernel supports the devfs file system, run the following command to mount +If you had success with mounting the devpts file system earlier in , you can continue with the next section. If you were +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 devfs: mount -t devfs devfs /dev This will mount the devfs file system over the top of the new static -/dev structure. This poses no problems, as the device nodes -created are still present, they are just hidden by the new devfs -file system. - -If this still doesn't work, the only option left is to use the MAKEDEV -script to create the ptyXX and ttyXX range of files that would otherwise not be -needed. Ensure you are still in the /dev directory then run -./MAKEDEV -v pty. The downside of this is, we are -creating an extra 512 device special files which will not be needed when we -finally boot into the finished LFS system. +/dev structure. This poses no problems, as the device +nodes created are still present, they are just hidden by the new devfs file +system. + +If that didn't work either, the only option left is to create a few ptyXX +and ttyXX device nodes. To do this, open make_devices in +your editor, go to the section "Pseudo-TTY masters" and enable as many ptyXX +devices as you think you will need (one for every active xterm, ssh connection, +telnet connection, and so on). In the immediately following section "Pseudo-TTY +slaves", enable the corresponding ttyXX devices. When you are done, rerun +./make_devices from inside /dev to have +it create the new devices. diff --git a/entities/makedev.ent b/entities/makedev.ent index 205083673..2426a9259 100644 --- a/entities/makedev.ent +++ b/entities/makedev.ent @@ -5,11 +5,11 @@ - - - - - + + + + + - - + + -- cgit v1.2.3-54-g00ecf