WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Custom remaster with extensions  (Read 7876 times)

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Custom remaster with extensions
« on: December 17, 2009, 10:18:57 AM »
##### Udated 5.13.2011   with new features and options.


This script will take your existing tce directory and place it in /opt/tce in a seperate initrd in a CD iso.  Works with tinycore and microcore iso's, though tinycore is used as example.  It will also, when specified, make your current backup available on the cd to be loaded upon boot.  These are the files in the iso that are affected:

/boot/optfiles.gz
/boot/backup.gz
/isolinux/isolinux.cfg

optfiles.gz and backup.gz are new created files, while isolinux.cfg has this line changed:

append initrd=/boot/tinycore.gz quiet max_loop=255

If extensions are added to the /opt/tce in an initrd, but no backup, then this is what that line looks like in the new iso:

append initrd=/boot/tinycore.gz,/boot/optfiles.gz quiet max_loop=255

If both extensions and a backup are added, then the line looks like this:

append initrd=/boot/tinycore.gz,/boot/optfiles.gz,/boot/backup.gz quiet max_loop=255

The backup is made by essentially the same process as the normal backup is made, but the contents are simply placed in it's own initrd.  To make further backups once the cd is booted, just make a backup as usual but you will simple have to specify a backup device, such as "hda2" to save in /mnt/hda2.  Then on reboot, use the restore boot option:

tinycore restore=hda2

Of course, your backup initrd is still there, so if you want to boot without and use a new backup instead, enter this at the boot prompt:

tinycore initrd=/boot/tinycore,gz,/boot/optfiles.gz  restore=hda2

That will not load the backup initrd.  If you want the cd to start as only the original base, you can start like this:

tinycore initrd=/boot/tinycore.gz  base norestore

That is the same as "tinycore base norestore" with the official release.  

------

Now for the making of the custom cd.  It is pretty simple.  While running TC, load your favorite extensions as usual with the appbrowser and prepare your backup settings the normal way.  Then download a current release iso of tinycore.  Name this script mkiso.sh  and run it in the same directory as the downloaded iso.  Here are the options:

$ sudo ./mkiso.sh tinycore-2.6.iso    

You will be prompted with questions about what you would like to include in your remastered iso, if you want to use different kernel image and tinycore/microcore initrds, and if you want  to either use /opt/tce or the base directory of the cd for your tce directory.    

Right now using /opt/tce for extensions,I am running a 393MB iso of my desktop, and idle the RAM use is 477MB out of 1GB after flushing the cache.  Though I am not going to run my desktop  like this every day, the RAM use is not too bad given the mounted mode of the extensions.   My /tmp/tcloop disk usage is 600MB, which means that a copy-to-system approach would use over 1GB of ram once you copied the contents of the extensions to RAM.  Since the extensions are already in RAM, copy-to-system would just add insult to injury so it is not an option. For RAM savings, use the base directory of the cd for the tce directory.  If one is interested they could add the command to their script to touch the appropriate flag in the tce directory.  

Script is attached.
« Last Edit: June 12, 2011, 06:43:58 AM by Jason W »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #1 on: November 04, 2010, 08:59:09 PM »
Fixed the mount issue and added option to use the base tce directory on the cdrom as a tce directory
for added choice, in addition to the previous /opt/tce tce directory.  In the early days I once had only
access to a Windows box with ntfs hard drive, limited RAM, and non-working usb ports.  Though it
is not the most flexible method, using the base tce directory on a cdrom for extensions to mount from
the cd is useful in some special purposes of low ram and limited or no other storage access.

There are several remaster utilities to choose from, each with perhaps a specific purpose, use what works for you.  I find this one easiest and most flexible for my needs, to each his own.

The previous instructions are confusing, to make if very simple, download a tinycore or microcore iso along with this script in the same directory, using "chmod +x mkiso.sh" if needed to make this run.

then at a root terminal issue  without quotes "./mkiso.sh tinycore_3.2.iso" if the filename is tinycore_3.2.iso.  Then just answer the questions.

Offline tclfan

  • Sr. Member
  • ****
  • Posts: 286
Re: Custom remaster with extensions
« Reply #2 on: November 05, 2010, 07:03:09 AM »
Hi Jason,

Thanks for continuing re-mastering tools project.
Just to let you know, this effort is appreciated.



Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #3 on: November 05, 2010, 07:59:28 AM »
Thanks.  I hesitated to update it since there are already a few remaster scripts out there as well as ezremaster which is surely the most thorough.  But also I like having choice, just like having Firefox in the repo does not mean we should not have Chromium, Opera, Midori, Links, etc.  

I see a major bug in it that came along with the changes, I will fix it tonight.  As well as I will add the choice to use a 64 bit kernel image as some folks are running it instead of standard.  

To do that I will likely prompt to enter the path to the 64 bit kernel image file as one may be using a non-current release.  Maybe the same for the tinycore.gz/microcore.gz file also.  In fact, I may provide an option to specify the bzImage and tinycore.gz instead of having to use an existing iso image.  Since the main purpose of this utility is to simply create a snapshot of your current running system with the option to add files to the initrd, the option to use the bzImage and initrd you booted with makes sence.

« Last Edit: November 05, 2010, 08:04:13 AM by Jason W »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #4 on: November 05, 2010, 07:19:34 PM »
Fixed bug, and added ability to choose a different kernel image and tinycore/microcore initrd image
than the one in the iso being used by specifying thier file path when prompted. 

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #5 on: December 18, 2010, 10:35:50 AM »
Reorganized script without changing behavior.

