Native compiling toolchain you can download from
here (thanx to nbd)
This post is summary of few first posts and wiki page, i spent a lot of time to get it working from scratch, but this way with prepared image is easier, quicker, (safer?). At the end i write some example how to compile samygo apps, because here isn`t any info how to do that, at least i didn`t find it (or info is poor and dropped on few topics). If you find mistakes/errors, please correct me.
I`ll update wiki, but to let you know, i`ll write here first.
On PC:
1. Enter as root (sudo su) and install
debootstrap:
Code: Select all
apt-get install deboostrap nfs-kernel-server nfs-common portmap
2. Create /armel-chroot directory on Ubuntu (i use vmware virtual image)
3. Mount image from archive:
Code: Select all
mount -o loop,offset=32256 /usr/hda2.img /armel-chroot
4. Export this directory as
NFS share.
4.1. Edit IP of TV and subnet mask:
Code: Select all
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
/armel-chroot 192.168.1.102/255.255.255.0(rw,sync,insecure,no_subtree_check,no_root_squash)
4.2 Renew nfs exports:
On TV
5. Download custom (chroot applet is needed)
busybox and place it to /mtd_rwarea/bin
5.1 Export busybox settings:
Code: Select all
export busybox=/mtd_rwarea/bin/busybox
6. Export other settings (change <server>:/path/to/armel-chroot to your settings first)
Code: Select all
export chroot_share=<server>:/path/to/armel-chroot
export armel_chroot=/dtv/usb/sda2/armel-chroot
mkdir -p $armel_chroot
mount -o rw,soft,udp,async,nolock,rsize=32768,wsize=32768 $chroot_share $armel_chroot
7. Make script to enter toolchain easier:
Code: Select all
#!/bin/sh
#options
export chroot_share=192.168.1.107:/armel-chroot
export armel_usb=/dtv/usb/sda2
export armel_chroot=/dtv/usb/sda2/armel-chroot
export busybox=/mtd_rwarea/bin/busybox
#====================================================================
#Create Folder for Mountpoints
#====================================================================
if [ `mount | grep -c $armel_usb` == 0 ]; then
mkdir -p $armel_usb
fi
#====================================================================
# Mounting the chroot nfs share
#====================================================================
if [ `mount | grep -c $armel_chroot` == 0 ]; then
echo "Mounting: chroot"
mkdir -p $armel_chroot
mount -o rw,soft,udp,async,nolock,rsize=32768,wsize=32768 $chroot_share $armel_chroot -t nfs
else
echo "$armel_chroot: already Mounted"
fi
#mount some important dirs
mount -o bind /dev $armel_chroot/dev
mount -o bind /dev/sam $armel_chroot/dev/sam
mount -o bind /dev/pts $armel_chroot/dev/pts
mount -o bind /proc $armel_chroot/proc
mount -o bind /proc/bus/usb $armel_chroot/proc/bus/usb
mount -o bind /sys $armel_chroot/sys
#bind resolv.conf
mount -o bind /etc/resolv.conf $armel_chroot/etc/resolv.conf
#start the chroot
#$busybox chroot $armel_chroot /bin/bash --login
$busybox chroot $armel_chroot /bin/bash --login
#umount
umount $armel_chroot/sys
echo "/sys unmounted"
umount $armel_chroot/proc/bus/usb
echo "/proc/bus/usb unmounted"
umount $armel_chroot/proc
echo "/proc unmounted"
umount $armel_chroot/dev/pts
echo "/dev/pts unmounted"
umount $armel_chroot/dev/sam
echo "/dev/sam unmounted"
umount $armel_chroot/dev
echo "/dev unmounted"
umount $armel_chroot/etc/resolv.conf
echo "/etc/resolv.conf unmounted"
# umount $armel_chroot
where 192.168.1.107 - IP of my Ubuntu mashine.
7.1 Change permissions:
Code: Select all
chmod 755 /mtd_rwarea/toolchain.sh
8. To start compilator, run this script:
Code: Select all
#/mtd_rwarea/toolchain.sh
Mounting: chroot
root@localhost:/#
8.1. To exit compilator and get back to TV`s console just enter:
8.2. NFS /armel_chroot is still mouted, you can find your directory under /dtv/usb/sda2/armel_chroot
How to compile ?
9. I give an example with samygo
Channelinfo.
9.1. Download the app source (it is usually placed inside the src directory) and place it somewhere inside compilation environment. (for example in /usr/src/apps)
9.2. Go to required direcotory:
9.3. If here is file, named
make.sh - run it and wait for result.
9.4. To compile manually:
Code: Select all
export PATH=$PATH:/usr/bin
arm-linux-gnueabi-gcc -O2 -c info.c -o loader.o
arm-linux-gnueabi-gcc -shared -Wl -o loader.so loader.o
9.5. Compiled file
loader.so is ready to use.
10. To compile with SDL, you need download and copy to right places
missing libraries.