Installing Debian 7.X (Wheezy)

From Ambedded
Jump to: navigation, search


Prepare a Debian or Ubuntu build host and install software prerequisites

apt-get install binfmt-support qemu qemu-user-static debootstrap

Create the rootfs directory

mkdir /armdebian7

Boostrap the target system

debootstrap --foreign --arch armhf wheezy /armdebian7

Copy quemu to target system for later chrooting into it

cp /usr/bin/qemu-arm-static /armdebian7/usr/bin

Run second stage boostrap

LC_ALL=C LANGUAGE=C LANG=C chroot /armdebian7/ /debootstrap/debootstrap --second-stage

Trigger post install scripts

DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot /armdebian7/ dpkg --configure -a

Configure the target system

mount the proc filesystem into the target system

mount -t proc proc /armdebian7/proc

edit /armdebian7/etc/inittab and add this line at the bottom for serial console

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

also comment out (put a # before) those lines in the file since we don't need any terminal console at all, beside the the serial one.

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

copy or create an /etc/hosts file for the target system

cp /etc/hosts /armdebian7/etc/hosts

create an apt source file for target system, if not existant

touch /armdebian7/etc/apt/sources.list

and insert or check for the presence of the following lines in it

deb wheezy main contrib non-free
deb-src wheezy main contrib non-free
deb wheezy-updates main contrib non-free
deb-src wheezy-updates main contrib non-free

edit /armdebian7/etc/network/interfaces and add those lines, if not present

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

Chroot in the target system

chroot /armdebian7

and install all the other packages you will need for your base system, for example

apt-get update
apt-get install vim ssh xfsprogs btrfs-tools ntp

also setup the root password


and then exit the chroot


unmount the proc filestem from target

umount /armdebian7/proc

Target system is now ready, follow Transferring the base system to write it to the HDD/SSD

Personal tools