• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Overclockix builder utils

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

mbentley

Gloriously Lead, Overclockix Chief Architect
Joined
Sep 26, 2002
Location
Indianapolis, IN
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:
Code:
nano auto/config

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:
Code:
nano auto/config

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.
 
Last edited:
Overclockix distro team testing build instructions
For those of you who are on the distro team, if you would like to test a new feature that you would like to implement, you don't need to wait on me to have it done. All you need is to grab the latest .iso file (it must be the .iso and not the .img), a Debian squeeze box (amd64 required if you want to test with an amd64 .iso; testing may work but I make no guarantees), and the overclockix builder utils.

For those who would like some more detailed instructions...
Install the obu prereqs. When you download and put isohybrid.pl in /usr/bin, you need to make sure that it is executable (chmod +x /usr/bin/isohybrid.pl), execute the following commands to create the directory structure and install the required files:

Code:
mkdir -p /opt/live_testing/scripts /opt/live_testing/i386 /opt/live_testing/amd64

cd /opt/live_testing/i386/; wget http://www.overclockix.com/sources/i386/overclockix_template_i386.tar.gz; tar zxvf overclockix_template_i386.tar.gz; mv overclockix_template iso-hybrid

cd /opt/live_testing/amd64/; wget http://www.overclockix.com/sources/amd64/overclockix_template_amd64.tar.gz; tar zxvf overclockix_template_amd64.tar.gz; mv overclockix_template iso-hybrid

cd /opt/live_testing/scripts; wget http://www.overclockix.com/sources/overclockix_builder_utils; chmod +x overclockix_builder_utils

Place the latest .iso in '/opt/live_testing/<arch>/iso-hybrid' then run the '/opt/live_testing/scripts/overclockix_builder_utils' script. In the menu, choose 'b.) testing', a or b depending on which architecture you want to work with, then 'a.) iso-hybrid'.

In the main menu, choose 'b.) extract image to live fs' and specify the image you want to use. It will then extract the image and then return you to the main menu. Then choose 'c.) chroot to live fs from files' and then it will drop you into a chroot environment of Overclockix.

If you need to put files into the file system, it gets extracted to '/opt/live_testing/<arch>/iso-hybrid/fs'.

Make whatever changes you want and then exit the chroot environment. Next, choose 'f.) build new squashfs' and then 'g.) repack image'. You will then be left with a new image which is named 'newcd.iso' in the '/opt/live_testing/<arch>/iso-hybrid' directory.

Then you're off and ready to test!
 
Last edited:
Back