Hello,
I just want to present a possible way of debian installation on usb stick or micro-SD card using debootstrap and how to boot debian. It'works very fine, even with a grafical xfce desktop connected over hdmi interface;-).
Maybe it's better way to do it. So it'would be great if could have some feedback or proposals for improvments!
-----------------------------------DEBIAN INSTALLATION-------------------------------------
#USB usb or micro-SD
--------------------------
setup toolchain
export PATH=$PATH\:/usr/local/src/arm/fs-toolchain-4.6.3-armv6-vfp/bin
export ARCH=arm
------------------------
#Download debian
apt-get install debootstrap
debootstrap --verbose --arch armel --foreign squeeze /usr/local/src/debian/ <!-- m --><a class="postlink" href="http://ftp.de.debian.org/debian">http://ftp.de.debian.org/debian</a><!-- m -->
-----------------------
#copy OS on USB stick or micro-SD
mkfs.ext3 /dev/sdx1 # format the partition
tune2fs -c 0 -i 0 /dev/sdx1 # fine tune the partition
mount /dev/sdx1 /mnt/ # mount the usbstick
cd /usr/local/src/debian # cd into debian filesystem
cp -ax . /mnt/ # copy filesystem on to usb stick or mmc card
umount /dev/sdx
-----------------------
#kernel modifications
#compile kernel without Default kernel command string
->Boot options
->Default kernel command string
#load needed device modules (optional) :
example uvc device driver for web cam usage
Device Drivers --->
<*> Multimedia support --->
<*> Video For Linux
[*] Load and attach frontend and tuner driver modules as needed
[*] Video capture adapters --->
[*] V4L USB devices --->
<*> USB Video Class (UVC)
[*] UVC input events device support
make
#if some modules were compiled
make modules modules_install
#copy directory /lib/modules/3.3.7-F+S to usb or micro-SD /lib/moudules
-------------------------
#On target
#mnt usb stick
mount/dev/sdx /mnt/
#change root
chroot /mnt/
#Install the second stage filesystem
/debootstrap/debootstrap --second-stage
export PATH=$PATH:/sbin
export LC_ALL=C
#Repair the module path
depmod -a
#Create entries for proc, then mount proc
echo "proc /proc proc defaults 0 0" >> /etc/fstab
mount -t proc proc /proc
vi /etc/inittab
#uncomment
#1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
#Add serial console support (very important)
T0:23:respawn:/sbin/getty -L ttySAC0 38400 vt100
#Setup hostname
echo "debian" > /etc/hostname
echo "127.0.0.1 debian" >> /etc/hosts
#Setup network
echo "## Loopback interface" >> /etc/network/interfaces
echo "auto lo" >> /etc/network/interfaces
echo "iface lo inet loopback" >> /etc/network/interfaces
echo "" >> /etc/network/interfaces
echo "## LAN interface" >> /etc/network/interfaces
echo "auto eth0" >> /etc/network/interfaces
echo "iface eth0 inet dhcp" >> /etc/network/interfaces
#set passwd
passwd
#benutzer hinzufügen
adduser xyz
-----------------------
#Set boot enviroment
#USB
setenv bootargs console=ttySAC0,38400 root=/dev/sda5 rw rootwait rootfstype=ext3 init=/sbin/init
#micro SD card
setenv bootargs console=ttySAC0,38400 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext3 init=/sbin/init
saveenv
boot
#should now boot into debian
#login as root
#configure apt-get
echo "deb <!-- m --><a class="postlink" href="http://ftp.de.debian.org/debian/">http://ftp.de.debian.org/debian/</a><!-- m --> squeeze main" >> /etc/apt/sources.list
echo "deb-src <!-- m --><a class="postlink" href="http://ftp.de.debian.org/debian/">http://ftp.de.debian.org/debian/</a><!-- m --> squeeze main" >> /etc/apt/sources.list
echo "" >> /etc/apt/sources.list
echo "deb <!-- m --><a class="postlink" href="http://security.debian.org/">http://security.debian.org/</a><!-- m --> squeeze/updates main" >> /etc/apt/sources.list
echo "deb-src <!-- m --><a class="postlink" href="http://security.debian.org/">http://security.debian.org/</a><!-- m --> squeeze/updates main" >> /etc/apt/sources.list
apt-get update
apt-get clean
##optional install
apt-get install openssh-server # remote login
apt-get install mtd-utils
apt-get install usbutils # check USB bus
apt-get install wireless-tools # wifi
apt-get install iw # wifi
apt-get install wpasupplicant # wifi
apt-get install file # check files
apt-get install less # better than more
apt-get install hdparm # benchmark usbstick
apt-get clean # clean the apt-get cache
-----------------------
#set back:
run bootubi
saveenv