Overclockix builder utils prerequisites
In order to use the 'overclockix_builder_utils' script, you will need a Debian based operating system with the following packages installed:
- genisoimage
- live-build
- squashfs-tools
You also need to download the
isohybrid.pl script and place it in '
/usr/bin/'. Make sure to make the isohybrid.pl script executable after downloading it.
Please note that you must either be running squeeze or using the 'live-build' package from squeeze! The 'live-build' package in wheezy is not working correctly when creating an image from scratch!
Note: All examples in these instructions are for the i386 architecture. To build an amd64 image, simply use 'amd64' where you see 'i386'.
========================================
Creating a new 'iso-hybrid' image
You should download the
overclockix template and
overclockix builder utils which i have created. On my system, I have a working directory for LiveCD builds called '
/opt/live/i386' which I downloaded the template archive to. The builder utils should be saved to '
/opt/live/scripts'. If you wish to use a directory other than '
/opt/live', you need to modify the script to change the '
live_dir' variable which is found in the '
choose_branch' function. The build utils also includes a testing branch which is found in '
/opt/live_testing' by default.
Extract the archive and rename it to the type of image you want to correct (ie - '
iso-hybrid').
Code:
tar zxvf overclockix_template_i386.tar.gz
mv overclockix_template iso-hybrid
Change directory to the new Overclockix project directory. you will need to customize the config file for the specific build:
In '
auto/config', you will need to change the '
--packages-lists' directive to the base desktop build of your choice. For example:
Code:
--packages-lists "gnome-core" \
If you want to enable '
copy image to testing' in the menu, you will need to customize the function '
copy_iso_to_testing' to point to the location of your choice, more specifically, the '
testing_dir' variable.
From here, we are ready to perform our initial build. As root (or using sudo), execute the build script (which is located in the '
/opt/live/scripts' directory):
Code:
sudo /opt/live/scripts/overclockix_builder_utils
Choose the architecture you want to work on (i386). Next, choose the image type (iso-hybrid). First we need to create a base image using live-build. Simply choose '
create a base image from live-build' from the menu.
This process will take a while as it is basically installing a new system in a chroot environment.
As long as you do not get any errors, you should now have a '
binary-hybrid.iso' file in your project directory. This is your new livecd image:
Code:
root@athena:/opt/live/i386# ls -l iso-hybrid
total 324944
drwxr-sr-x+ 4 root ocdev 4096 Mar 15 09:09 auto
drwxr-sr-x+ 6 root ocdev 4096 Mar 15 10:08 binary
-rw-rw-r--+ 1 root root 332193792 Mar 15 10:08 [COLOR="Orange"]binary-hybrid.iso[/COLOR]
-rw-rw-r--+ 1 root ocdev 2143 Mar 15 10:08 binary.list
-rw-rw-r--+ 1 root ocdev 171662 Mar 15 10:08 binary.log
-rw-rw-r--+ 1 root ocdev 11235 Mar 15 10:08 binary.packages
drwxr-sr-x+ 6 root ocdev 4096 Mar 15 10:08 cache
drwxr-xr-x+ 20 root root 4096 Mar 15 10:08 chroot
drwxr-sr-x+ 22 root ocdev 4096 Mar 15 10:02 config
drwxrwsr-x+ 2 root ocdev 4096 Mar 15 09:13 scripts
Next, run the build script again and choose '
extract image to live fs'. This function will prompt you to enter the name of the image file which you would like to use. This will unpack the image for you to work on. If you need to drop files into the chroot, it is extracted to '
./fs'. Now choose '
chroot to live fs from files' and you will be dropped in the chroot of the extracted squashfs so that you can make modifications to the LiveCD environment.
I have my own set of
customizations and
extras install script which i have made available. The only required customization is the '
/etc/live/config.conf' file which sets the username, hostname and full user name for the LiveCD. The rest are just my personal customizations. If you download the customizations archive to '
/opt/live/temp/i386/sources' and keep the same file name, you can apply my customizations from the build script using '
deploy customizations to live fs'. Alternatively, you can simply extract the archive in the same location as the work_dir (in this case, '
/opt/live/i386/iso-hybrid/'), they will be applied automatically at this stage. I am also including applications which need to be compiled manually to the customizations.
If you have performed any apt/aptitude functions, you will want to clear the file cache before exiting using '
apt-get clean'. This will remove the downloaded archives to save space. Once you have finished, you simply type '
exit' and you will be dropped back to the menu.
If you are ready to build the new image file, just choose '
build new squashfs' and it will build the new squashfs (root file system) and then run '
repack image' and it will repack the image for you. It will create the image as '
newcd.iso' as seen below:
Code:
root@athena:/opt/live/i386# ls -l iso-hybrid
total 826684
drwxr-sr-x+ 4 root ocdev 4096 Mar 15 09:09 auto
drwxr-sr-x+ 6 root ocdev 4096 Mar 15 10:08 binary
-rw-rw-r--+ 1 root root 332193792 Mar 15 10:08 binary-hybrid.iso
-rw-rw-r--+ 1 root ocdev 2143 Mar 15 10:08 binary.list
-rw-rw-r--+ 1 root ocdev 171662 Mar 15 10:08 binary.log
-rw-rw-r--+ 1 root ocdev 11235 Mar 15 10:08 binary.packages
drwxr-sr-x+ 6 root ocdev 4096 Mar 15 10:08 cache
drwxr-xr-x+ 20 root root 4096 Mar 15 10:08 chroot
drwxr-sr-x+ 22 root ocdev 4096 Mar 15 10:02 config
drwxr-sr-x+ 20 root root 4096 Mar 14 18:30 fs
drwxr-sr-x+ 5 root ocdev 4096 Mar 14 18:43 iso
-rw-rw-r--+ 1 root ocdev 513265664 Mar 15 10:41 [COLOR="Orange"]newcd.iso[/COLOR]
drwxrwsr-x+ 2 root ocdev 4096 Mar 15 09:13 scripts
If you want, you can change the default output name of the new ISO. It is hard coded in the build script. Next, take your new image for a spin and make modifications as you wish.
========================================
Modifying a 'iso-hybrid' image
If you need to go back into the chroot environment and you have the image has already been extracted to '
/fs' and '
/iso', execute the build script and choose '
chroot to live fs from files' from the menu.
If you want to take an existing image file created using this method, you can extract it by executing the build script and choosing '
extract image to live fs'.
This will extract the filesystem and choose '
chroot to live fs from files' to drop you into a chroot environment. Once you have made your changes, you simply need to build new squashfs & repack image as before.
========================================
Creating a new 'usb-hdd' image
You should download the
overclockix template and
overclockix builder utils which I have created. On my system, I have a working directory for livecd builds called '
/opt/live/i386' which I downloaded the template archive to. The builder utils should be saved to '
/opt/live/scripts'. If you wish to use a directory other than '
/opt/live', you need to modify the script to change the '
live_dir' variable which is found in the '
choose_branch' function. The build utils also includes a testing branch which is found in '
/opt/live_testing' by default.
Extract the archive and rename it to the type of image you want to correct (ie - '
usb-hdd').
Code:
tar zxvf overclockix_template_i386.tar.gz
mv overclockix_template usb-hdd
Change directory to the new Overclockix project directory. You will need to customize the config file for the specific build:
In '
auto/config', you will need to change the '
--packages-lists' directive to
be blank. Since we are using the squashfs from the iso-hybrid build, all we need is a base install to work from. Also, you will need to change the '
--binary-images' directive to '
usb-hdd'. For example my config file looks like:
Code:
#!/bin/sh
lb config noauto \
--distribution squeeze \
--archive-areas "main contrib non-free" \
--architecture i386 \
--linux-flavours 686 \
--syslinux-timeout 30 \
--syslinux-menu true \
--bootappend-live 'persistent' \
--binary-images [COLOR="Orange"]usb-hdd[/COLOR] \
--packages-lists "" \
--apt-recommends false \
"${@}"
# default lists found in /usr/share/live/build/lists/
If you want to enable '
copy image to testing' in the menu, you will need to customize the function '
copy_iso_to_testing' to point to the location of your choice, more specifically, the '
testing_dir' variable.
From here, we are ready to perform our initial build. As root (or using sudo), execute the build script (which is located in the '
/opt/live/scripts' directory):
Code:
sudo /opt/live/scripts/overclockix_builder_utils
Choose the architecture you want to work on. Next, choose the project. First we need to create a base image using live-build. Simply choose '
create a base image from live-build' from the menu.
This process will take a while as it is basically installing a new system in a chroot environment.
As long as you do not get any errors, you should now have a '
binary.img' file in your project directory. this is your new image:
Code:
root@mirage:/opt/live/i386# ls -l usb-hdd
total 121468
drwxr-sr-x 4 root ocdev 73 Mar 28 13:40 auto
drwxr-sr-x 6 root ocdev 71 Apr 6 09:10 binary
-rw-r--r-- 1 root root 128974848 Apr 6 09:10 [COLOR="Orange"]binary.img[/COLOR]
-rw-r--r-- 1 root ocdev 2143 Apr 6 09:10 binary.list
-rw-r--r-- 1 root ocdev 61256 Apr 6 09:11 binary.log
-rw-r--r-- 1 root ocdev 3008 Apr 6 09:10 binary.packages
drwxr-sr-x 6 root ocdev 98 Apr 6 09:10 cache
drwxr-xr-x 20 root root 4096 Apr 6 09:10 chroot
drwxr-sr-x 22 root ocdev 4096 Apr 6 09:04 config
If you need to drop files into the chroot, it is extracted to '
./fs'. Now choose and you will be dropped in the chroot of the extracted squashfs so that you can make modifications to the livecd environment.
Next, run the build script again and choose '
extract image to live fs'. This function will prompt you to enter the name of the image file which you would like to use. This will unpack the image for you to work on. Normally you would choose '
chroot to live fs from files' to drop you in the chroot of the image so that you can make modifications to the livecd environment but it skips this setup when using a 'usb-hdd' image. In order to make things easier to maintain, we are going to make the newly created '
usb-hdd' image share the squashfs (root filesystem) with the '
iso-hybrid' image. You will be prompted to choose a project to use as a base for the fs and squashfs. Once you do that, it will automatically create the symlinks required to link it to the '
iso-hybrid' image.
Code:
root@mirage:/opt/live/i386/usb-hdd# ls -l
total 659516
drwxr-sr-x 4 root ocdev 73 Mar 28 13:40 auto
drwxr-sr-x 6 root ocdev 71 Apr 6 09:10 binary
-rw-r--r-- 1 root root 128974848 Apr 6 09:24 binary.img
-rw-r--r-- 1 root ocdev 2143 Apr 6 09:10 binary.list
-rw-r--r-- 1 root ocdev 61256 Apr 6 09:11 binary.log
-rw-r--r-- 1 root ocdev 3008 Apr 6 09:10 binary.packages
drwxr-sr-x 6 root ocdev 98 Apr 6 09:10 cache
drwxr-xr-x 20 root root 4096 Apr 6 09:10 chroot
drwxr-sr-x 22 root ocdev 4096 Apr 6 09:04 config
lrwxrwxrwx 1 root ocdev 40 Apr 6 09:51 [COLOR="Orange"]fs[/COLOR] -> /opt/live/i386/iso-hybrid/fs
drwxr-sr-x 5 root ocdev 77 Apr 6 09:24 iso
Code:
root@mirage:/opt/live/i386/ush-hdd/iso/live# ls -l
total 12212
-rwxr-xr-x 1 root root 3008 Apr 6 09:10 filesystem.packages
lrwxrwxrwx 1 root root 60 Apr 6 09:31 [COLOR="Orange"]filesystem.squashfs[/COLOR] -> /opt/live/i386/iso-hybrid/iso/live/filesystem.squashfs
-rwxr-xr-x 1 root root 10027226 Apr 6 09:10 initrd.img
-rwxr-xr-x 1 root root 164508 Apr 6 09:10 memtest
-rwxr-xr-x 1 root root 2298016 Apr 6 09:10 vmlinuz
In order to support the building of the '
usb-hdd' images, you will need to install the following packages in your '
iso-hybrid' image's chroot: mtools, parted, & syslinux. (See
modifying a 'iso-hybrid' image for more information).
If you are ready to build the new image file, just choose '
repack image' and it will repack the image for you. It will create the image as '
newbinary.img' as seen below:
Code:
root@mirage:/opt/live/i386/usb-hdd# ls -l
total 659516
drwxr-sr-x 4 root ocdev 73 Mar 28 13:40 auto
drwxr-sr-x 6 root ocdev 71 Apr 6 09:10 binary
-rw-r--r-- 1 root root 128974848 Apr 6 09:24 binary.img
-rw-r--r-- 1 root ocdev 2143 Apr 6 09:10 binary.list
-rw-r--r-- 1 root ocdev 61256 Apr 6 09:11 binary.log
-rw-r--r-- 1 root ocdev 3008 Apr 6 09:10 binary.packages
drwxr-sr-x 6 root ocdev 98 Apr 6 09:10 cache
drwxr-xr-x 20 root root 4096 Apr 6 09:10 chroot
drwxr-sr-x 22 root ocdev 4096 Apr 6 09:04 config
lrwxrwxrwx 1 root ocdev 40 Apr 6 09:51 fs -> /opt/live/i386/iso-hybrid/fs
drwxr-sr-x 5 root ocdev 77 Apr 6 09:24 iso
-rw-r--r-- 1 root root 552599552 Apr 6 09:51 [COLOR="Orange"]newbinary.img[/COLOR]
========================================
Modifying a 'usb-hdd' image
In order to edit your 'usb-hdd' image, you need to edit the live fs of the corresponding 'iso-hybrid' image since they share a squashfs. See
modifying a 'iso-hybrid' image for instructions.