Also added a simple --clone-system function that will use your current backup and tce directory, asking only the location of your desired tce directory (/opt/tce or base cd) and also whether you want to edit boot parameters. 

This avoids the long and possibly confusing set of questions for those who want to simply set up their system and then put a clone of it on CD.

Either the command "mkiso.sh tinycore-3.4.iso --clone-system"  or "mkiso.sh --clone-system tinycore-3.4.iso" will work for an iso image named tinycore-3.4.iso.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #6 on: May 13, 2011, 06:18:47 AM »
Added a command line option "--add-initrd-only" that will simply ask for an initrd .gz to add to the remaster.  

./mkiso.sh tinycore-current.iso --add-initrd-only           or

./mkiso.sh --add-initrd-only tinycore-current.iso


Still works with microcore.  More than one initrd can be added to the remaster, you are prompted after each addition if you want to add another one. 

If not using the "--add-initrd-only" option, you still have the opportunity to add an initrd file(s) during the normal routine of selecting options.
« Last Edit: May 13, 2011, 06:20:35 AM by Jason W »

Offline meo

  • Hero Member
  • *****
  • Posts: 563
Re: Custom remaster with extensions
« Reply #7 on: September 09, 2011, 03:38:17 PM »
Hi!

Looks nice, will try!  ;)

Have fun,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2857
Re: Custom remaster with extensions
« Reply #8 on: September 10, 2011, 01:06:20 PM »
Thanks, just what I was looking for :)

Offline cast-fish

  • Hero Member
  • *****
  • Posts: 931
  • hi there
Re: Custom remaster with extensions
« Reply #9 on: September 11, 2011, 08:11:02 AM »
Jason,

i have been reading this thread with some interest and just want a very simple watered down
explanation of what your script achieves with regard to ;

is this correct?

1) A person who already has TCL on cd and is booted off CD can go ahead and download extensions
to create the TCL they desire. They also then download your script and place a blank CD in the machine.

2) Are they then able to simple clone the running TCL down onto a new burn blank CD disc? Thus giving them
a custom version of TCL?

3) What else do you consider is the obvious use of your script?  1) They can choose their own Kernel.

4) What else?...is your script Menu driven and asks many questions about the type of remaster a person
desires to make?

For example, could you use this script to make a custom version of TCL that has the realtime kernel?

thanks

V.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #10 on: September 11, 2011, 09:24:26 AM »
Basically, in it's simplest use,  "./mkiso.sh tinycore-current.tcz --clone-system",  you install and set up a running TC like you want it, and then run the script against an iso image and it will make an iso that is a clone of your running system.  The basic option is to either have the extensions placed in /opt/tce or in the /tce directory of the CD image.  If you want a static appliance for an older machine, go with the /tce on CD, otherwise /opt/tce is more flexible. 

Each remaster script/app has it's intended use, but I personally find it easier to set up a system and basically clone it than I do to select apps and such from a menu to create a cd.  Just personal preference. 

Of course, this does not automatically burn a cd, but just creates an iso image.

If the --clone-system flag is not used, it asks do you want to include your presently installed extensions into the remaster, where to put them (/opt/tce/, /tce on CD), do you wish to include your backup into a separate initrd that gets loaded on boot, do you wish to add more files, do you wish to add more .gz initrd files, do you wish to use a different kernel image, and do you wish to use a different tinycore.gz/microcore.gz than on the iso being used.

Let me know of any other questions.

Offline cast-fish

  • Hero Member
  • *****
  • Posts: 931
  • hi there
Re: Custom remaster with extensions
« Reply #11 on: September 11, 2011, 10:34:11 AM »
Jason,

ok thanks for that.

So "against an iso" means it looks at the current booted iso that is on the source media?
then also looks at the current running tcl session , and then creates a custom .iso of the whole
thing?

that is my understanding as best i can.

no but seriously, i am all for these useful creations that can make tcl more straight forward.
i can see how many users would like to have a "custom tcl" cd disc. Maybe not
just one tcl disc but several custom tcl discs. Where-by the whole system is just a one
shop thing.

Somebody made a script that does a complete install of tcl. You just boot the
multicore cd and run the script at the desktop. One single command and it
does everything else and leaves you with a tcl hard drive install (machine)

V.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #12 on: September 11, 2011, 01:40:45 PM »
The iso and base files by default is used from the iso that you issue the command with, not the one in the cd tray.  Though it could be made to use the cd in a specified drive, the official iso's are a small download and trivial to obtain.  If TC iso's were over 100MB then it would be very useful to make use of a mounted cdrom.


Offline cast-fish

  • Hero Member
  • *****
  • Posts: 931
  • hi there
Re: Custom remaster with extensions
« Reply #13 on: September 11, 2011, 02:28:35 PM »
Right.

I see.

Well thanks for the explanation, Really, thanks for making the script and for it's
simplicity. It seems a convenient script to use for making tcl remaster .iso files.
(i like the fact that the script will ask you if you want to edit any bootcodes.) This script
could be useful for more than just one or two reasons.

V.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9619
Re: Custom remaster with extensions
« Reply #14 on: October 16, 2011, 06:19:25 PM »
Thanks folks for the interest in this utility, but after getting familiar with ezremaster recently, I see it covers the needs which I aimed to address here, system cloning and all.  It is the team's official remaster utility available in the repo and multicore.  I had fun working on this script, but it is time to retire it.  It will stay up for code reference and historical purposes.