Wednesday, 29 August 2012

Customising your boot CD

Trying to roll-your-own version of Linux used to be more stressful then being trapped in a basement during the zombie apocalypse with someone who suddenly develops flu-like symptoms.   Mercifully, this is no longer the case (depending what distro you are using), a set of the 'remastersys' scripts are included on some distos to simplify the process.  I am assuming that you know some basic linux for this post!

The engine of my preview system is the CAINE bootable CD (version 2.0).   To create your own system you will need to get the dd image (if you want the simplest solution).  Once you have downloaded and unzipped the image, you just need to write the image to a 2GB thumbdrive (or larger).   Remember that you are sending the image to the physical device, not to a file in a file system on your thumbdrive. The first sector of the image needs to be written to the first sector on the thumbdrive.   To do this you can use any linux distro, just open a terminal and type:
sudo dd if=/path/to/image of=/dev/sdb
This assumes that your thumbdrive is identified as /dev/sdb. You will be prompted for the root password for the system, type it in and wait several minutes until the copying is complete.   You now have a bootable thumbdrive that you can boot any computer with - assuming the BIOS supports USB booting.  You can go ahead and boot any machine with the thumbdrive, simply configure the BIOS to boot from the USB drive.

Bear in mind that it is unlikely that any wireless cardvdrivers are going to be available, you should anticipate using an ethernet cable to access the internet.
Once the system is up and running, you can add and remove programs using the synaptic packet manager, or downloading and installing programs manually.

Any scripts that I publish here, or you download from other sites, I recommend putting in the /usr/local/bin directory.
Remember to make all scripts executable by changing the permissions, like this:
sudo chmod a+x /usr/local/bin/
The root passord is "caine".

All you need to do now is generate the .iso image so you can create a bootable CD of your distro.   You can do this with the remastersys scripts - there is a nice GUI available in the menu, to help you along.   These screenshot shows the path to the GUI and the resulting dialog boxes:
Make sure you select the modify option for the first run, we are going to have to configure remastersys with some parameters.   Once you select modify, the following dialog box appears:

What we need to do with the above options is select the directory where we want the .iso created.  The .iso will be about 600mb, although other temporary files will be written so figure you will need 1.2 GB of space.  You probably won't have space on your thumbdrive, so we can send the .iso image to a directory where we are going to mount and external drive or thumbdrive. The "working directory" field is the FULL PATH we want to send our .iso file to.  In my example, I have a directory at /stuff where I mount an external drive to receive the .iso image.  It is VERY IMPORTANT that you also put the same path into the "Files to Exclude" field - otherwise all the data on your external drive will be included in the .iso!!.  Give your .iso file a name in the Filename field then select the "Go back to main menu" option, you will be taken to this dialog box:

Select the dist option and press OK.   A terminal will open and you will be able to follow the progress of your .iso being created.  You will find the .iso in a directory called "remastersys" in the path that you specified previously.  Make sure that you have mounted your external drive in READ/WRITE mode at the directory you specified in the settings.

Your .iso image can now be burned to as many CDs as you like.

Now I must feed...but when my grim business is done we will start on some scripting.

No comments:

Post a Comment