Changeset 7e9d2b38


Ignore:
Timestamp:
07/20/2014 06:20:38 PM (10 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.6-blfs, 7.6-systemd, kde5-14269, kde5-14686, systemd-13485
Children:
4632152
Parents:
ab4735a7
Message:

Convert wpa_supplicant to systemd.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@13519 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TODO

    rab4735a7 r7e9d2b38  
    1 wpa_supplicant
    21provide systemd units for dhcpcd and dhclient
    32add separate bridge configuration for systemd-networkd
  • networking/netprogs/netprogs.xml

    rab4735a7 r7e9d2b38  
    3333  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="wget.xml"/>
    3434  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="wireless-tools.xml"/>
    35   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="wpa_supplicant.xml"/>
     35  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="wpa_supplicant-systemd.xml"/>
    3636  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="othernetprogs.xml"/>
    3737
  • networking/netprogs/wpa_supplicant-systemd.xml

    rab4735a7 r7e9d2b38  
    8787    <bridgehead renderas="sect4">Optional</bridgehead>
    8888    <para role="optional">
    89       <xref linkend="dbus"/>,
    90       <xref linkend="libxml2"/>, and
    9189      <xref linkend="qt4"/>
    9290    </para>
     
    169167    <para>
    170168      If you wish to use <application>WPA Supplicant</application> with
    171       <xref linkend="NetworkManager"/>, make sure that you have installed
    172       <xref linkend="dbus"/> and <xref linkend="libxml2"/>, then add the
    173       following options to the <application>WPA Supplicant</application>
    174       build configuration file by running the following command:
     169      <xref linkend="NetworkManager"/>, add the required options to
     170      the <application>WPA Supplicant</application> build configuration
     171      file by running the following command:
    175172    </para>
    176173
     
    182179
    183180    <para>
     181      First, fix expand the list of parameters that are passed to the
     182      <command>wpa_supplicant</command> when started as a
     183      <application>D-Bus</application> service:
     184    </para>
     185
     186<screen><userinput>sed -e "s@wpa_supplicant -u@&amp; -s -O /var/run/wpa_supplicant@g" -i wpa_supplicant/dbus/*.service.in &amp;&amp;
     187sed -e "s@wpa_supplicant -u@&amp; -s -O /var/run/wpa_supplicant@g" -i wpa_supplicant/systemd/wpa_supplicant.service.in</userinput></screen>
     188
     189    <para>
    184190      Install <application>WPA Supplicant</application> by running the
    185191      following commands:
     
    211217install -v -m644 doc/docbook/wpa_supplicant.conf.5 /usr/share/man/man5/ &amp;&amp;
    212218install -v -m644 doc/docbook/wpa_{cli,passphrase,supplicant}.8 /usr/share/man/man8/</userinput></screen>
     219
     220    <para>
     221      Install the <application>systemd</application> support files by
     222      running the following command as the <systemitem
     223      class="username">root</systemitem> user:
     224    </para>
     225
     226<screen role="root"><userinput>install -v -m644 systemd/*.service /lib/systemd/system/</userinput></screen>
    213227
    214228    <para>
     
    226240
    227241    <para>
     242      Additionally, enable the <filename>wpa_supplicant.service</filename> so that
     243      <application>systemd</application> can properly activate the
     244      <application>D-Bus</application> service. Run the following command as the
     245      <systemitem class="username">root</systemitem> user:
     246    </para>
     247
     248<screen role="root"><userinput>systemctl enable wpa_supplicant</userinput></screen>
     249
     250    <para>
    228251      If you have built the <application>WPA Supplicant</application> GUI
    229252      program, install it by running the following commands as the
     
    256279
    257280      <para>
    258         <filename>/etc/sysconfig/wpa_supplicant-*.conf</filename>
     281        <filename>/etc/wpa_supplicant/wpa_supplicant-*.conf</filename>
    259282      </para>
    260283
    261284      <indexterm zone="wpa_supplicant wpa_supplicant-config">
    262285        <primary
    263         sortas="e-etc-sysconfig-wpa_supplicant-star.conf">/etc/sysconfig/wpa_supplicant-*.conf</primary>
     286        sortas="e-etc-wpa_supplicant-wpa_supplicant-star.conf">/etc/wpa_supplicant/wpa_supplicant-*.conf</primary>
    264287      </indexterm>
    265288
     
    269292      <title>Configuration Information</title>
    270293
     294      <warning>
     295        <para>
     296          You need to replace <replaceable>wlan0</replaceable> with
     297          the correct wireless interface name in the commands below.
     298        </para>
     299      </warning>
     300
    271301      <para>
    272302        To connect to an access point that uses a password, you need to put
    273303        the pre-shared key in <filename>
    274         /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
     304        /etc/wpa_supplicant/wpa_supplicant-<replaceable>wlan0</replaceable>.conf</filename>.
    275305        SSID is the string that the access point/router transmits to
    276306        identify itself. Run the following command as the
     
    278308      </para>
    279309
    280 <screen role="root"><userinput>wpa_passphrase <replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> &gt; /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
    281 
    282       <para>
    283         <filename>/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf
     310<screen role="root"><userinput>install -v -dm755 /etc/wpa_supplicant &amp;&amp;
     311wpa_passphrase <replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> &gt; /etc/wpa_supplicant/wpa_supplicant-<replaceable>wlan0</replaceable>.conf</userinput></screen>
     312
     313      <para>
     314        <filename>/etc/wpa_supplicant/wpa_supplicant-<replaceable>wlan0</replaceable>.conf
    284315        </filename> can hold the details of several access points. When
    285316        <command>wpa_supplicant</command> is started, it will scan for the
     
    290321        If you want to connect to an access point that isn't password
    291322        protected, put an entry like this in <filename>
    292         /etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
     323        /etc/wpa_supplicant/wpa_supplicant-<replaceable>wlan0</replaceable>.conf</filename>.
    293324        Replace "Some-SSID" with the SSID of the access point/router.
    294325      </para>
     
    311342      <title>Connecting to an Access Point</title>
    312343
    313       <para id="wpa-service">
    314         If you want to configure network interfaces at boot using
    315         <command>wpa_supplicant</command>, you need to install the
    316         <filename>/lib/services/wpa</filename> script
    317         included in <xref linkend="bootscripts"/> package:
    318       </para>
    319 
    320 <screen role="root"><userinput>make install-service-wpa</userinput></screen>
    321 
    322       <indexterm zone="wpa_supplicant wpa-service">
    323         <primary sortas="f-wpa">wpa</primary>
    324       </indexterm>
    325 
    326       <para>
    327         If your router/access point uses DHCP to allocate IP addresses, you
    328         can install <xref linkend="dhcp"/> client and use it to
    329         automatically obtain network addresses. Create the
    330         <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
    331         </filename> by running the following command as the
    332         <systemitem class="username">root</systemitem> user:
    333       </para>
    334 
    335 <screen role="root"><userinput>cat &gt; /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
    336 <literal>ONBOOT="yes"
    337 IFACE="<replaceable>wlan0</replaceable>"
    338 SERVICE="wpa"
    339 
    340 # Additional arguments to wpa_supplicant
    341 WPA_ARGS=""
    342 
    343 WPA_SERVICE="dhclient"
    344 DHCP_START=""
    345 DHCP_STOP=""
    346 
    347 # Set PRINTIP="yes" to have the script print
    348 # the DHCP assigned IP address
    349 PRINTIP="no"
    350 
    351 # Set PRINTALL="yes" to print the DHCP assigned values for
    352 # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
    353 PRINTALL="no"</literal>
    354 EOF</userinput></screen>
    355 
    356       <para>
    357         If you prefer <xref linkend="dhcpcd"/> instead of
    358         <xref linkend="dhcp"/> client, then create the
    359         <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
    360         </filename> by running the following command as the
    361         <systemitem class="username">root</systemitem> user:
    362       </para>
    363 
    364 <screen role="root"><userinput>cat &gt; /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
    365 <literal>ONBOOT="yes"
    366 IFACE="<replaceable>wlan0</replaceable>"
    367 SERVICE="wpa"
    368 
    369 # Additional arguments to wpa_supplicant
    370 WPA_ARGS=""
    371 
    372 WPA_SERVICE="dhcpcd"
    373 DHCP_START="-b -q <replaceable>&lt;insert appropriate start options here&gt;</replaceable>"
    374 DHCP_STOP="-k <replaceable>&lt;insert additional stop options here&gt;</replaceable>"</literal>
    375 EOF</userinput></screen>
    376 
    377       <para>
    378         Alternatively, if you use static addresses on your local network,
    379         then create the
    380         <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
    381         </filename> by running the following command as the
    382         <systemitem class="username">root</systemitem> user:
    383       </para>
    384 
    385 <screen role="root"><userinput>cat &gt; /etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
    386 <literal>ONBOOT="yes"
    387 IFACE="<replaceable>wlan0</replaceable>"
    388 SERVICE="wpa"
    389 
    390 # Additional arguments to wpa_supplicant
    391 WPA_ARGS=""
    392 
    393 WPA_SERVICE="ipv4-static"
    394 IP="192.168.1.1"
    395 GATEWAY="192.168.1.2"
    396 PREFIX="24"
    397 BROADCAST="192.168.1.255"</literal>
    398 EOF</userinput></screen>
     344      <para>
     345        There are 3 types of <application>systemd</application> units
     346        that were installed:
     347      </para>
     348
     349      <itemizedlist spacing="compact">
     350        <listitem>
     351          <para>
     352            wpa_supplicant@.service
     353          </para>
     354        </listitem>
     355        <listitem>
     356          <para>
     357            wpa_supplicant-nl80211@.service
     358          </para>
     359        </listitem>
     360        <listitem>
     361          <para>
     362            wpa_supplicant-wired@.service
     363          </para>
     364        </listitem>
     365      </itemizedlist>
     366
     367      <para>
     368        The only difference between 3 of them is what driver
     369        is used for connecting (-D option). The first one uses
     370        the default driver, the second one uses the nl80211
     371        driver and the third one uses the wired driver.
     372      </para>
    399373
    400374      <para>
     
    404378      </para>
    405379
    406 <screen role="root"><userinput>ifup <replaceable>wifi0</replaceable></userinput></screen>
    407 
    408       <para>
    409         Replace <replaceable>wlan0</replaceable> with the correct
    410         wireless interface and <replaceable>wifi0</replaceable>
    411         with desired name for the configuration file. Please note
    412         that <filename>wpa_supplicant-*.conf</filename> and
    413         <filename>ifconfig.*</filename> configuration files need
    414         to have identical names, ie both contain
    415         <replaceable>wifi0</replaceable> in their name.
     380<screen role="root"><userinput>systemctl start wpa_supplicant@<replaceable>wlan0</replaceable></userinput></screen>
     381
     382      <para>
     383        To connect to the wireless access point at
     384        boot, simply enable the appropriate
     385        <command>wpa_supplicant</command> service
     386        by running the following command as the
     387        <systemitem class="username">root</systemitem> user:
     388      </para>
     389
     390<screen role="root"><userinput>systemctl enable wpa_supplicant@<replaceable>wlan0</replaceable></userinput></screen>
     391
     392      <para>
     393        Depending on your setup, you can replace the
     394        <filename>wpa_supplicant@.service</filename>
     395        with any other listed above.
     396      </para>
     397
     398      <para>
     399        To assign a network address to your wireless interface,
     400        consult the <ulink
     401        url="http://www.linuxfromscratch.org/lfs/view/systemd/chapter07/network.html">General Network Configuration</ulink>
     402        page in LFS.
    416403      </para>
    417404
Note: See TracChangeset for help on using the changeset viewer.