Update: There are (more up-to-date) automated scripts which you can use for the below actions:
- You need to checkout the whole Bifferboard SVN repository.
- The scripts are located in the directory “/debian/rootfs“. Execute them from the checked out repository on your local computer.
First you have to mount a medium on which we are going to install the Debian system. Generally, you have two options:
- Using a USB Flash drive:
## MAKE SURE THAT YOU UPDATE THIS
$ export ROOTDEV=/dev/sdc1
$ sudo mkfs.ext3 $ROOTDEV
$ sudo tune2fs -c 0 -i 0 $ROOTDEV
$ export MNTPOINT=/mnt/diskimage
$ sudo mount $ROOTDEV $MNTPOINT
- Using a Qemu image:
$ export MNTPOINT=/mnt/diskimage
$ export IMGFILE=hd0.img
$ sudo mount -o loop,offset=32256 "$IMGFILE" $MNTPOINT
Once we have the medium mounted at $MNTPOINT, we can proceed with installing Debian there and configuring it for Bifferboard:
$ export DBS_OS_VERSION=lenny
## replace "bg." with your local archive, or just omit it
$ export DBS_LOCAL_ARCHIVE=bg.
$ sudo debootstrap --arch i386 ${DBS_OS_VERSION} $MNTPOINT/ http://ftp.${DBS_LOCAL_ARCHIVE}debian.org/debian
## ... go grab a pizza or something ... this will take a while
$ sudo cp /etc/resolv.conf $MNTPOINT/etc/
$ sudo mount proc $MNTPOINT/proc -t proc
$ sudo chroot $MNTPOINT
##
## We are now in the "chroot" environment as root
##
/# apt-get -qq update && apt-get install wget
/# cd /root && wget http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/debian/rootfs/include/debootstrap-postconfig.sh
/root# chmod +x debootstrap-postconfig.sh && ./debootstrap-postconfig.sh
/root# passwd root
/root# exit
##
## Back to our machine
##
$ sudo umount $MNTPOINT/proc
$ sudo umount $MNTPOINT
Now you have a minimum Debian installation customized for Bifferboard in the following way:
- Custom kernel for Bifferboard installed by a .deb package.
- Ethernet interface configured as DHCP client.
- Temporary directories /tmp and /var/tmp mounted on a RAM-disk.
- All APT sources “main contrib non-free” enabled.
- Serial console on ttyS0 (115200 8N1).
- RTC (real-time clock) kernel modules blacklisted – the Bifferboard has no RTC.
- IPv6 disabled – takes a lot of resources and we won’t use it anyway, for now.
I may add any further customizations if needed. You can always review the debootstrap-postconfig.sh script for details on what is being configured.
You can use this image/disk as a rootfs which you can boot directly on Bifferboard or try in Qemu. Note that you have to install our Debian kernel on Bifferboard prior to booting this rootfs.
Used resources: