People ask me how to do a debian chrooted environment.
Well, pay attention, since creating a chrooted environment should belong to the standard knowledge of any linux sysadmin.
PRE
- First of all: I assume an sd card, formatted with ext3. As we have seen, the only block filesystem the trendtac supports is ext3. So mkfs.ext3 your sd card. I cannot help you with that on how to do that. Sorry.
- Second of all: I assume you already have debian running somewhere. If not: make sure you get a working copy of debootstrap.
BOOTSTRAP
Make sure you have a working copy. I assume the sd ext3 is mounted under /mnt .
Also make sure that your Debian machine has access to a debian repository with full binary mipsel support (add deb
ftp://ftp.de.debian.org/.... to /etc/apt/sources.list)
Type in:
debootstrap --foreign --arch mipsel etch /mnt/debian-etch
After it completes, you have a more or less working debian. Yeay! The --foreign part makes sure that it will do whatever necessary to make a completable debootstrap image.
Oh nohs! It does not works!
Because of the cross architecture, we are halfway stranded with a debootstrap.
Stick your sd into your trendtac.
On the console, type:
chroot /SD/SD_1/debian-etch
Yes! We are halfway there...
Finish up:
/debootstrap/debootstrap --second-stage
I must confess that I have never ever run the second-stage that way. So I will try it again (just to test), but then for USB.
Finishing up
Fix up the /etc/passwd. That's about all.
We got ourselves a mipsel debian on the SD card. So what? The biggest thing is that you want to use it.
So here is how I make use of it:
#!/bin/sh
export DISPLAY=:0
export LD_ASSUME_KERNEL=2.4.1
DEB=/SD/SD_1/debian-etch
if ! grep -q $DEB/proc /proc/mounts || [ "$REMOUNT" = yes ]
then
if ! grep -q noatime /proc/mounts
then
mount -o remount,noatime /SD/SD_1
fi
if ! grep -q /proc/bus/usb /proc/mounts
then
mount -t usbdevfs usb /proc/bus/usb
fi
for i in /proc /tmp /dev /mnt/nandflash2 /proc/bus/usb
do
if ! grep -q $DEB$i /proc/mounts
then
mount -o bind $i $DEB$i
fi
done
if ! grep -q $DEB/realroot /proc/mounts
then
mount -o bind / $DEB/realroot
fi
fi
chroot $DEB "$@"
Yes, we bind mount everything we can, and thus we have a working system. We can X using unix-sockets instead of tcp.
Then we reach the most important thing:
aptitude install flight-of-the-amazon-queen beneath-a-steel-sky
Or just:
aptitude install scummvm
if you have other games yourself.
More
Fortunately, the libraries of the trendtac more or less match de library revisions of Debian/etch mipsel. This can make a few things easier:
(none):/realroot/root# ls -l de
lrwxrwxrwx 1 root root 20 Jul 1 19:30 de -> /SD/SD_1/debian-etch
(none):/realroot/root# cat bin/xterm
#!/bin/sh
export DISPLAY=:0
export LANG=en_US.UTF-8
de/usr/bin/xterm +lc -rv -u8 -geometry 131x37 -title localhost
(none):/realroot/root# ls -l bin/ssh
lrwxrwxrwx 1 root root 22 Jul 1 19:30 bin/ssh -> ../de/usr/bin/dbclient
(none):/realroot/root# cat bin/screen
#!/bin/sh
export DISPLAY=:0
export LANG=en_US.UTF-8
if
de/bin/ip ro get 82.197.200.127|grep "via 192.168.0.25 dev eth0"
then
HOST=192.168.0.42
else
HOST=82.197.200.127
fi
de/usr/bin/xterm +lc -rv -u8 -geometry 131x37 -title screen -e bin/ssh -t ard@${HOST} screen -x &
More on google
http://www.google.nl/search?q=debootstrap+howto
Notes
The trendtac libraries are really b0rken. Just type ls /lib . I've never ever seen ls segfault on a big directory. So try to minimize using mixed debian and trendtac libs. Sooner rather than later your xterm, ssh or whatever just will crash, and leave you wondering about what happened.
The beaty of unix is that applications have really well defined interfaces. We can communicate with the X-server through unix-sockets. We can talk to X-applications (like the window manager) through the X-server. We can talk to the kernel with system calls. No need for mixed-libraries.
Another note: DO NOT USE Debian/lenny . It needs a 2.6 kernel, not some stone age 2.4 kernel.