Linux Kernel 3.8 later added support for kernel-loaded firmware, so systemd after v217 to go beyond user loading firmware support
Orangepi to the present (January 6, 2016) is still using the 3.4.39 kernel, which does not support the kernel load firmware. Wily (Ubuntu 15.10) uses the SYSTEMD is v225, does not support user-state loading firmware, so orangepi+wily in the case of firmware is unable to load.
To solve this problem, we need to use Udev's rule file to invoke an external program to load firmware
I have written such a program to load firmware, the code address is: Https://github.com/freason/orangepi_wily_firmware_loader.git
Here's how to use it:
1. Modify: "/lib/udev/rules.d/50-firmware.rules" This file, put
subsystem== "firmware", action== "Add", attr{loading}= "-1"
This line is replaced by:
subsystem== "firmware", action== "Add", run+= "firmware $env {firmware}/sys/$env {DEVPATH}"
2. Compile firmware.c with ARM-GCC to generate an executable named firmware, and copy the file to the/lib/udev directory of Orangepi
There are two ways, one is to compile directly under Orangepi, and the other is to use ARM-LINUX-GNUEABI-GCC for cross-compiling. The second way I used it, GitHub provided the version I compiled
3. Copy firmware to Orangepi/lib/firmware, Orangepi Wily does not provide firmware so we have to manually copy firmware from somewhere else, I copied it from Ubuntu on my PC.
The principle of firmware.c work:
When USB WiFi is plugged in, the RTL8192CU driver requests firmware, and the kernel creates two files loading and data. Where loading is the state of loading, 1 is loading, 0 is loading complete, 1 is error, we write these three strings to the loading file to notify the kernel of the corresponding message. Data is buffered, we write firmware data to the file, and the kernel reads the firmware data from the file.
Note: write loading this file cannot use bash in echo+ redirect, I tried, did not succeed. I did not study fopen's code carefully, but the mode used to open the file in firmware.c is "we", where E represents o_cloexec, see Http://linux.die.net/man/3/fopen, I don't know what the command in bash can do with this pattern.
Use USB WiFi (RTL8188CU/RTL8192CU) under ORANGEPI-PC, Ubuntu wily mini