makedev.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <sect1 id="ch-system-MAKEDEV" xreflabel="Makedev">
  2. <title>Creating devices with Makedev-&makedev-version;</title>
  3. <?dbhtml filename="makedev.html" dir="chapter06"?>
  4. <para>The MAKEDEV package contains a script for making device nodes.</para>
  5. <screen>&buildtime; &makedev-time;
  6. &diskspace; &makedev-compsize;</screen>
  7. &aa-makedev-down;
  8. &aa-makedev-dep;
  9. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  10. <sect2>
  11. <title>Making devices</title>
  12. <para>Note that unpacking the <filename>MAKEDEV-&makedev-version;.bz2</filename>
  13. file doesn't create a directory for you to <userinput>cd</userinput> into, as
  14. the file contains only a shell script.</para>
  15. <para>Install the <userinput>MAKEDEV</userinput> script:</para>
  16. <screen><userinput>bzcat MAKEDEV-&makedev-version;.bz2 &gt; /dev/MAKEDEV
  17. chmod 754 /dev/MAKEDEV</userinput></screen>
  18. <para>Run the script to create the device files:</para>
  19. <screen><userinput>cd /dev
  20. ./MAKEDEV -v generic-nopty</userinput></screen>
  21. <para>The meaning of the arguments:</para>
  22. <itemizedlist>
  23. <listitem><para><userinput>-v</userinput>: This tells the script to run in
  24. verbose mode.</para></listitem>
  25. <listitem><para><userinput>generic-nopty</userinput>: This instructs
  26. <userinput>MAKEDEV</userinput> to create a generic selection of commonly used
  27. device special files, except for the ptyXX and ttyXX range of files. We don't
  28. need those files because we are going to use Unix98 PTYs via the
  29. <emphasis>devpts</emphasis> file system.</para></listitem>
  30. </itemizedlist>
  31. <para>If it turns out that some special device <filename>zzz</filename> that
  32. you need is missing, try running <userinput>./MAKEDEV -v zzz</userinput>.
  33. Alternatively, you may create devices via the <userinput>mknod</userinput>
  34. program. Please refer to its man and info pages if you need more
  35. information.</para>
  36. <para>If you wish your system to be FHS-compliant, then the
  37. <filename>MAKEDEV</filename> script has to remain present in the
  38. <filename class="directory">/dev</filename> directory. This way it is always
  39. available for making extra device nodes.</para>
  40. <para>Additionally, if you were unable to mount the devpts filesystem earlier
  41. in <xref linkend="ch-system-proc"/>, now is the time to try the alternatives. If
  42. your kernel supports the devfs file system, run the following command to mount
  43. devfs:</para>
  44. <screen><userinput>mount -t devfs devfs /dev</userinput></screen>
  45. <para>This will mount the devfs file system over the top of the new static
  46. <filename>/dev</filename> structure. This poses no problems, as the device nodes
  47. created are still present, they are just hidden by the new devfs
  48. filesystem.</para>
  49. <para>If this still doesn't work, the only option left is to use the MAKEDEV
  50. script to create the ptyXX and ttyXX range of files that would otherwise not be
  51. needed. Ensure you are still in the <filename>/dev</filename> directory then run
  52. <userinput>./MAKEDEV -v pty</userinput>. The downside of this is, we are
  53. creating an extra 512 device special files which will not be needed when we
  54. finally boot into the finished LFS system.</para>
  55. </sect2>
  56. &aa-makedev-shortdesc;
  57. &aa-makedev-desc;
  58. </sect1>