User:Rellla


 * apt-get install cmake shtool swig autoconf autotool automake libtool default-jre gawk gperf zip
 * g++-4.6-arm-linux-gnueabihf
 * symlinks gcc -> gcc-4.6 etc...
 * emdebian dependencies for 4.6-armhf toolchain are broken on sid (g++-4.6): do a "xapt -a armhf -m libstdc++6-4.6-dev" to fix

Recovered Debian page, after it was moved or deleted or whatever... I found it very useful, though.

Host system for this howto was a Debian/unstable.

Proceeding on other Debian Releases and Ubuntu (not tested) should be similar. Check emdebian.org and rhombus-tech.net. In this howto you will end up with a bootable sd-card containing a Debian Wheezy armhf-rootfs.

Setting up the cross compiling environment
Toolchain

Building a Debian-armhf rootfs
Set up your working directory and mount empty filesystem: mkdir melehacking cd melehacking mkdir debfs-armhf dd if=/dev/zero of=debfs_armhf.img bs=1M count=2048 mkfs.ext3 -F debfs_armhf.img mount -o loop debfs_armhf.img debfs-armhf Create Debian/stable/armhf filesystem using debootstrap: debootstrap --verbose --arch armhf --variant=minbase --foreign wheezy debfs-armhf http://ftp.debian.org/debian To chroot into your new filesystem and finish debootstrapping, you have to do some more things: apt-get install qemu-user-static binfmt-support cp /usr/bin/qemu-arm-static debfs-armhf/usr/bin mkdir debfs-armhf/dev/pts After a reboot or umount of your filesystem, you have to do the following steps once again: modprobe binfmt_misc mount -t devpts devpts debfs-armhf/dev/pts mount -t proc proc debfs-armhf/proc Now chroot into your new filesystem: chroot debfs-armhf/ /debootstrap/debootstrap --second-stage At any time you can chroot into your filesystem and install armhf-packages via "apt-get install". Alternatively you can boot your rootfs and do the things there. But chrooting is a good way, to install dependencies and includes for things you want to cross compile using a more powerful host. Maybe you can chroot into your rootfs in order to set up a full build-environment for armhf and compile packages directly in chroot (not tested yet). For cross compiling you have to link to your headers only to the armhf-versions in rootfs while doing ./configure and make on your host rootfs.
 * 1) You should see "I have no name!@hostname:/#"
 * 1) At the end, you should see "I: Base system installed successfully."

Configure the new rootfs
Still staying in chroot, make some adaptions of your filesystem. cat < /etc/apt/sources.list deb http://ftp.debian.org/debian/ wheezy main contrib non-free deb-src http://ftp.debian.org/debian/ wheezy main contrib non-free deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free END apt-get update export LANG=C apt-get install apt-utils dialog locales dpkg-reconfigure locales export LANG=en_US.UTF-8 apt-get install dhcp3-client udev netbase ifupdown iproute openssh-server iputils-ping wget \ net-tools ntpdate ntp vim nano less tzdata console-tools module-init-tools mc cat < /etc/network/interfaces auto lo eth0 allow-hotplug eth0 iface lo inet loopback iface eth0 inet dhcp END echo debian > /etc/hostname cat < /etc/fstab # /dev/root     /               ext3    noatime,errors=remount-ro 0 1 tmpfs         /tmp            tmpfs   defaults          0       0 END echo 'T0:2345:respawn:/sbin/getty -L ttyS0 115200 linux' >> /etc/inittab sed -i 's/^\([3-6]:.* tty[3-6]\)/#\1/' /etc/inittab passwd exit Download a Debian Wheezy armhf-rootfs made with this tutorial (rootpw="password"). Neither kernel nor kernel-modules are included.
 * First add your apt-sources:
 * Configure language:
 * 1) Choose en_US.UTF-8 for both prompts, or whatever you want.
 * Install some important stuff:
 * Configure ethernet with dhcp and set hostname:
 * Create filesystem mounts:
 * 1) /etc/fstab: static file system information.
 * Activate remote console and disable some local consoles.
 * Set the root password and exit:

Set up a bootable SD-card with debian-rootfs

 * Create u-boot, kernel, script.bin and boot.cmd following FirstSteps. Skip the toolchain section and set up cross compiler like described above.
 * Format the root partition of your sd-card, mount it and copy your newly created rootfs to your sd-card.
 * Don't forget the modules, you created while kernel-building!
 * If everything is set up right, you can now boot into your new debian and do whatever you want.