debootstrap
on a Soekris net4801
These instructions describe how I installed Ubuntu 7.04 on my
256MB Soekris net4801 by using
debootstrap
to build a CF card on a host system running
Ubuntu 7.10. I installed 7.04 server on the net4801, but these steps
should work for desktop or for 7.10 or you can also easily adapt them
to install to a 2.5" or SATA drive.
There are docs on the Ubuntu Wiki available on how to install Ubuntu on a Soekris via PXE but I did not feel like going through the hassle of setting PXE up to boot one system one time. 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.
/
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.
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 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-7.04-server-i386.iso /mnt/iso
debootstrap
:
sudo apt-get install debootstrap sudo debootstrap --arch i386 feisty /mnt/target file:/mnt/iso
sudo chroot /mnt/target /bin/bash
/etc/fstab
:
# file system mount point type options dump pass /dev/hda1 / ext3 defaults 0 0 /dev/hda5 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
mkswap
:
mount /proc mount /sys ls /proc # verficiation. if the directory is empty, it isn't mounted. mkswap /dev/hda5
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
. See here
for a sample sources.list
.
/etc/event.d/ttyS0
:
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. See here
for a sample menu.lst
that should work for feisty.
Make sure that you adjust it for the kernel version installed
by linux-image-generic
. You may wish to look at
the menu.lst
from a running, recent Debian or Ubuntu
system and include the comment lines used to set default options via
update-grub
. Note the bits that enable the serial console
and set the speed.
The -server
kernel did not boot
on my net4801.
apt-get install linux-image-generic grub memtest86+ mkdir -p /boot/grub cp /usr/lib/grub/i386-pc/* /boot/grub editor /boot/grub/menu.lst
/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
# 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
.