There are three major steps in installing Debian on your Bifferboard:
- Kernel boot command line.
- Kernel installation on the Bifferboard.
- Rootfs installation on a USB device or an SD/MMC card.
Kernel boot command line
Since Biffboot v3.3, dated 19.July.2010, the kernel boot command line no longer specifies an external block device for the root file system. As a result of this, you need to update the boot configuration before you can boot from a USB device or an SD/MMC card. You have two options to configure the boot command line:
- bb_eth_setconfig.py – configuration via Ethernet, using a pyGTK application.
- Serial console – you will need a USB-to-serial cable @ 3.3V to do this; the cable is sold at the Bifferboard order page, and I recommend that you have such a cable for debugging purposes.
You need to set the kernel boot command line (“Kernel cmndline”) to:
console=uart,io,0x3f8 root=/dev/sda1 rootwait
Kernel installation on the Bifferboard
Download a pre-built kernel binary image:
- vmlinuz-2.6.30.5-bifferboard-ipipe (909K, MD5 checksum c375285bc07df2a42e43f2065ebc5b56)
- vmlinuz-2.6.32-bifferboard – EXPERIMENTAL (906K, MD5 checksum 54fa8b8769ed7456a8a59fc2f0feac98)
The kernel is compiled with (almost) all possible modules, so your Bifferboard should be able to easily use any device supported on Debian. Once you have downloaded the kernel image, you can then upload it to the Bifferboard, as advised at the Biffboot Wiki page. You have two options to upload the kernel – via the serial port or over the ethernet. Both work well.
Example: Assuming that you have the Bifferboard SVN repository checked out in “~/biffer/svn“, you have downloaded the “vmlinuz-2.6.30.5-bifferboard-ipipe” kernel image in “/tmp“, your Bifferboard has a MAC address of “00:B3:F6:00:37:A9“, and you have connected it on the Ethernet port “eth0” of your computer, here are the commands that you would need to use:
cd ~/biffer/svn/utils sudo ./bb_eth_upload.py eth0 00:B3:F6:00:37:A9 /tmp/vmlinuz-2.6.30.5-bifferboard-ipipe
Rootfs installation on a USB device or an SD/MMC card
Once you have the kernel “installed” on the Bifferboard and ready to boot, you need to prepare a rootfs media. This is where your Debian installation is stored and booted from. Download one of the following pre-built rootfs images (default root password is “biffroot”):
- Debian “lenny” for Bifferboard – minimal (download size 95M, uncompressed size 346MB, MD5 checksum bda83e6b7b6440a75fa9e749f04ebb2d).
- Debian “lenny” for Bifferboard – developer (download size 129M, uncompressed size 468MB, MD5 checksum 01eb3cc5246ad1ca793ece9de2add9da).
The “developer” version adds the following packages: build-essential, perl, links, manpages, manpages-dev, man-db, mc, vim. Note that for each image you will need at least 100MB more free on the rootfs media.
In order to populate the rootfs media, you have to do the following:
- Create one primary partition, format it as “ext3” and then mount the USB device or SD/MMC card.
- Extract the archive in the mounted directory.
- Unmount the directory.
Example: Assuming that you have the Bifferboard SVN repository checked out in “~/biffer/svn“, you have downloaded the “minimal” rootfs image in “/tmp“, and you are using an SD/MMC card under the device name “/dev/mmcblk0“, here are the commands that you would need to use:
sudo bash mkdir /mnt/rootfs cd ~/biffer/svn/debian/rootfs ./format-and-mount.sh /dev/mmcblk0 /mnt/rootfs tar -jxf /tmp/debian-lenny-bifferboard-rootfs-minimal.tar.bz2 -C /mnt/rootfs umount /mnt/rootfs # CHANGE THE DEFAULT ROOT PASSWORD!
When you have the USB device or SD/MMC card ready and populated with the customized Debian rootfs, plug it in Bifferboard, attach a serial cable to Bifferboard, if you have one, and boot it up.
That’s it. Enjoy your Bifferboard running Debian.
Update: As already mentioned in the comments below, you would probably need to set up swap too. Here is my recipe:
# change "128" (MBytes) below to a number which suits your needs dd if=/dev/zero of=/swapfile bs=1M count=128 mkswap /swapfile swapon /swapfile # enables swap right away; disable with "swapoff -a" echo '/swapfile none swap sw 0 0' >> /etc/fstab # enables swap at system boot
Using a file for swap on a 2.6 Linux kernel has the same performances as using a separate swap partition as discussed at LKML.
Update 2: As announced by Debian, Debian 5.0 (lenny) has been superseded by Debian 6.0 (squeeze). Security updates have been discontinued as of February 6th, 2012. Thus by downloading and installing the images provided here, you’re using an obsolete Debian release. If that’s not a problem for you, read on. You need to change the file “/etc/apt/sources.list” to the following using your favorite text editor:
deb http://archive.debian.org/debian lenny main contrib non-free deb-src http://archive.debian.org/debian lenny main contrib non-free deb http://archive.debian.org/debian-security/ lenny/updates main contrib non-free deb-src http://archive.debian.org/debian-security/ lenny/updates main contrib non-free
P.S. If you want to build your own customized Debian rootfs image for Bifferboard – checkout the Bifferboard SVN repository and review the instructions in “debian/rootfs/images.txt“.
References:
- dpkg: extract specific file.
- Other similar Debian projects for Bifferboard – Bifferboard Wiki “Home > ’Desktop’ Linux Distributions > Debian” page.
- Pinouts for the standard single USB Bifferboard.
- Bifferboard with 2 USB ports – hardware specification and pinouts.
Pingback: Secure NAS on Bifferboard running Debian « /contrib/famzah
August 13, 2010 at 6:57 pm
it’s very important to create a swap partition for debian, otherwise your kernel will keep killing programs because 32 Megs of RAM is not very much.
HowTo:
Resize sda1 on ANOTHER Linux machine using a program of you choice (gparted, parted, whatever)
Create a swap partition sda2
Boot up debian, execute swapon /dev/sda2
To make sure the swap partition is mounted after a reboot, add this to your /etc/fstab :
/dev/sda2 none swap sw 0 0
August 17, 2010 at 3:28 pm
You are definitely right. Very often you need swap, even for an apt-get upgrade of “locales”. I’ve added a note about it in the article.
August 17, 2010 at 10:24 pm
Hi all,
has anyone tried to run Java on a bifferboard? Are there any expierence? Does debian lenny already contain a java installation?
Best regards
Andreas
August 22, 2010 at 7:27 pm
You can install Java runtime on your Debian very easily by executing the following:
You already started a thread about Java at the Bifferboard mailing list and as suggested there, you can also try JamVM, which is a lighter Java runtime implementation, by executing:
P.S. Please post support inquiries about Debian at the mailing list. I didn’t reply in this current thread, because it wasn’t about Debian, nor was asked for this OS.
September 12, 2010 at 1:07 am
Hi,
I tried to install the minimal and the developer rootfs on the USB Stick and received the following error during the decompression:
tar: Springe zum nächsten Kopfteil (jumping to the next header)
bzip2: Data Integrity error when decompressing
input file = (stdin), output file = (stdout)
I downloaded the files twice from the webpage.
I am jusing knoppix 6.2
Any idea?
Regards & many thanks
Andreas
September 12, 2010 at 10:25 am
I’ve added the MD5 checksums of the files for download. Once you’ve downloaded a file, you can verify its integrity before decompressing it by executing the following in your console:
If the MD5 checksum differs from what you see on this web page, then something with the download went wrong – this isn’t something which I can help with, as it’s more a network problem on your side. If the checksum is right and you still get the error, then there’s something really weird – you should check if your hardware is OK, probably RAM, etc.
September 17, 2010 at 3:42 pm
Hi,
sorry, it is me again….
I now flashed the kernel (113 chunks written) and installed the developper root FS.
Then I turned everything on (USB-Bifferbard connected to LAN): After a couple of seconds the LED at the USB Stick is flashing (so, thing is happening): but after some time, it stops, it seems that no IP Adresses has been assigned to the bifferbard….
The Router indicates that an device is connected to the LAN port…
Do you have an idea what to do? I thought that no adaptation of the rootfs is required (manuel config of the net mask etc…). Since I do not have an serial adapter, I have idea which messages are generated during the boot process…
Many thanks in advance & regards
Andreas
September 17, 2010 at 6:00 pm
No adaptation is required, the Debian installation gets an IP address via DHCP by default.
I can’t help without the output on the console, which is available through a serial cable…
P.S. Please post support inquiries about Debian at the mailing list.
September 24, 2010 at 9:34 pm
Hi,
I’m busy installing Debian now, but I suppose the python instruction is missing from this line:
sudo ./bb_eth_upload.py eth0 00:B3:F6:00:37:A9 /tmp/vmlinuz-2.6.30.5-bifferboard-ipipe
It works on my BifferBoard with
sudo ./python bb_eth_upload.py eth0 00:B3:F6:00:37:A9 /tmp/vmlinuz-2.6.30.5-bifferboard-ipipe
Regards,
Ben
September 26, 2010 at 11:38 am
Actually, it’s not missing. The interpreter path is specified in the very first line of “bb_eth_upload.py”:
You either don’t have “/usr/bin/env” on your system, or “python” is not in the PATH.
November 24, 2010 at 10:42 pm
Hello,
After some tries i managed to flash the original firmware (http://sites.google.com/site/bifferboard/Home/factory-firmware) again but i was not able to get your debian running. Is it possible that your kernel does not work with 8MB devices?
i recieved my BB today and I was prepared to upload the kernel an the rootfs. I’ve got an 8MB BB, so i used the bb_eth_upload8.py command. But i bricked it
Regards,
Martin
November 25, 2010 at 2:45 pm
It works on 8MB boards, I’m currently using it mainly on such ones.
For further assistance, please post a thread at the Bifferboard mailing list where more people can troubleshoot the problem.
November 29, 2010 at 2:52 pm
Hello,
i’ve got debian working on my 8MB Bifferboard. All I had to do was to set the correct kernel commandline in Biffboot. I had to connect with a serial cabel, intercept the boot process with hitting in the right moment and enter “usbroot -> save”. That’s it. Lurch stated in that post that it is possible to set it via ethernet – but i didn’t test this…
Regards,
Martin
PS: I took your howto and translated it into german: http://www.m8in.de/?p=423 😉
Pingback: Debian auf dem Bifferboard « M8IN.DE
March 2, 2011 at 12:27 pm
Why the kernel has only ext3 module compiled in? This is not the best file system for USB flash devices. As ext2 is as a module, bifferboard is not able to boot with ext2 or anything without journal.
March 2, 2011 at 12:43 pm
If we have both ext2 and ext3 compiled in, the kernel image gets too big. Ext3 is used by most users, that’s why it’s compiled in. There are detailed instructions on how to recompile the kernel with the options you specifically need.
March 2, 2011 at 1:36 pm
OK I understand. Just that it is possible to boot ext3 fs with ext2 module, but is impossible to boot ext2 fs with ext3 module.
June 19, 2011 at 4:33 pm
Awesome tutorial.
One little problem, when I try and use iptables e.g.
“iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT”
I get the error:
“iptables: No chain/target/match by that name”
Does anyone have a fix for it?
June 19, 2011 at 7:15 pm
Thanks 🙂
Try to load the required modules first by executing: /sbin/modprobe iptable_nat
The following article provides further details: http://www.aboutdebian.com/proxy.htm
June 19, 2011 at 10:11 pm
Thanks for helping but I’ve tried executing the following in a shell script:
/sbin/depmod -a
/sbin/modprobe iptable_nat
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_state
/sbin/modprobe ipt_owner
/sbin/modprobe ipt_REJECT
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_conntrack_irc
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_nat_irc
And I still get the same error message…
June 20, 2011 at 9:14 am
I’ve investigated this more thouroughly. The REDIRECT target module is missing. In order to have it, you’d need to recompile the kernel. The compile option which I missed to enable is:
Networking support -> Networking options -> Network packet filtering framework (Netfilter) -> Advanced netfilter configuration [CONFIG_NETFILTER_ADVANCED]
Then you can enable the REDIRECT target:
Networking support -> Networking options -> Network packet filtering framework (Netfilter) -> IP: Netfilter Configuration -> REDIRECT target support [CONFIG_IP_NF_TARGET_REDIRECT]
Long story, short — if you’re going to use the SVN scripts to re-compile the kernel, you’d need to add the following two kernel options there:
CONFIG_NETFILTER_ADVANCED=y
CONFIG_IP_NF_TARGET_REDIRECT=m
—
Note that you can try to use the DNAT rule, which is already available, in order to achieve the same effect as REDIRECT:
iptables -t nat -A PREROUTING -d 127.0.0.1 -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:80
iptables -t nat -A PREROUTING -d ! 127.0.0.1 -p tcp --dport 80 -j DNAT --to-destination $IP:80
The variable “$IP” must hold the primary IP address of the incoming interface (eth0).
June 21, 2011 at 10:36 pm
Thanks for your help, it is very much appreciated.
I’ve compiled the kernel (2.6.30.5) with the 2 extra lines and everything seems to go OK, although the ‘vmlinuz’ file turns out smaller than the one you have compiled (900.3KB). When I flash this kernel to the board it does not boot from the USB drive.
Do I have to do anything with the generated .deb files??
June 22, 2011 at 9:28 am
Make sure you’re using a 32-bit Debian “lenny” system for the kernel build.
The “.deb” files need to be installed in the rootfs (the USB drive). The easiest way to do this is to copy them to the USB drive, mount “proc” and “dev” there, chroot() there and then use “dpkg -i” to install them. I suggest that you have a serial debug cable connected to the Bifferboard if you’re about to tweak the kernel, so that you can see what failed where.
If I were you, I’d go with the two iptables lines which I suggested — they do practically the same, and you’d have forgotten that you set up them by now, instead of having to recompile kernels, etc.
June 26, 2011 at 5:14 pm
Has anyone been able to install debian on the new version of this device (3rd generation)? http://www.addonics.com/products/nas/NAS30U2.asp
This unit sounds beefy, sporting gigabit ethernet and usb 3!
June 26, 2011 at 10:35 pm
I would suggest that you ask this question on the Bifferboard mailing list too.
October 25, 2011 at 1:23 am
Thanks for sharing your prepared images. This made me jump-start into Debian. While I tried before without luck, this time was an almost instant success. +1 for mentioning the proper kernel command line – that’s what I had to fix to get it finally working.
December 18, 2011 at 11:09 pm
I have followed settings but keep getting this
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Linux version 2.6.32.20 (biff@fonzi) (gcc version 4.1.2) #5 Mon Feb 7 23:21:40 1
Any idea how can get it to boot from usb?
Thank you
December 19, 2011 at 9:29 am
I can’t advise anything further, and this here is not the proper place for support questions. Use the Bifferboard mailing list instead.
December 20, 2011 at 1:09 pm
downgraded to vmlinuz-2.6.30.5-bifferboard-ipipe version and seamed to solve it now am up and running again. Thanks
April 20, 2012 at 9:43 pm
nice How-To!!!
I did i like written in this How-To but have Problem with booting. Usind Putty or minicom for Serial Console works fine. While booting USB-Stick is flickering.
Here is what Putty says to me:
Hope someone could help me… have no more idea what to do.
Greetings JoJo (from Germany/Augsburg)
April 21, 2012 at 10:04 am
The kernel boot seems OK. What happens if you mount /dev/sda1 (your Usb Flash Drive) on a desktop machine? Do you see a regular file-system structure there, having /etc, /bin, etc. folders and the respective files there?
April 21, 2012 at 11:13 pm
That seems to be the problem. I do not see a regualr file-system on my flash drive. Only the lost+found folder apears…
I’m trying to solve this problem. Thank you for your hint. 😉
April 23, 2012 at 11:13 pm
Solved the problem. Debian is working now. Thank you!!! Only problem is that I do not know the login name and password.
in the terminal I can see following output:
bifferboard.localdomain login:
please help with this!
April 23, 2012 at 11:41 pm
I found it by myself. If anyone else needs the information.
in
http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/debian/rootfs/images.txt
you can find
# root password: biffroot