Changeset faa6467 in clfs-embedded


Ignore:
Timestamp:
Nov 9, 2006, 10:54:09 PM (16 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
master
Children:
99fc891
Parents:
492e5a3
Message:

Removed Information that is not necessary for embedded systems.
Added udev
Added udev-rules
Added variables for toolchains

Location:
BOOK
Files:
2 added
5 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • BOOK/bootscripts/chapter.xml

    r492e5a3 rfaa6467  
    1616  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/udev-rules.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/usage.xml"/>
    18   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/udev.xml"/>
    1918  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/setclock.xml"/>
    2019  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/console.xml"/>
    21   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/sysklogd.xml"/>
    22   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/inputrc.xml"/>
    23   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/profile.xml"/>
    2420  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/hostname.xml"/>
    2521  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/hosts.xml"/>
    26   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/symlinks.xml"/>
    2722  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/network.xml"/>
    2823
  • BOOK/bootscripts/common/network.xml

    r492e5a3 rfaa6467  
    2323  symlinks from all run-level directories (<filename
    2424  class="directory">/etc/rc.d/rc*.d</filename>).</para>
    25 
    26   <sect2>
    27     <title>Creating stable names for network interfaces</title>
    28 
    29     <para>Instructions in this section are optional if you have only one
    30     network card.</para>
    31 
    32     <para>With Udev and modular network drivers, the network interface numbering
    33     is not persistent across reboots by default, because the drivers are loaded
    34     in parallel and, thus, in random order. For example, on a computer having
    35     two network cards made by Intel and Realtek, the network card manufactured
    36     by Intel may become <filename class="devicefile">eth0</filename> and the
    37     Realtek card becomes  <filename class="devicefile">eth1</filename>. In some
    38     cases, after a reboot the cards get renumbered the other way around. To
    39     avoid this, create Udev rules that assign stable names to network cards
    40     based on their MAC addresses or bus positions.</para>
    41 
    42     <para>If you are going to use MAC addresses to identify your network
    43     cards, find the addresses with the following command:</para>
    44 
    45 <screen role="nodump"><userinput>grep -H . /sys/class/net/*/address</userinput></screen>
    46 
    47     <para>For each network card (but not for the loopback interface),
    48     invent a descriptive name, such as <quote>realtek</quote>, and create
    49     Udev rules similar to the following:</para>
    50 
    51 <screen role="nodump"><userinput>cat &gt; /etc/udev/rules.d/26-network.rules &lt;&lt; EOF
    52 <literal>ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="<replaceable>00:e0:4c:12:34:56</replaceable>", \
    53     NAME="<replaceable>realtek</replaceable>"
    54 ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="<replaceable>00:a0:c9:78:9a:bc</replaceable>", \
    55     NAME="<replaceable>intel</replaceable>"</literal>
    56 EOF</userinput></screen>
    57 
    58 <!-- Yes, I know that VLANs are beyond BLFS. This is not the reason to get them
    59      incorrect by default when every distro does this right. -->
    60 
    61     <note>
    62       <para>Although the examples in this book work properly, be aware
    63       that Udev does not recognize the backslash for line continuation.
    64       If modifying Udev rules with an editor, be sure to leave each rule
    65       on one physical line.</para>
    66     </note>
    67 
    68     <para>If you are going to use the bus position as a key, create
    69     Udev rules similar to the following:</para>
    70 
    71 <screen role="nodump"><userinput>cat &gt; /etc/udev/rules.d/26-network.rules &lt;&lt; EOF
    72 <literal>ACTION=="add", SUBSYSTEM=="net", BUS=="<replaceable>pci</replaceable>", ID=="<replaceable>0000:00:0c.0</replaceable>", \
    73     NAME="<replaceable>realtek</replaceable>"
    74 ACTION=="add", SUBSYSTEM=="net", BUS=="<replaceable>pci</replaceable>", ID=="<replaceable>0000:00:0d.0</replaceable>", \
    75     NAME="<replaceable>intel</replaceable>"</literal>
    76 EOF</userinput></screen>
    77 
    78     <para>These rules will always rename the network cards to
    79     <quote>realtek</quote> and <quote>intel</quote>, independently
    80     of the original numbering provided by the kernel (i.e.: the original
    81     <quote>eth0</quote> and <quote>eth1</quote> interfaces will no longer
    82     exist, unless you put such <quote>descriptive</quote> names in the NAME
    83     key). Use the descriptive names from the Udev rules instead
    84     of <quote>eth0</quote> in the network interface configuration files
    85     below.</para>
    86 
    87     <para>Note that the rules above don't work for every setup. For example,
    88     MAC-based rules break when bridges or VLANs are used, because bridges and
    89     VLANs have the same MAC address as the network card. One wants to rename
    90     only the network card interface, not the bridge or VLAN interface, but the
    91     example rule matches both. If you use such virtual interfaces, you have two
    92     potential solutions. One is to add the DRIVER=="?*" key after
    93     SUBSYSTEM=="net" in MAC-based rules which will stop matching the virtual
    94     interfaces.  This is known to fail with some older Ethernet cards because
    95     they don't have the DRIVER variable in the uevent and thus the rule does
    96     not match with such cards. Another solution is to switch to rules that use
    97     the bus position as a key.</para>
    98 
    99     <para>The second known non-working case is with wireless cards using the
    100     MadWifi or HostAP drivers, because they create at least two interfaces with
    101     the same MAC address and bus position. For example, the Madwifi driver
    102     creates both an athX and a wifiX interface where X is a digit.  To
    103     differentiate these interfaces, add an appropriate KERNEL parameter such as
    104     KERNEL=="ath*" after SUBSYSTEM=="net".</para>
    105 
    106     <para>There may be other cases where the rules above don't work. Currently,
    107     bugs on this topic are still being reported to Linux distributions, and no
    108     solution that covers every case is available.</para>
    109 
    110   </sect2>
    11125
    11226  <sect2>
  • BOOK/bootscripts/common/udev-rules.xml

    r492e5a3 rfaa6467  
    2626    <title>Installation of Udev-Rules</title>
    2727
    28     <para os="a">Install the package:</para>
     28<para os="a">Install the package:</para>
    2929
    30 <screen os="b"><userinput>make DESTDIR=${CLFS} install</userinput></screen>
     30<screen os="b"><userinput>make DESTDIR=${CLFS}</userinput></screen>
    3131
    3232  </sect2>
     
    9191          <indexterm zone="ch-scripts-udev-rules z50-udev.rules">
    9292            <primary sortas="d-50-udev.rules">50-udev.rules</primary>
    93           </indexterm>
    94         </listitem>
    95       </varlistentry>
    96 
    97       <varlistentry id="z55-sound.rules">
    98         <term><command>55-sound.rules</command></term>
    99         <listitem>
    100           <para>Gives proper permissions to audio device and restores sound
    101           volumes.</para>
    102           <indexterm zone="ch-scripts-udev-rules z55-sound.rules">
    103             <primary sortas="d-55-sound.rules">55-sound.rules</primary>
    10493          </indexterm>
    10594        </listitem>
     
    182171
    183172</sect1>
     173
  • BOOK/final-system/x86-chapter.xml

    r492e5a3 rfaa6467  
    1414  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/introduction.xml"/>
    1515  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/pkgmgt.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables.xml"/>
    1617  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/busybox.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/udev.xml"/>
    1719
    1820</chapter>
Note: See TracChangeset for help on using the changeset viewer.