cd
apt-get -y install lzma squashfs-tools mkisofs
wget http://ftp.jaist.ac.jp/pub/Linux/ubuntu-releases/12.04/ubuntu-12.04-desktop-i386.iso
wget -O - 'http://sourceforge.jp/projects/tomoyo/svn/view/branches/ubuntu-12.04/LiveCD.tar.gz?root=tomoyo&view=tar' | tar -zxf -
cd LiveCD/
chmod +x *.sh
modprobe binfmt_misc
modprobe -q -b lp
modprobe -q -b ppdev
mkdir mnt cdrom squash initrd
mount -o loop,ro ~/ubuntu-12.04-desktop-i386.iso mnt/
cp -a mnt/* mnt/.disk/ cdrom/
umount mnt/
mount -t squashfs -o loop,ro cdrom/casper/filesystem.squashfs mnt/
cp -a mnt/* squash/
umount mnt/
cd squash/
cp -p ../package-install.sh /etc/apt/sources.list .
cp -p /etc/resolv.conf etc/
mount --bind /dev/ dev/
chroot . /package-install.sh
umount dev/
cd ../
./generate-livecd.sh
