Hi,
What one could do in this situation is use a Ubuntu Mini CD image, install debootstrap and do it that way. Be aware that this guide is quite advanced.
A few conventions - anything that is in a code block is to be executed by you. If any lines in the code block have a pound sign (#) inside it, you don't have to type it, but if you do nothing will happen - it's a comment.
Here's the steps I took:
1) Go to http://www.crealabs.it/ubuntu-mini-remix/ and download any image - the latest image would be the best one.
2) If you're going to use VMware Player, go to http://www.easyvmx.com/new-easyvmx.shtml to generate a .vmx file and corresponding hard drive images (you'll need at least 6gb for the system and a build environment, and get the path you downloaded the Ubuntu Mini ISO to and set that up as the CD-ROM). Otherwise, just create the VM in whatever VMware/VirtualBox/etc product you use. I recommend using SCSI drives (this guide assumes you have) and a minimum of 512mb of RAM.
3) Boot the new VM and select "Try Ubuntu without changing my computer". Go grab something to drink - this will take a few minutes.
4) You may find that it gets stuck on the loading screen. Hit Alt+F1 and you'll be greeted by a friendly... terminal.
5) The following is optional and saves putting 'sudo' in front of everything, but you can do that if you wish:
6) Open the disk partitioner with the following command (I recommend having twice your RAM allocation for swap and the rest for root. Some basic math will cover this.)
Be sure to set the first partition as bootable. Write and quit.
7) Create a new ext3 filesystem on the root partition, format the swap on the swap partition and enable the swap partition now:
mkfs -j /dev/sda1
mkswap /dev/sda2
swapon /dev/sda2
8) At the time of writing, the latest image was for Intrepid (8.10). It would be better if we were using the Jaunty (9.04) repositories, so let's set them up and update the local package lists:
cat >/etc/apt/sources.list <<EOF
deb http://archive.ubuntu.com/ubuntu jaunty main
EOF
apt-get update
9) Let's install debootstrap - it'll ask for a few dependencies to be updated, it's safe to allow them:
apt-get install debootstrap
10) Now comes the fun bit. Let's mount the root partition and start the process off. Once it starts, you might want to go and do something else for awhile, this can take some time depending on how fast your Internet connection is:
mount /dev/sda1 /mnt
debootstrap /mnt jaunty
If you wish to connect to a different repository, add the address for this as an extra parameter. For instance, if you wish to use Ubuntu's AARNet mirror as the repository, the last command becomes:
debootstrap /mnt jaunty http://mirror.aarnet.edu.au/ubuntu
11) It gets more fun. Once this is done, you will need to add a few more packages to the new setup. Let's set up an environment and change the root directory to enter our new environment:
cp /etc/apt/sources.list /mnt/etc/apt
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
chroot /mnt
This allows access to the /proc directory (for the kernel install to create the initial ram disk) and the /dev directory (so grub knows where to find hard drives).
12) Let's update the package list and install the required packages:
apt-get update
apt-get install build-essential bison libncurses5-dev ncurses-term zlib1g-dev unzip subversion linux-image-2.6-386 grub patch bzip2 flex autoconf gettext texinfo sharutils libncurses5-dev
13) Next you'll need to set up grub to boot your new system:
mkdir /boot/grub
cp /usr/lib/grub/i386-pc/stage{1,2} /boot/grub
cp /usr/lib/grub/i386-pc/e2fs_stage1_5 /boot/grub
cat >/boot/grub/menu.lst <<EOF
default 0
timeout 2
title whaddayathink
root (hd0,0)
kernel $(echo vmlinuz*) root=/dev/sda1
initrd $(echo initrd.img*)
EOF
grub
Once in grub, type the following to set up your new system:
root (hd0,0)
setup (hd0)
quit
14) Finally, we'll set a few configuration options and leave the environment:
# Enter your password for the root account
passwd root
# You'll need an unpriviledged account to build OpenWrt:
adduser builder
# Pick a name for your building VM:
hostname constructor
# Set up hard drive mounts
cat >/etc/fstab <<EOF
/dev/sda1 / ext3 defaults 0 1
/dev/sda2 none swap defaults 0 0
exit
15) Restart, and boot into your new system:
(Last edited by thirdwheel on 21 Aug 2009, 06:40)