
Debootstrap HOWTO by glevand (geoffrey.levand@mail.ru)
-------------------------------------------------------

Links:

* http://www.debian.org/releases/stable/i386/apds03.html.en
* https://help.ubuntu.com/6.10/ubuntu/installation-guide/i386/linux-upgrade.html

Installing Debian Squeeze with debootstrap on petitboot
--------------------------------------------------------

- Configuring the base system

1. umount /dev/ps3vflashh2
2. mkdir /mnt/debian
3. mount /dev/ps3vflashh2 /mnt/debian
4. rm -rf /mnt/debian/*
5. debootstrap --arch powerpc squeeze /mnt/debian http:/ftp.us.debian.org/debian
6. mount -t proc none /mnt/debian/proc
7. mount --rbind /dev /mnt/debian/dev
8. LANG=C chroot /mnt/debian /bin/bash
9. export TERM=xterm-color

- Mounting partitions

File /etc/fstab
----------------

/dev/ps3vflashh2	/		ext3		defaults		0 1
/dev/ps3vram		none		swap		sw			0 0
/dev/ps3vflashh1	none		swap		sw			0 0
/dev/sr0		/mnt/cdrom	auto		noauto,ro		0 0
proc			/proc		proc		defaults		0 0
shm			/dev/shm	tmpfs		nodev,nosuid,noexec	0 0

- Setting timezone

1. vi /etc/default/rcS
2. dpkg-reconfigure tzdata

- Configuring networking

1. echo "debian-vflash" > /etc/hostname

File /etc/network/interfaces
-----------------------------

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

File /etc/resolv.conf
----------------------

nameserver 192.168.1.1

- Configuring apt

File /etc/apt/sources.list
---------------------------

deb http://ftp.us.debian.org/debian squeeze main
deb-src http://ftp.us.debian.org/debian squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

1. aptitude update

- Configuring locales and keyboard

1. aptitude install locales
2. dpkg-reconfigure locales
3. aptitude install console-data
4. dpkg-reconfigure console-data

- Finishing touches

1. tasksel install standard
2. aptitude clean
3. passwd

- Installing kernel

1. cd /usr/src
2. git clone git://git.gitbrew.org/ps3/ps3linux/linux-2.6.git
3. ln -sf linux-2.6 linux
4. cd linux
5. cp ps3_linux_config .config
6. make menuconfig
7. make
8. make install
9. make modules_install

If you compile your kernel on PS3 then make sure you activate swap because
compiling kernel needs much RAM. I used /dev/ps3vflashh1 as swap which
you have to create with fdisk first of course or some other program.

1. mkswap /dev/ps3vflashh1
2. swapon /dev/ps3vflashh1

- Creating kboot.conf

File /etc/kboot.conf
---------------------

debian_vflash=/boot/vmlinux-2.6.38-gf77c53d root=/dev/ps3vflashh2
debian_vflash_hugepages=/boot/vmlinux-2.6.38-gf77c53d root=/dev/ps3vflashh2 hugepages=1

- Creating /dev/ps3flash device (needed for ps3-utils)

File /etc/udev/rules.d/70-persistent-ps3flash.rules
----------------------------------------------------

KERNEL=="ps3vflashf", SYMLINK+="ps3flash"

Installing Ubuntu Natty with debootstrap on petitboot
------------------------------------------------------

- Configuring the base system

1. umount /dev/ps3vflashh3
2. mkdir /mnt/ubuntu
3. mount /dev/ps3vflashh3 /mnt/ubuntu
4. rm -rf /mnt/ubuntu/*
5. debootstrap --arch powerpc natty /mnt/ubuntu http://ports.ubuntu.com
6. mount -t proc none /mnt/ubuntu/proc
7. mount --rbind /dev /mnt/ubuntu/dev
8. LANG=C chroot /mnt/ubuntu /bin/bash
9. export TERM=xterm-color

- Mounting partitions

File /etc/fstab
----------------

/dev/ps3vflashh3	/		ext3		defaults		0 1
/dev/ps3vram		none		swap		sw			0 0
/dev/ps3vflashh1	none		swap		sw			0 0
/dev/sr0		/mnt/cdrom	auto		noauto,ro		0 0
proc			/proc		proc		defaults		0 0
shm			/dev/shm	tmpfs		nodev,nosuid,noexec	0 0

- Setting timezone

1. vi /etc/default/rcS
2. dpkg-reconfigure tzdata

- Configuring networking

1. echo "ubuntu-vflash" > /etc/hostname

File /etc/network/interfaces
-----------------------------

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

File /etc/resolv.conf
----------------------

nameserver 192.168.1.1

- Configuring apt

File /etc/apt/sources.list
---------------------------

deb http://archive.ubuntu.com/ubuntu/ natty main restricted
deb-src http://archive.ubuntu.com/ubuntu/ natty main restricted

deb http://ports.ubuntu.com/ubuntu-ports/ natty-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ natty-updates restricted

deb http://ports.ubuntu.com/ubuntu-ports/ natty universe
deb http://ports.ubuntu.com/ubuntu-ports/ natty-updates universe

deb http://ports.ubuntu.com/ubuntu-ports/ natty multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ natty-updates multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ natty-security main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ natty-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ natty-security universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ natty-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ natty-security multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ natty-security multiverse

1. apt-get update

- Configuring locales and keyboard

1. apt-get install locales
2. dpkg-reconfigure locales
3. apt-get install console-data
4. dpkg-reconfigure console-data

- Finishing touches

1. apt-get update
2. apt-get upgrade
3. apt-get clean
4. passwd

- Installing kernel

1. cd /usr/src
2. git clone git://git.gitbrew.org/ps3/ps3linux/linux-2.6.git
3. ln -sf linux-2.6 linux
4. cd linux
5. cp ps3_linux_config .config
6. make menuconfig
7. make
8. make install
9. make modules_install

If you compile your kernel on PS3 then make sure you activate swap because
compiling kernel needs much RAM. I used /dev/ps3vflashh1 as swap which
you have to create with fdisk first of course or some other program.

1. mkswap /dev/ps3vflashh1
2. swapon /dev/ps3vflashh1

- Creating kboot.conf

File /etc/kboot.conf
---------------------

ubuntu_vflash=/boot/vmlinux-2.6.38-gf77c53d root=/dev/ps3vflashh3
ubuntu_vflash_hugepages=/boot/vmlinux-2.6.38-gf77c53d root=/dev/ps3vflashh3 hugepages=1

- Creating /dev/ps3flash device (needed for ps3-utils)

File /etc/udev/rules.d/70-persistent-ps3flash.rules
----------------------------------------------------

KERNEL=="ps3vflashf", SYMLINK+="ps3flash"
