CubieTruck Cubieez Customization

From JMK Wiki
Jump to: navigation, search

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

# 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 stable main contrib non-free
deb wheezy-updates main contrib non-free
deb 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
umount /mnt/boot

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
auto wlan0

# configuring dynamic IP address for eth0 via DHCP
iface eth0 inet dhcp

# configure manual IP address for wlan0
iface wlan0 inet static

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

ssid=<desired ssid>
country_code=<country code>
channel=<desired (least used) channel>
wpa_passphrase=<very secret passphrase>

Edit the default configuration for the hostapd initscript

nano /etc/default/hostapd

Uncomment and modify the DAEMON_CONF line


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


Reboot your system

Install various useful tools

apt-get install mc screen wireless-tools