CubieTruck Cubieez Customization
Download and install Cubieez
- Download Cubieez from here (links and mirrors are at the end of the opening post)
- Install the image to an SD card or to NAND
- Restart the machine
Setting up the network
Setting up DHCP
nano /etc/network/interfaces
Edit the content of the file to look like the following:
auto lo iface lo inet loopback auto eth0 allow-hotplug-eth0 # configuring dynamic IP address for eth0 via DHCP iface eth0 inet dhcp
After saving the file restart the network, so we get a new IP address via DHCP
/etc/init.d/networking restart
Removing NetworkManager
It only caused me trouble, and since the network is not that hard to configure without it, i find that it's better to remove completely
apt-get purge network-manager network-manager-gnome
Updating the system
nano /etc/apt/sources.list
Change the mirror to something close to us, maybe us a sources.list generator
deb http://ftp.hu.debian.org/debian stable main contrib non-free deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free
Update the list of packages
apt-get update
Perform the upgrade (downloading and installing might take a while)
apt-get upgrade
Turning off the LEDs
Temporary solution
The following will turn off all the LEDs (except for the red power LED) until the next reboot
for i in /sys/class/leds/* ; do echo 0 > "$i"/brightness ; done
Permanent solution
Mount the boot partition, copy and edit script.fex, converted from the script.bin file found on the boot partition
mkdir -p /mnt/boot mount /dev/nanda /mnt/boot cp /mnt/boot/script.bin /tmp/script.bin bin2fex /tmp/script.bin /tmp/script.fex nano /tmp/script.fex
Find the line leds_used = 1
in the [leds_para]
section and change its value to 0
Convert and copy the modified script.bin to the boot partition, unmount and reboot
fex2bin /tmp/script.fex /tmp/script.bin cp /tmp/script.bin /mnt/boot/script.bin sync umount /mnt/boot reboot
Turning the leds back on
Same as above but change the leds_used
value to 1
Setting up the WiFi Access Point
Loading the WiFi interface module with the right options
Edit the /etc/modules file
nano /etc/modules
Add the module bcmdhd
to the end of the file
Add the AP mode option to the module by editing the /etc/modprobe.d/bcmdhd.conf file (might need to create one)
nano /etc/modprobe.d/bcmdhd.conf
Edit the file, so it looks like this
options bcmdhd op_mode=2
Configuring the WiFi interface
Rename the wlan interface
nano /etc/udev/rules.d/70-persistent-net.rules
Remove the unnecessary rules, and rename the bcmdhd device
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:90:4c:11:22:33", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
Set up a static address for the wlan interface
nano /etc/network/interfaces
Add the configuration to the end of the file
# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto eth0 allow-hotplug-eth0 auto wlan0 allow-hotplug-wlan0 # configuring dynamic IP address for eth0 via DHCP iface eth0 inet dhcp # configure manual IP address for wlan0 iface wlan0 inet static address 192.168.0.200 netmask 255.255.255.0 gateway 192.168.0.1
Installing hostapd
Download and install hostapd
apt-get install hostapd
Copy the sample configuration file and uncompress it
cd /etc/hostapd/ cp /usr/share/doc/hostapd/examples/hostapd.conf.gz /etc/hostapd/hostapd.conf.gz uncompress hostapd.conf.gz
Edit the hostapd configuration file
nano /etc/hostapd/hostapd.conf
Modify the following lines
logger_syslog=127 logger_stdout=127 ssid=<desired ssid> country_code=<country code> channel=<desired (least used) channel> auth_algs=1 wpa=2 wpa_passphrase=<very secret passphrase> wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
Edit the default configuration for the hostapd initscript
nano /etc/default/hostapd
Uncomment and modify the DAEMON_CONF
line
DAEMON_CONF="/etc/hostapd/hostapd.con"
Set hostapd to start automatically when the system boots
update-rc.d hostapd defaults
Just to be sure, check if everything is working
hostapd /etc/hostapd/hostapd.conf
Rebooting
Reboot your system
Install various useful tools
apt-get install mc screen wireless-tools