Debian Linux for CM-X300

From Compulab Mediawiki
Revision as of 05:59, 21 June 2009 by Mike (talk | contribs)
Jump to: navigation, search

Overview

The Linux file system for CompuLab CM-X300 module is based on Debian GNU/Linux 4.0 (etch) distribution and includes the following components:

  • Package manager (apt-get, dpkg …)
  • Telnet client
  • SSH server/client
  • FTP server/client
  • Web server thttpd
  • SAMBA
  • Editor – nano
  • Various Linux utilities (basic Debian set of utilities from debootstrap)
  • Madplay - command-line mp3 player
  • X Windows system with BlackBox window manager
  • Dillo (web browser), aterm – X Windows applications.

CM-X300 specific settings

Connection and Logging In

Use the following usernames and passwords to login:

Account with administrative privileges:

User: root
Password: 111111

Regular user account:

User: user	
Password: 111111

In addition to these accounts CM-X300 allows anonymous FTP access. To login into the Linux system, you may use a serial console (ttyS2) at 38400 bps, or connect through the network, or use a keyboard and LCD display (tty1, tty2, tty3).

IP Address

The IP addresses for both network interface are obtained automatically using DHCP. To configure networking, edit /etc/network/interfaces, /etc/resolv.conf, and /etc/hostname. For more information about Debian Linux network configuration read Network configuration chapter in the Debian Reference.

Consoles

Linux file system image is designed to suit different kernel versions and configurations. Therefore, during the operating system startup, consoles at several serial ports and VGA display are enabled. Some of these devices may not be supported either because of kernel versions incompatibilities or because the kernel was not configured to support these devices. When the console is enabled at such device the following or similar message will appear on active console: INIT: Id "T0" respawning too fast: disabled for 5 minutes This is not an error message, it is just a warning that can be eliminated by editing /etc/inittab file.

THTTPD Web Server

Use /etc/thttpd/thttpd.conf to configure THTTPD web server. The THTTP server is very sensitive to file permissions. In summary, data files should be mode 644 (rw-r--r--), directories should be 755 (rwxr-xr-x) if you want to allow indexing and 711 (rwx--x--x) to disallow it, and CGI programs should be mode 755 (rwxr-xr-x) or 711 (rwx--x--x). Try http://<your.target.ip.address>/users/thttpd.htm

X Windows system

CompuLab distribution contains small-footprint Kdrive based X Server optimized for embedded devices, and BlackBox window manager. Before starting X Windows, connect USB mouse and keyboard to the system. You can run X Windows by typing startx.

X server contained in CompuLab distribution supports screen rotation by 90, 180 and 270 degrees. To change screen resolution or color depth, or to enable screen rotation append option -screen <XRes>x<YRes>@<angle>x<bpp> option to X Server invocation command. XRes and YRes are horizontal and vertical screen resolution and angle is desired rotation angle, and bpp is color depth in bits. Note, that color depth change is not fully supported on PXA frame buffer device.

There are some X applications in distribution:

  • Aterm (X terminal)
  • Dillo (Web browser)

Touchscreen support

The X Windows system provided with CompuLab Debian Linux package supports touchscreen interface using on WM9715 controller. Touchscreen calibration can be performed with ts_calibrate utility. To calibrate the touchscreen make sure X Server is not running, load touchscreen driver and then type ts_calibrate:

modprobe snd-soc-cm-x300
modprobe wm97xx-ts
cd /sys/class/input
name=""
for tsdir in *; do
    if [ -f $tsdir/name ] ; then
        name=`cat $tsdir/name`
    fi;
    echo $name | grep -i "touchscreen" >& /dev/null
    if [ $? -eq 0 ] ; then
        name=`ls -1 $tsdir | grep event\[0-9\]`
        break;
    fi;
done;
export TSLIB_TSDEVICE=/dev/input/$name
ts_calibrate

For proper calibration you are required to touch the touchscreen corners and center in the following order: top-left, top-right, bottom-right, bottom-left, center. The calibration results are saved to file /etc/pointercal.

Wireless lan support

CompuLab Debian Linux package supports Wireless LAN on CM-X300L modules.

To enable Wireless LAN interface type:

modprobe libertas_sdio

The firmware for the Wireless LAN controller is included in the Debian Linux image and can be found at /lib/firmware directory.

To setup Wireless LAN parameters Linux standard ifconfig and iwconfig and wpa_supplicant utilities can be used.

MMC/SD

The support for MMC/SD card on CM-X300 is available as loadable kernel module. You need to

modprobe mmc_block
modprobe pxamci

to enable these drivers.

Afterwards, to mount the memory card, monitor /proc/partitions to see what partitions were detected on the MMC/SD card. Next, if there's approptiate device node in /dev, you can directly mount it, otherwise you should create the device node first. For example, suppose MMC/SD partition you'like to mount is mmcblk0p1 then:

if [ ! -b /dev/mmcblk0p1 ]; then mknod /dev/mmcblk0p1 b 253 1; fi
mount /dev/mmcblk0p1 /mnt/mmc

Software Management

Debian Linux for CM-X300 image includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.

Boot time optimization

The default Debian image for CM-X300 boot takes relatively much time. The delays during the boot are partially related to JFFS2 mount time and partially to Debian image configuration.

JFFS2 designed for robust operation in embedded environment where sudden power interruptions are frequent. As a trade off for reliability in this situations, JFFS2 has long mount time. The mount time scales linearly with flash partition size. To speed up the boot process you can partition the NAND flash so it'll contain relatively small partition holding root filesystem and another partition(s) for applications and data. Mounting of applications and data partitions can be done in the background concurrently with init scripts execution.

Another reason for slow boot is Debian configuration. We tried to make the Debian image for CM-X300 as generic as possible. Therefore it contains a lot of services that may not be required for your application. Removing the unneeded services will reduce the boot time. Also, we have not modified default Debian scripts to allow better system updatability. Because of it, one of the init scripts remounts and checks the root file system several times. You can amend /etc/init.d/checkroot.sh to skip root filesystem remounts and checks.

See also