debootstrap on a Soekris net4801
These instructions describe how I installed Ubuntu 9.04 on my 256MB Soekris net4801 by using
debootstrap to build a CF card on a host system running
Ubuntu 9.04. I tried using an Ubuntu 9.10 for the host system but
was unable to get Grub properly configured. I gave up and used a
9.04 host.
There are older docs on the Ubuntu Wiki available on how to install Ubuntu on a Soekris via PXE but the Soekris is the PXE server on my home network so I prefer an alternate method of installation. I did borrow a few steps from the Ubuntu document.
I assume that you have a working knowledge of Debian like Linux systems
and of Linux in general. Commands beginning with sudo are to
be run on the host system while others are to be run as root
inside the chroot.
I run my serial console at 9600 baud.
/ filesystem
at /mnt/target. I use one large root partion and add
some swap. There is some concern that allocating swap on a CF card will
cause significant write activity and shorten the lifespan of the card.
I only run the ISC dhcpd, Bind, ntpd and a couple of shell sessions so
I fit into my 256MB of RAM easily and the swap is just a saftey net.
If you want something different, adjust accordingly. Also, buy
good CF cards with write leveling.
sudo mkdir /mnt/target sudo cfdisk /dev/sdb # I put swap in sdb5 and the rest of the CF card into sdb1 sudo mke2fs -j /dev/sdb1 sudo mkswap /dev/sdb5 sudo mount /dev/sdb1 /mnt/target
debootstrap(8) for more information.
sudo mkdir /mnt/iso sudo mount -t iso9660 -o ro,loop=/dev/loop0 /temple/sw/linux/ubuntu-9.04-server-i386.iso /mnt/iso
debootstrap:
sudo apt-get install debootstrap sudo debootstrap --arch i386 jaunty /mnt/target file:/mnt/iso
sudo chroot /mnt/target /bin/bash
/etc/fstab. I don't use UUIDs for the
partitions on my Soekris but if you do, make sure that the correct
one winds up in your /boot/grub/menu.lst below.
Note that I use a tmpfs for /tmp. You may not want
that.
# file system mount point type options dump pass /dev/sda1 / ext3 defaults 0 0 /dev/sda5 none swap sw 0 0 tmpfs /tmp tmpfs size=128m,mode=1777 0 0 proc /proc proc defaults 0 0 sys /sys sysfs defaults 0 0
mount /proc
dpkg-reconfigure console-setup
editor /etc/network/interfaces
echo pathos > /etc/hostname
adduser foo echo 'foo ALL=(ALL) ALL' >> /etc/sudoers chmod 0440 /etc/sudoers
/etc/apt/sources.list, /etc/hosts and
/etc/resolv.conf.
/etc/event.d/ttyS0 with contents:
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
debootstrap will not
install a bootloader for you.
apt-get install linux-image-generic grub memtest86+ cd /dev MAKEDEV sd mkdir -p /boot/grub update-grub editor /boot/grub/menu.lstMake the following changes to the
menu.lst:
## timeout sec # Set a timeout, in SEC seconds, before automatically booting the default entry # (normally the first entry defined). timeout 3 ############################################### ## Serial/Console setup ############################################### # Setup serial (COM1) here with baudrate 9600 # use --unit=1 (for COM2) and so on serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
# kopt=root=UUID=fb808f9c-7f57-41e8-b969-4268bdf69767 ro console=ttyS0,9600
update-grub again to update the automagic
kernel entries with the serial console.
/etc/initramfs-tools/modules and add the
following two lines at the end of the file:
ext3 ide_genericNow, you have to update your initramfs with
update-initramfs -u
umount /proc
# exit the chroot()
exit
# Run this from outside the chroot()
sudo grub-install --no-floppy --root-directory=/mnt/target /dev/sdb1
foo
with the password that you fed to adduser and from there
sudo to root.
$Id: ubuntu_net4801.html 11 2009-12-15 03:29:42Z peewee $