Posted on June 4th, 2009 10 comments
I’ve decided to supply my installation of Debian so that people that aren’t as stubborn or just don’t want to waste time can get up and running First of all you should take a 1 or 2GB flash drive (flash stick). A CF card would probably also work, but I haven’t tried one and so I don’t know. NOTE: ALL COMMANDS ARE EXECUTED IN ROOT SHELL. BE CAREFUL! First of all you sould format your flash drive. I’m using a 4GB pqi, but a 1GB would easily do (512MB is too close to the current size of 490MB of my installation) EDIT: After cleaning the apt cache (apt-get clean) the distribution is now 409MB on the flash drive and should be safe to put it on a 512MB partition without swap (on idle it consumes just 26/256MB RAM). There are two ways to format the flash stick:
- Using terminal:
- fdisk /dev/sdc
- mkfs.ext3 -L “ROOTFS” /dev/sdc1
- mkswap -L “SWAP” /dev/sdc5
- Here in fdisk you should make a bootable partition at least 700MB big (data will fit on 512MB, but give it some space, just in case) data type should be 83. mkfs.ext3 will format the first partition on our flash drive with ext3. The last command gives it a label. If you plan to change the partition label from ROOTFS to something else first check where it is used. I’m sure that one place is /boot/grub/menu.lst file, since I made it boot from device by label and not id (like /dev/sda1), since it can change with adding new devices. Also make a 256MB swap partition, just to be on the safe side
- Using the gparted (preinstalled in Ubuntu Jaunty 9.04; GNOME).
- You can run it by pressing alt+f2 and typing
You would be prompted for your user password (you should be a sudoer – have sudo ability)
- Use the button in the right top to change to the desired device. Rightclick on the partition that exists on the flash and choose unmount. Now that the partition is unmounted you can delete it – choose delete from the menu or simple select the partition and press DELETE on your keyboard. Do that on all partitions on the flash drive, if there is more than one. THIS WILL CAUSE PERMANENT DATA LOSS ON THE DEVICE BEING FORMATED! BACKUP YOUR STUFF BEFORE FORMATING!
- Click on the empty space with right mouse button and choose New Partition on simply press Ctrl+N to open the new partition dialog. I decided to go with a 1GB partition this time.
On the remaining space I decided to make a 256MB swap partition, just in case From the “New Partition” dialog choose “extended partition” instead of primary and leave it to take all the remaining space. Then in this extended partition create a new partition (logical) with type linux-swap. I’ve labeled it SWAP, but this shouldn’t be nesessary.
I’ve ended up with this:
This is about it, push APPLY to apply the changes. Everything should go fine, but sometimes it just gives up with an error after deleting the original partition. On the empty flash repeat the remaining steps and it should work fine.
Now rightclick on the new partition and choose Manage Flags and checkout the “boot” flag.
- You can run it by pressing alt+f2 and typing
- Now that we have out partition, it’s time to mount back the new ext3 partition and put in the required files.
- cd /media
- mkdir ROOTFS
- mount -t ext3 /dev/sdc1 /media/ROOTFS
*NOTE ALL COMMANDS SHOULD BE RUNNED AS ROOT*
If everything went ok and the newly formated partition mounted, you have green light to download the archived distribution:
and compare the sum with c3d41fbf94b31f0d58f05ed502396f8f – this is the sum at my end. EDIT: The updated archive with removed apt cache files has a checksum of 933fa4bafe7e86d47758bed582d8d08c
If the sum matches – march on with the extracting the files:
tar xzvf ROOTFS.tar.gz
You should see a lot of files.
- You should now have a complete linux on your flash drive, all that remains is the bootloader.
- go to a chrooted shell:chroot /media/ROOTFS /bin/bash
- Edit /boot/grub/device.map (mcedit /boot/grub/device.map) and put in it
/dev/sdc is the flash drive on the development machine.
You should bind /dev/ with /media/ROOTFS/dev so that you can run grub-install:
mount –bind /dev/ /media/ROOTFS/dev
Now execute from the chrooted shell (chroot /media/ROOTFS /bin/bash)
grub-install –root-directory=/ /dev/sdc
- While still in the chroot-ed shell you can change your root password:
- Exit the chroot shell (exit);
Now unmount the partition using umount /dev/sdc1 and put the flash stick on your alix. It should run without problem.
- If you have a monitor and a usb keyboard, you can logon with user “root” and password “datamatrix” if you haven’t changed it.
There is a ssh server installed on the platform and the eth0 interface is configured with a static address of 192.168.47.47/24
You can access it from there. Also there is the lm-sensors installed and the “sensors” command should tell you the core and chipset temperature. Mine runs at 49 degrese celsius.
If you have any notices, improvement notes or just plain comments, please leave them bellow. I would be happy to see them and answer any questions.
- Using terminal:
Posted on June 4th, 2009 6 comments
I have recently bought an alix 3d3 board from ReloadBG. It’s intended to be used in my robotics projects. Since I am a Linux user and Debian distro family fan, I’ve decided to put Debian Lenny (Debian 5) on it. First of all I have made a minimal installation on a 4GB flash stick using the debootstrap ( http://packages.ubuntu.com/jaunty/debootstrap , http://packages.debian.org/lenny/debootstrap ) program. You can read about the process here: http://darwish-07.blogspot.com/2007/08/constructing-minimal-debian-linux-usb.html. After going to a chroot-ed shell I run grub-install –root-directory=/ /dev/sdb to setup grub on the flash stick. There isn’t anything complex here. If you put the flash stick in the alix 3d3, plug in a monitor and give it some power (a standart 12V adapter works good) you would most probably see the kernel loading.
On the other hand everything goes wrong as I decided to boot without the monitor (vga port empty). I’ve waited for a few minutes for the board to reply my pings via the ethernet port (I’ve set up a static ip address in the interfaces file). I’ve plugged back the monitor and the screen was just showing “Starting Up… Detecting EDD (edd=off to disable)… ok” or something like that and nothing more. After 3-4 minutes it resumed normal boot. I’ve read somewhere that this is a but in the EDD module in the kernel, elsewhere that the alix phoenix bios is to blame (some vga ddc bug). I’ve even read that you should turn off “HPET” in the kernel using kernel paramters, but it turned out that the kernel parameter for disabling hpet or edd doesn’t work. Firstly I was thinking how to trick the system into thinking that there is a monitor still attached, asked arount how to do it. Some people and sources from the net pointed in usign some 75 Omh resistors to pull some of the pins to ground, but I’ve decided to try something else first (I’ve even read at ubuntuforums that on alix3c3 you need to put a paperclip between 2 of the vga pins, but that seemed desperate). I’ve went with the building a custom kernel option. I used this article as guidence: http://www.falkotimme.com/howtos/debian_kernel2.6_compile/. You can follow that guide. I used http://www.kernel.org/pub/linux/kernel/v2.6/linux-126.96.36.199.tar.gz. Keep in mind that you need about 500-600MB of free space. It turned out that you also need zlib headers ( zlib-dev or currently in jaunty the package is
zlib1g-dev ). I’ve removed EDID in firmware and also disabled HPET and EDD. You can download the complete config file here: config
I’ve started the build process, it took about 1 hour 30 minuts on a AMD Athlon 64 X2 (2.3GHz per core); 2GB RAM; Debian Lenny system. Build time may vary. In the end I ended up with having a .deb fire in my /usr/src directory. You can download the compiled kernel here: linux-image-188.8.131.52_datamatrix.alix3d3.1.0_i386.deb. All that is left to do is to install the package using dpkg, updating initrd image using mkinitramfs (debian/ubuntu) and modifying /boot/grub/menu.lst to add the new kernel. It boots about as fast as before (~40-50 seconds) and has a bit more verbose debugging, but I think it would be useful.
My “hardware”: http://img.datamatrix-bg.net/robotics/IMG_1222.JPG
Comments are welcome!