TS-4900 Debian from scratch

From embeddedTS Manuals

Build a Debian distribution for the i.MX6

Boot into another distribution and run:

debootstrap --arch=armhf wheezy /mnt/sd http://http.debian.net/debian/

Edit /etc/inittab to add the line:

 T0:23:respawn:/sbin/getty -L ttymxc0 115200 vt100

edit /etc/passwd and change:

 root:x:0:0:root:/root:/bin/bash

to

 root::0:0:root:/root:/bin/bash

This eliminates the need for a password for root.

Set a hostname:

echo "ts4900" > /etc/hostname

If you want a headless system, you are done. You may want to install common packages:

	apt-get install vim nano build-essential

If you want graphics these are required:

apt-get install xserver-xorg-dev x11proto-xf86dri-dev x11proto-render-dev x11proto-gl-dev libdrm-dev mesa-common-dev mesa-utils libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libglew1.6-dev libglui-dev libxmu-dev build-essential xutils-dev autoconf libtool libxv-dev gettext pkg-config -y

Install a graphical environment & login manager

apt-get install xfce4 lightdm -y

Set lightdm to automatically login as root

/usr/lib/arm-linux-gnueabihf/lightdm/lightdm-set-defaults --autologin root

Download Freescale's Linux BSP - L3.0.35_4.0.0_130424_source or newer. Copy gpu-viv-bin-mx6q-3.0.35-4.0.0.tar.gz and xserver-xorg-video-imx-viv-3.0.35-4.0.0.tar.gz to /root/.

cd ~/
tar -xf gpu-viv-bin-mx6q-3.0.35-4.0.0.tar.gz
cp -r gpu-viv-bin-mx6q-3.0.35-4.0.0/usr/ /
rm -rf gpu-viv-bin-mx6q-3.0.35-4.0.0.tar.gz  gpu-viv-bin-mx6q-3.0.35-4.0.0

# By default it installs links for the framebuffer acceleration.  
# This will change it to x11:
cd /usr/lib/
rm libGAL.so
rm libEGL.so
rm libEGL.so.1
rm libVIVANTE.so
ln -s libGAL-x11.so libGAL.so
ln -s libEGL-x11.so libEGL.so
ln -s libEGL-x11.so libEGL.so.1
ln -s libVIVANTE-x11.so libVIVANTE.so
cd -

tar -xf xserver-xorg-video-imx-viv-3.0.35-4.0.0.tar.gz
cd xserver-xorg-video-imx-viv-3.0.35-4.0.0

# The build script is designed for Ubuntu which includes more
# recent versions of software.  These next 4 lines account for the 
# build differences.
ln -s /usr/include/libdrm /usr/include/drm
sed --in-place 's/swapl(/cswapl(/' DRI_1.10.4/src/xf86dri.c
sed --in-place 's/swaps(/cswaps(/' DRI_1.10.4/src/xf86dri.c
sed --in-place 's/#include "xf86VGAarbiter.h"//' DRI_1.10.4/src/dri.c
./build.sh