A network connection is necessary for down-loading extensions from within dCore. If the computer only has wireless connection then one must set that up from the command line as first thing. Once one has a functional graphical desktop the tools are more comfortable to use.
We assume a basic dCore installation, notably with already set-up tce-directory 'tce/' (cf. sample installations).
Setting up dCore on a computer without Ethernet connection, wireless extensions must be “side-loaded” into the tce-directory, that is the down-load must be performed from another installation.
Down-load all the 'wireless*' files from the 'sce/'-folder at the download repository into 'tce/sce'. If you need NDISwrapper for using Windows-drivers then also down-load those files.
wireless-<KERNEL>-tinycore.sce consists of drivers for wireless radios whereas wireless consists of the necessary utilities like 'iwconfig' etc.
If you have a functional network connection then launch sce-import
for wireless, wireless-<KERNEL>-tinycore and, if applicable, ndis-wrapper-modules-<KERNEL>-tinycore.
From within dCore, issue sce-load
for the extensions.
Let <IF> denote the wireless interface name (e.g. “wlan0”); it can be determined by issueing iwconfig
. The recommended way to go about establishing a wireless network connection is by using 'wifi.sh'; only more complex situations should necessitate the manual calling of 'wpa_supplicant'.
The installed extensions provide the command 'wifi.sh' which allows for quickly establishing a connection in a WEP/WPA-protected wireless network. It maintains a database of credentials in '~/wifi.db'.
For quickly establishing a connection in a standard wireless network, issue 'sudo wifi.sh', select the network and enter the credentials. Assuming that there is a DHCP-server available, the configuration will automatically be determined.
The -w
option makes the program wait indefinitely until a lease is obtained.
Using the -p
option, the network configuration can be determined manually by entering IP-address, net mask, gateway and DNS-server address.
'wpa_supplicant' is called, together with 'wpa_passphrase' in 'wifi.sh'. Only the basic usage is outlined here; for different set-ups, please confer, e.g. to the Archlinux Wiki or also a thorough explanation of the WPA-supplicant and its configuration file.
The following steps will give you access to one specific wireless network.
sudo iwlist scanning | less
and search for “ESSID”chmod
it to 600-permissions.network={ ssid="YOUR_ESSID" psk="YOUR_PASSWORD" }
Alternatively, one may use 'wifi.sh' which will create the file with the password hashed. The clear-text password is commented out and may be deleted.
Alternatively, the key file may be generated by use of the configuration tool WPA-cli.
Following the excellent presentation in the Archlinux wiki, this procedure will automate the writing of the configuration file by use of the semi-interactive tool 'wpa_cli'. It has quite an impressive list of features and probably can be helpful in many kinds of situations; wpa_cli –help
gives a complete list of available commands.
In order to use WPA-cli, a control interface must be specified for WPA-supplicant, and it must be given the rights to update the configuration. Do this by creating a minimal configuration file '/etc/wpa_supplicant.conf' with 600-permissions.
ctrl_interface=/var/run/wpa_supplicant update_config=1
Launch WPA-supplicant in the background and afterwards WPA-cli.
sudo wpa_supplicant -B -i <IF> -c /etc/wpa_supplicant.conf sudo wpa_cli
In the interactive interface, scan for available networks.
scan scan_results
From the list, one can create network connections, labeled by numbers.
add_network set_network 0 ssid "<YOUR_ESSID>" set_network 0 psk "<YOUR_PASSWORD>"
NB: the hyphens around the strings are mandatory!
Connect to the network and save the configuration
enable_network 0 save_config
This will up-date 'wpa_supplicant.conf' with the settings for this network. This step may be repeated for different networks.
The control interface of WPA-supplicant can be configured to allow non-root user access (ctrl_interface GROUP= parameter in the configuration file). This would make it possible to run WPA-cli with a normal user account. We do not delve into this realm. For most flexibility, the use of WPA-gui from the graphical desktop is recommended.
sudo wpa_supplicant -i <IF> -c /etc/wpa_supplicant.conf &
connects to the network. iwconfig
should then show the connection.
sudo udhcpc -b -i <IF> -x hostname <HOSTNAME> -p /var/run/udhcpc.<IF>.pid'
acquires a DHCP-lease. 'ifconfig' should then show the IP-address as “inet addr”.
Pinging any IP-address should work now.
The configuration file can be made persistent by adding “/etc/wpa_supplicant.conf” to '/opt/.filetool.lst' and issueing backup
.
Note that the folder '/etc/wpa_supplicant' will be mounted from the wireless extension as an overlay-filesystem, though that does not interfere with the configuration file.
The above set-up procedure can be made persistent by the following steps. As said, one may want to handle wireless through the graphical desktop which offers more flexibility. In that case, one will then want to revert these steps.
Add “wireless” and “wireless-<KERNEL>-tinycore” (and “ndiswrapper-modules-<KERNEL>-tinycore” if applicable) to '/etc/sysconfig/tcedir/sceboot.lst'
Add the following lines to '/opt/bootlocal.sh'.
/sbin/wpa_supplicant -B -i <IF> -c /etc/wpa_supplicant.conf /bb/udhcpc -b -i <IF> -x hostname $(hostname) -p /var/run/udhcpc.<IF>.pid
If Syslog is running, one may want to add the option -s
for WPA-supplicant and -S > /dev/null 2>&1
for UDHCP-client.
Once a graphical desktop is available, the installed extensions (wireless, wireless-<KERNEL>-tinycore and, if applicable, ndis-wrapper-modules-<KERNEL>-tinycore) provide a menu item (for instance in Wbar and the entry “Wifi” in the applications section of the Flwm-menu). It will launch 'wifi.sh' in a terminal window, while accessing the same database of credentials in '~/wifi.db'.
If wifi.sh
takes a long time trying to connect to the network, it will eventually hit a time-out and then continue with udhcpc
which won't succeed either, naturally.
A useful first step for localizing the cause of trouble is the manual configuration as outlined above. wpa_supplicant
prints out debug-messages with the -d
option (or even -dd
).
For older wireless hardware (e.g. Intel PRO/Wireless 2100), the modern driver nl80211 (user space, i.e. the one of wpa_supplicant, not the kernel driver) may need to be replaced. Try -D wext
if the command should fail with an error message about the standard driver nl80211 (cf. wpa_supplicant –h
or also the respective section of the Archlinux-Wiki).
Unfortunately, there is no way to specify the driver in 'wpa_supplicant.conf'. Thus one has to either manually call 'wpa_supplicant' with the -D wext
option; or one may patch the file 'wifi.sh'. For the latter, follow these steps:
wireless
extensionwireless
extension yet!-D wext
to line 113 containing the call to 'wpa_supplicant'backup
From then on, 'wifi.sh' will call 'wpa_supplicant' with the desired driver.