LiveCD

De Stoq Wiki
Ir para: navegação, pesquisa

tasklist

# For the firt time, there is the need to extract the contents of an live cd
# image.
# Just run the script extract-image.sh, with the image name as a parameter:
# (Check the script for more details)
./extract-image file_name.iso

# This script will create the following directories:
# 1) extract-cd - This is the live cd contents. you can exclude some files,
#                 like extra contents (programs), and packages. But you must
#                 keep the directories 'isolinux' and 'casper' (possibly
#                 others, but I am not sure now.
# 2) edit       - This is live cd system. you can chroot to this and
#                 customize.


# Copy this files.
cp /etc/resolv.conf edit/etc/
cp /etc/hosts edit/etc/

# chroot to the livecd root.
chroot edit/
export HOME=/root
export LC_ALL=C
export DISPLAY=:1            (Xnest -ac :1)


# mount
mount -t proc none /proc
mount -t sysfs none /sys

apt-get update
# upgrade only necessary packages. (avoid kernel updates)
apt-get upgrade

# remove any package that is not necessary.
# Find out the packages that use more space.
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less


# If this is the first time, you should probably remove some unecessary
# packages (like other languages support, and some programs) and install
# postgres.

# Stop any postgres running.
# and start postgres on the chroot enviroment
# there must be a postgres user called 'stoq', his password must be 'stoq'
/etc/init.d/postgres-8.1 start

# Drop old stoq database
dropdb stoq

# Remove old configuration files
rm -fr /root/.stoq

# Run stoq again.
metacity &
stoq

# after the database has been recreated, hack the machine name
# 'ubuntu' is the hostname of the livecd.
# XXX: try to change the hostname 'ubuntu' to something else
psql stoq -c "UPDATE branch_station SET name='ubuntu'"

# Update the live cd user home, located at /etc/skel
# Update the live cd webpage, located at /usr/share/stoq/stoq_html



# ...

apt-get clean

/etc/init.d/postgres-8.1 stop
umount /proc
umount /sys


# Now, we need to recreate the image.
# just run the scrip create-image.sh specifing the chroot directory
sudo ./create-image.sh edit/

this should create an image called ubuntu-6.10-custom.iso. Go ahead and burn
it.

creating an image

mkisofs -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-6.06.1-desktop-i386-custom.iso .