Tools
3061
Comment:
|
3791
|
Deletions are marked like this. | Additions are marked like this. |
Line 42: | Line 42: |
... | Before operating inside the chroot you need to fill properly the hosts file, if you need internet access. {{{ $ sudo cp /etc/hosts chroot/etc/ $ sudo cp /etc/resolv.conf chroot/etc/resolv.conf }}} Then you can jump inside the chroot {{{ sudo chroot chroot }}} Now you need to set up the chrooted enviroment, first: {{{ mount none -t proc /proc mount none -t sysfs /sys mount none -t devpts /dev/pts export HOME=/root export LC_ALL=C }}} Now you can operate inside the chroot. (IE: you can install/remove/upgrade packages). At the end you need some cleaning before exiting: {{{ apt-get clean rm -rf /tmp/* rm /etc/resolv.conf > /etc/hosts umount -lf /proc umount -lf /sys umount -lf /dev/pts exit }}} |
Introduction
Image building will be performed with ubuntu-defaults-builder tools. The Italian team developed some side tools for simplifying the debugging and test procedures, since the ubuntu-defaults-image command builds the image every time from scratch and takes about one hour.
Image building
Install ubuntu-defaults-builder and dpkg-dev packages. Italian image will be create using defaults from ubuntu-defaults-it package available through a PPA.
For creating a i386 image run the following command:
$ ubuntu-defaults-image --ppa ubuntu-defaults-it-team/ubuntu-defaults-it --locale it --components main,restricted,universe --release precise --arch i386
For sharing the image you will need also to use the md5sum command for calculating md5 and the apt://zsync package for allowing people to download only the changes in you image with zsync.
Additional tools
All the additional tools are available through bazaar. If you want to test manual changes in the chroot before applying it to the packages you can follow steps in order.
ubuntu-defaults-binary
Builds the image starting from a chroot created with a previous ubuntu-defaults-image step. It needs a cleaning step before, that can be performed manually with the ubuntu-defaults-binary-clean command or automatically if by ubuntu-defaults-binary itself.
ubuntu-defaults-binary-clean
Cleans the directory where ubuntu-defaults-image created the ISO image allowing to work manually inside the chroot for troubleshooting and creating a new image with ubuntu-defaults-binary step.
Manual chroot operations
Image building
First step is about building the image with the original tool:
$ ubuntu-defaults-image --ppa ubuntu-defaults-it-team/ubuntu-defaults-it --locale it --components main,restricted,universe --release precise --arch i386
Cleaning binary step
The ubuntu-defaults-image is made with the live-build command. Internally it's based on three steps: bootstrap, chroot and binary. For changing something inside the chroot and create the image again you need to clean the binary step already performed first:
$ ubuntu-defaults-binary-clean
Operating the chroot
Before operating inside the chroot you need to fill properly the hosts file, if you need internet access.
$ sudo cp /etc/hosts chroot/etc/ $ sudo cp /etc/resolv.conf chroot/etc/resolv.conf
Then you can jump inside the chroot
sudo chroot chroot
Now you need to set up the chrooted enviroment, first:
mount none -t proc /proc mount none -t sysfs /sys mount none -t devpts /dev/pts export HOME=/root export LC_ALL=C
Now you can operate inside the chroot. (IE: you can install/remove/upgrade packages).
At the end you need some cleaning before exiting:
apt-get clean rm -rf /tmp/* rm /etc/resolv.conf > /etc/hosts umount -lf /proc umount -lf /sys umount -lf /dev/pts exit
Creating binary image
For creating the ISO image again, based on the existing chroot you can use the ubuntu-defaults-binary command:
$ ubuntu-defaults-binary
ItalianCD/Tools (last edited 2012-03-24 12:14:48 by 78)