|
The other day I had to come up with a way to transfer a Solaris Express nv97 DVD 3G image to remote locations while not using the network. The reason for this is, I needed to perform a LiveUpgrade on over 700 boxes and each being at a different locations. So I said to myself I guess I can put this image on a custom LiveDVD... But then I said to myself, which Linux LiveCD/DVD distro will I use???? It has to be small enough so that I can fit the Solaris Express nv97 image as well as the LiveCD Image.
I thought to first use Knoppix or Puppet Linux or even DSL Linux.. But after going through there documentation I was like ok, this is getting confusing!!! I decided to try first Knoppix and let me tell you during the compression phase it failed every time. Then I was on my way to try Puppy Linux, but right before I did that I ran into SLAX Linux. And I am so glad that I did! The instructions were straight to the pointand not to metnion easy to read.
So in this HowTo I will show you how to remaster your own LiveCD/DVD image using SLAX and some of the cool things that you can do with SLAX. All comments are appreciated and if you found this HowTo helpful then please digg and leave a comment. Thank You.
I would suggest that you have either VirtualBox or VMware installed so you can do all your testing on VirtualMachines.
Requirements for me for this project were....
- Solaris Express nv97 DVD Image must fit on LiveDVD
- sshd needs to be started with a valid root password
- The Image needs to be shared via NFS
This HowTo makes some assumptions...
- You have used Linux before and understand how to use a terminal
- You have used either VirtualBox or VMware Workstation
- Create a VirtualDisk of at least 10G for this example... Now normally this all really depends on how many extra packages you want and files you want to addto the live Image that you are creating.
The first thing that you need to do is to download SLAX from this link SLAX. Now using either VirtualBox or Vmware, boot into SLAX using the ISO image you downloaded. Once you are logged into the system you will follow the steps below...
- fdisk -l { The reason for this command is that you want to see what available disk you have to use for this LiveDVD }
- fdisk /dev/sda { This command you will use to create the partition you want to use }
- mkfs.ext3 /dev/sda1 { This command will create the ext3 filesystem on /dev/sda1 }
- fdisk -l { This command will show you the available partition that you just created above }
- mkdir /mnt/NewSlax { here you will create the directorywhere you will mount the newly created filesystem }
- mount /dev/sda1 /mnt/NewSlax/ { Here you will mount the newly created filesystem on /mnt/NewSlax }
- df -h { Here you will see the newly mounted drive and where it is mounted }
- cp -rfpa /mnt/live/mnt/hdc/* /mnt/NewSlax/ { This is where you will copy the entire SLAX Live env to the newly mounted partition }
- Time to download the 3G Solaris Express nv97 image from here. Please make sure you save it into the IMAGES directory that you will create as so... mkdir /mnt/NewSlax/slax/IMAGES { This will take a while so spawn a new shell and contnue the following steps }
- cd /mnt/NewSlax/slax/modules/ { Here you will change into the Live environment and change into the modules directory }
- wget http://www.slax.org/modules/618/dl/sshd-activate.lzm { Here we will download the sshd activate lzm compressed module, all this module contains is a sshd startup script so that sshd will start up by default as sshd comes with SLAX }
- cd ~ { We now change back into our home directory which is /root/ }
- wget http://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware-12.1/slackware/n/nfs-utils-1.1.2-i486-1.tgz
{ SLAX does not come with NFS support so we have to add it by downloading the slackware package of nfs-utils }
- wget http://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware-12.1/slackware/n/portmap-6.0-i486-1.tgz
{ In order to install nfs-utils we will also need portmap for nfs to work }
- tgz2lzm nfs-utils-1.1.2-i486-1.tgz nfs-utils-1.1.2-i486-1.lzm { Time to convert the SLACKWARE tgz packaged nfs-utils using the custom built slax tool for converting slackware to lzm compressed modules for SLAX }
- tgz2lzm portmap-6.0-i486-1.tgz portmap-6.0-i486-1.lzm { repeating the same process above }
- mv *.lzm /mnt/NewSlax/slax/modules/ {Now we need to move the newly created LZM modules to the new live module directory in /mnt/NewSlax/slax/modules/ }
- Now it is time for us to create our own custom compressed module aka custom startup script. First thing to do is to create the directory structure of where you are going to place the files under the root aka '/' directory.
- mkdir -p MySampleRcScript/etc/rc.d/init.d
- mkdir -p MySampleRcScript/etc/rc.d/rc3.d
- cd MySampleRcScript/etc/rc.d/init.d/
- vi rc.mySampleRc { Here we need to create our startup script, in this startup script we will change the root password to test and the rest you can read off of the screenshot :) }

- cd ../rc3.d/
- ln -s ../init.d/rc.mySampleRc SmySampleRc { Here we will symlink the original script to the default run level rc3.d directory and make sure to append a capital S in front of the startup script so that when sysv runs it will catch that script and start up properly. }
- ln -s ../init.d/rc.mySampleRc KmySampleRc { Same as above except to stop the script during the shutdown process. }
- cd ~ { We now will change back into the root directory so that we can prepare for the final stage of the module creation }
- dir2lzm MySampleRcScript MySampleModule.lzm { Final stage of the module creation.... the dir2lzm will take that directory structure and convert it into the lzm compressed module }
- cp MySampleModule.lzm /mnt/NewSlax/slax/modules/ { Now we will copy the newly created module into the new live environment module directory }
- cd /mnt/NewSlax/slax/ { we ar almost done, we will now change into the new live environment root directory and prepare for the final step }
- ./make_iso.sh /mnt/NewSlax/NewSlax.iso { At last the final step and all you need to do is run a simple script called make_iso.sh}
- ls -ltrh ../ { The image should be a little above 3Gigs which is good considering you have a 3Gig iso image and a liveDVD environment under one dvd. }
  
  
  
 
|