Tuesday, October 7, 2008

Install Ubuntu Server 7.10 Gutsy Gibbon on Compact Flash for Soekris net4801

Before we decide to install Ubuntu Server 7.10 on Compact Flash, we have tried installed Pyramyd Linux. But, it is very difficult to install another application on Pyramid Linux. In this project we need another application to support the project, for example apache2, MySQL, Postfix, Squirrelmail, PhpMyAdmin, Webmin, OLSRd, PhP, so we choose to install Ubuntu on our Compact Flash.

The first step is preparing tools that we need, here is:

1. Host computer using Linux. We use Notebook with Ubuntu 7.10 Desktop
2. Compact Flash (CF). We use CF 1 GByte.
3. Card Reader. We use Card Reader Apacer AP450
4. ISO from Ubuntu 7.10 Server. You can download from www.ubuntu.com

First, plug card reader which CF has plugged there.
Make a partition on the CF. Make a bootable partition.

sudo cfdisk /dev/sdc

Make a ext3 paritition on CF:

sudo mke2fs -j /dev/sdc1


Remember the UUID from your CF (/dev/sdc1) that will need later.

blkid

Mount CF on /mnt/target:

sudo mkdir /mnt/target
sudo mount /dev/sdc1 /mnt/target

Mount file ISO Ubuntu Server on /mnt/iso:

sudo mkdir /mnt/iso
sudo mount -t iso9660 -o ro,loop=/dev/loop0 /path/ke/filenya/ubuntu-7.10-server-i386.iso /mnt/iso


Do deboostrap on CF. If you don't have deboostrap application, install it first:

sudo apt-get install debootstrap
sudo debootstrap --arch i386 feisty /mnt/target file:/mnt/iso


Installation for Ubuntu to CF finish. But, because Ubuntu usual install on computer desktop that has monitor and keyboard, on the other hand, Soekris doesn't have port video and keyboard, so we must do some modification in order to Ubuntu can run on Soekris.

Chroot to the target. Chroot is a command to run shell on root directory that different from usual root:

sudo chroot /mnt/target /bin/bash

Now we work with /mnt/target as our root.
Make file /etc/fstab:

vi /etc/fstab


Fill the file with this:

# file system mount point type options dump pass
UUID=xxxxxx-xxxx-...-xxxxxx / ext3 defaults 0 0
tmpfs /tmp tmpfs size=128m,mode=1777 0 0
proc /proc proc defaults 0 0
sys /sys sysfs defaults 0 0


Fill the UUID with the previous UUID that you have remember.

Mount all the file system:

mount /proc
mount /sys

Verify the result of mount. If the command result a blank directory, the file system doesn't mount yet:

ls /proc

Configure the keyboard (This not important, because Soekris doesn't have a keyboard):

dpkg-reconfigure console-setup

Setup the network:

vi /etc/network/interfaces

Fill this file using your configuration of your networkm here is the example:

auto lo
iface lo inet loopback
iface eth0 inet static
address 167.205.64.106
netmask 255.255.255.192
gateway 167.205.64.65
auto eth0


Set hostname. We wil give the name "ubuntu-soekris"

echo ubuntu-soekris > /etc/hostname

Make a nonroot user for login. Set password too. In this example we use "aswantara":

adduser aswantara
echo 'aswantara ALL=(ALL) ALL' >> /etc/sudoers
chmod 0440 /etc/sudoers

Setup /etc/apt/sources.list

vi /etc/apt/sources.list

Fill this file using your Ubuntu repository. Here is the example for our repository:

deb http://kambing.ui.edu/ubuntu gutsy-backports multiverse main restricted universe
deb http://kambing.ui.edu/ubuntu gutsy-proposed multiverse main restricted universe
deb http://kambing.ui.edu/ubuntu gutsy-security multiverse main restricted universe
deb http://kambing.ui.edu/ubuntu gutsy-updates multiverse main restricted universe
deb http://kambing.ui.edu/ubuntu gutsy multiverse main restricted universe

Setup /etc/hosts

vi /etc/hosts


Fill the file /etc/hosts with this:

127.0.0.1 localhost
127.0.1.1 ubuntu-soekris
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Setup /etc/resolv.conf

vi /etc/resolv.conf


Fill according to your DNS on your network, here is the example:

search ee.itb.ac.id
nameserver 167.205.23.1
nameserver 167.205.22.123
nameserver 167.205.64.158

Make file /etc/event.d/ttyS0

vi /etc/event.d/ttyS0

Fill this file with this:

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6
respawn
exec /sbin/getty -L ttyS0 9600 vt102


Edit file /etc/initramfs-tools/modules

vi /etc/initramfs-tools/modules

Add this line to file /etc/initramfs-tools/modules

ext3
ide_generic

Update your initramfs:

update-initramfs -u


Install kernel and configure the grub. Deboostrap doesn't install bootloader on CF, so we have to install manually:

apt-get update
apt-get install linux-image-generic grub memtest86+


Configure grub:

mkdir -p /boot/grub
cp /usr/lib/grub/i386-pc/* /boot/grub
vi /boot/grub/menu.lst

Fill file /boot/grub/menu.lst with this script:

default 0
timeout 5


serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console

title Ubuntu, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/hda1 ro console=tty0 console=ttyS0,9600n8
initrd /boot/initrd.img-2.6.22-14-generic
quiet
savedefault

title Ubuntu, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin console=tty0 console=ttyS0,9600n8
quiet


Exit from chroot

exit

To install the grub, do this command outsode of chroot():

sudo grub-install --no-floppy --root-directory=/mnt/target /dev/sdc1

Finnally, finish. Now you can check your CF this by plug it on Soekris. Make sure your Soekris bitrate is 9600. Enter username "aswantara" and password.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home