#!/bin/bash
dd if=/dev/zero of=/dev/sda bs=512 count=1
sfdisk /dev/sda << EOF
,124,S
,,L
EOF
mkfs.ext3 /dev/sda2
mkswap /dev/sda1
sync; sync; sync
swapon /dev/sda1
mkdir /mnt/ubuntu
mount /dev/sda2 /mnt/ubuntu
cd /mnt/ubuntu
mkdir /mnt/ubuntu/work
cd /mnt/ubuntu/work
wget
http://archive.ubuntulinux.org/ubuntu/pool/main/d/debootstrap/debootstrap_0.3.3.2ubuntu3_all.deb ar -xf debootstrap_0.3.3.2ubuntu3_all.deb
cd /mnt/ubuntu
zcat < /mnt/ubuntu/work/data.tar.gz | tar xv
export DEBOOTSTRAP_DIR=/mnt/ubuntu/usr/lib/debootstrap
export PATH=$PATH:/mnt/ubuntu/usr/sbin
debootstrap --arch powerpc feisty /mnt/ubuntu
http://ftp.acc.umu.se/mirror/ubuntu/ echo Xenon > /mnt/ubuntu/etc/hostname
cat > /mnt/ubuntu/etc/fstab << EOF
/dev/sda2 / ext3 defaults 0 0
/dev/sda1 none swap sw 0 0
EOF
cat > /mnt/ubuntu/etc/network/interfaces << EOF
iface lo inet loopback
auto lo
auto eth0
iface eth0 inet dhcp
EOF
cat > /mnt/ubuntu/etc/apt/sources.list << EOF
deb
http://ftp.acc.umu.se/mirror/ubuntu feisty main restricted universe multiverse
EOF
cp /mnt/ubuntu/root/.bashrc /mnt/ubuntu/root/.bashrc.orginal
cat >> /mnt/ubuntu/root/.bashrc << EOF
apt-get update
apt-get install ntp wget -y --force-yes
aptitude install ubuntu-desktop -y
echo "AVAHI_DAEMON_START=0" > /etc/default/avahi-daemon
/etc/init.d/networking restart
cd /usr/lib/xorg/modules/drivers/
wget
http://mydedibox.homelinux.com/ubuntu-install/xenonfb_drv.so dpkg-reconfigure xserver-xorg
apt-get remove network-manager-gnome -y
apt-get remove network-manager -y
mkdir /lib/modules/2.6.20
touch /lib/modules/2.6.20/modules.dep
echo "" > /etc/gdm/gdm.conf-custom
sed -i 's/AllowRoot=false/AllowRoot=true/' /etc/X11/gdm/gdm.conf
update-rc.d -f bluetooth remove
update-rc.d -f binfmt-support remove
update-rc.d -f laptop-mode remove
update-rc.d -f pppd-dns remove
update-rc.d -f pcmciautils remove
update-rc.d -f festival remove
update-rc.d -f hwclock.sh remove
update-rc.d -f usplash remove
update-rc.d -f portmap remove
update-rc.d -f cupsys remove
update-rc.d -f hplip remove
update-rc.d -f spamassassin remove
update-rc.d -f powernowd remove
update-rc.d -f powernowd.early remove
update-rc.d -f nfs-common remove
update-rc.d -f alsa-utils remove
update-rc.d -f exim4 remove
rm /root/.bashrc
mv /root/.bashrc.orginal /root/.bashrc
startx
EOF
shutdown -h now