...
Follow these steps to create a debian wheezy root filesystem. In this section we will use # host
to indicate commands run on the host machine, and # chroot
for commands commands run inside the chroot filesystem.
Install dependencies:
Code Block # host sudo apt-get install multistrap qemu-user-static
- Pick a working folder, in this case
~/duovero
Create a directory to hold the root filesystem:
Code Block # host cd ~/duovero mkdir rootfs
Create a configuration file debian.conf in ~/duovero and paste in the following. Additional packages can be included here or installed later using apt-get.
Code Block [General] arch=armel directory=~/duovero/rootfs retainsources=~/duovero/sources cleanup=true noauth=true unpack=true bootstrap=Wheezy Net Utils aptsources=Wheezy [Wheezy] packages=apt locales udev adduser sudo nano build-essential less source=http://mv.ezproxy.com.ezproxyberklee.flo.org/debian suite=wheezy [Net] packages=netbase ifupdown iproute net-tools iputils-ping ntp source=http://mv.ezproxy.com.ezproxyberklee.flo.org/debian [Utils] packages=wget source=http://mv.ezproxy.com.ezproxyberklee.flo.org/debian
Run multistrap to create the root filesystem.
Code Block # host sudo multistrap -a armel -d ~/duovero/rootfs -f debian.conf
In ubuntu 14.04 you may need to remove $forceyes from /usr/sbin/multistrap at line 989
Copy the QEMU ARM emulator into the new root filesystem so it is on the path when we chroot in.
Code Block # host sudo cp /usr/bin/qemu-arm-static ~/duovero/rootfs/usr/bin/
(Optional) If you need
/dev/random
(for installing openssh-server for example), mount/dev
in the chroot.Code Block # host sudo mount -o bind /dev ~/duovero/rootfs/dev
Chroot into the new filesystem.
Code Block # host sudo chroot ~/duovero/rootfs /bin/bash
Finish setting up packages
Code Block # chroot dpkg --configure -a
Answer "no" when prompted to use "dash" as "/bin/sh". If any packages fail to configure (possibly
ifupdown
), just rundpkg
again.Set the root user password.
Code Block # chroot passwd
(Optional) Add a new user and give it sudo permissions
Code Block # chroot adduser mit printf "mit ALL=(ALL) ALL" >> /etc/sudoers
Configure locales. Choose 138 for en_US.UTF-8.
Code Block # chroot dpkg-reconfigure locales
Add a DNS server
Code Block # chroot printf "nameserver 8.8.8.8" > /etc/resolv.conf
Add a static network entry for
eth0
(install theisc-dhcp-client
package for dhcp support)Code Block # chroot nano /etc/network/interfaces auto eth0 iface eth0 inet static address 192.168.1.102 netmask 255.255.255.0 gateway 192.168.1.1
Restart networking to apply the new interface.
Code Block # chroot /etc/init.d/networking restart
This might yield an error, but try pinging something anyways and it should work.
Update the apt repositories
Code Block # chroot apt-get update
Assign a hostname and update the hosts file
Code Block # chroot printf "nostromo" > /etc/hostname printf "127.0.0.1 nostromo\n" >> /etc/hosts
Add the serial console (specific to gumstix overo and duovero)
Code Block # chroot printf "T0:2345:respawn:/sbin/getty -L 115200 ttyO2 vt102\n" >> /etc/inittab
Add a proc filesystem to fstab
Code Block # chroot nano /etc/fstab # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0
...
Code Block |
---|
# chroot cd /etc/init.d sudo ln -s /home/mit/joshhoverland/hovergroup/third_party/josh_rtklib/start_silvana.sh start_silvana.sh sudo ln -s /home/mit/joshhoverland/hovergroup/third_party/josh_rtklib/start_rtkrcv.sh start_rtkrcv.sh sudo update-rc.d start_silvana.sh defaults sudo update-rc.d start_rtkrcv.sh defaults |
...