- Showing My Geek - http://blog.ogwatermelon.com -

Custom Linux Live CD using Tiny Core Linux

Recently I needed to develop an easy way to get a PXE image pushed out to 400 or more clients for temporary operations.  I already have one build but it tended to be too large and would take a while to boot all the machines.  So Tiny Core and it’s small file size really makes a big difference.  My original image was 250 MB and with Tiny Core it was whittled down to about 12 MB.

To modify the and build a custom live CD is rather easy.  First you should start with a computer that you can install Core Plus on to.  This version is about 64 MB and has everything you need to remaster from the get go.  Plus using a hard drive allows you to move the files to an area that will not be cleared as soon as you reboot the machine.

I booted up CorePlus and installed it to the hard drive that way I didn’t have to keep reloading and I could save changes I have made.  So once it is install you can use the ezremaster app.  This is pretty easy to use and allow you to add in packages and of course take them out.

So you can change the location that you want the files extracted to and then the core.tgz file that you want to use to build the image.  Next you get to pick packages that you want, but I only selected the once that were installed and the removed the wireless and erremaster apps.  I don’t need them for the PXE image I plan to use.  So I open the extracted file directory and began to add the Linux binaries that I need to the Bin directory.  After that was completed I wrote a few scripts that would auto launch once it fully loaded.  This distro loads by default into the tc user.  So to make things auto launch you need to add the scripts to the .X.d directory.  you will have to do a little testing and I had to use the sudo command in several locations for it to work correctly.  Here is what my login screen look like with my script launch automatically.

Now that all of my editing is complete I opened back up the ezremaster app and created an ISO of the extracted files.  Then I opened up the extracted files and created a directory in /mnt for my ISO to be auto mounted.  Then I copied over the ISO to the mnt directory and edited my auto launch script to mount my ISO to /mnt/ISO.  This way I could remove the CD once it booted up and I could use it somewhere else if needed.  So I ran ezremaster once again to create the ISO I would use to test.

I burned a disk and booted it up.  It worked great.  I would load the disk, start the control panel, launch the mount tool , and launch the terminal server.  Then I would unmount the CD and configure the terminal server pointing it to /mnt/ISO.  Then of course I would finish the IP scheme and the rest of the terminal server configuration.  Once all of this was done I could eject the CD and begin testing the PXEboot on other machines.  I worked and auto launched right into the script.  I did find one problem though, once my script was done running the windows would exit and I didn’t want this to happen.  Well it turned out my script had an exit statement that needed to be removed.  So I had to repeat the entire process to finally get my fully functional disk.

We used the disk the very next day on 430 some workstations and laptops without any problems.  Plus you still had the ability to run the disk by itself to accomplish the same task for individual machines if needed.

This had all come about because the previous disk I had made was around 250 MB and it had problems with VLANs.  This disk fixed both by shooting across the network really fast and booting even faster and the VLANs were never a problem because you could use IP space that is on that VLAN.  So if you find a task that needs to be accomplished with a PXEboot you may want to look into Core Linux to build a small, fully configurable image to accomplish your task.

4 Comments (Open | Close)

4 Comments To "Custom Linux Live CD using Tiny Core Linux"

#1 Comment By Inder On September 24, 2016 @ 14:51

May ask the steps used to add a script file to .X.d. directory to build CorePlus installation image (iso)?

#2 Comment By Inder On September 25, 2016 @ 01:24

How to “…add the scripts to the .X.d directory”?

#3 Comment By ogwatermelon On September 26, 2016 @ 13:17

It has been awhile since I wrote this so I am shooting in the dark right now. But you will have to be root and the easiest way would be to us vi or nano and add the script text to the editor and save it to that directory. Otherwise you will have to have a file created on another Linux install or used an app such as dos2unix to convert the file to a file Linux can use. I am at work right now and will look at it tonight and get back with the exact way you can add scripts to the directory. Just in case there are permissions that I need to address for it to work. Thanks for leaving a comment.

#4 Comment By ogwatermelon On September 28, 2016 @ 13:04

Ok, the permissions are nothing special and after I thought about it you create the ISO file using the TinyCore application. Once the ISO is completed you need to use a Linux machine to extract the ISO files to a directory. Then add the scripts that you want to auto run. Once that is completed use: mkisofs -o /where you want it/example.iso /source/directory/ to create an ISO that has you scripts in place. You will need to test it to insure you added the files correctly and that they work. If you have other question feel free to ask.