WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Remastering Question  (Read 2866 times)

Offline leekimpark

  • Newbie
  • *
  • Posts: 14
Remastering Question
« on: June 29, 2012, 02:08:40 AM »
I've been trying to remaster TCL by adding in mysql (outside initrd and on boot) and I succeeded in creating an iso using ezremaster. The problem is that when I use said iso to install TCL, mysql is not included after installation. How can this be fixed, or is this just not possible and I have misunderstood what is meant by remastering? Sorry if I posted this in the wrong forum.
« Last Edit: June 29, 2012, 02:12:41 AM by leekimpark »

Offline leekimpark

  • Newbie
  • *
  • Posts: 14
Re: Remastering Question
« Reply #1 on: July 01, 2012, 10:41:51 PM »
After looking around the forums some more, I found http://forum.tinycorelinux.net/index.php/topic,4261.msg22536.html#msg22536 So yes, I have misunderstood the meaning of remastering. Luckily though, what I am trying to accomplish is very similar to the topic of the linked thread.
curaga said:
Quote
If you have the usb stick ready, with the desired extensions and backup, just make an image of that usb stick.

dd if=/dev/sda of=myimage

Replace sda with your usb stick device. This image may be applied to an usb stick within windows with one of the rawrite tools, some of them graphical. The destination usb stick has to be at least the size of your source stick.

edit: Ah, I missed it was on the SSD. Well, in that case, just put in a usb stick, format ext2, and copy everything there. And make it bootable. This would make it easy for other Eee users to try it.

Installing it would be just copying everything to the hard drive, and making it boot. In the linux eee's it's just adding a grub entry.
Can someone explain how one would go about doing the last two steps that he mentioned, as well as if it is possible to make the entire process automated through a cd installer.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11635
Re: Remastering Question
« Reply #2 on: July 01, 2012, 11:49:08 PM »
Hi leekimpark
After using the CD to install, you could try something like this:
Code: [Select]
cd /mnt/sr0/DirectoryContainingMysql
mkdir -p /mnt/DestinationDrive/tce/optional
cp mysql.* /mnt/DestinationDrive/tce/optional
for i in `cat mysql.tcz.dep`; do cp $i* /mnt/DestinationDrive/tce/optional
Adjust the source and destination to match your system.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Remastering Question
« Reply #3 on: July 01, 2012, 11:55:39 PM »
There is one situation where I have to create a remastered ISO of tc from a Virtual Machine , which includes a directory containing specialized data outside of the initrd (as in your case could be mysql database).  On booting the burned cd (from this ISO)  a script which runs from bootlocal.sh mounts all drives, finds the directory and proceeds to import the contents into a specific location of the file system.

While I use a Windows app to inject the directory and data into the ISO outside of the initrd, I believe there are many methods to accomplish this and extensions to help in the repo, then you'll just need to write a script. 
« Last Edit: July 01, 2012, 11:59:54 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Remastering Question
« Reply #4 on: July 02, 2012, 12:04:58 AM »
On the other hand why make thing so difficult,  simply add mysql to the backup then be sure to add the backup  into the remaster when prompted?

Offline leekimpark

  • Newbie
  • *
  • Posts: 14
Re: Remastering Question
« Reply #5 on: July 02, 2012, 01:39:38 AM »
Hi leekimpark
After using the CD to install, you could try something like this:
Code: [Select]
cd /mnt/sr0/DirectoryContainingMysql
mkdir -p /mnt/DestinationDrive/tce/optional
cp mysql.* /mnt/DestinationDrive/tce/optional
for i in `cat mysql.tcz.dep`; do cp $i* /mnt/DestinationDrive/tce/optional
Adjust the source and destination to match your system.
Is there anyway to automate this after installation, so that these commands are run immediately after installation, that, or maybe the installation changes the bootlocal.sh file as coreplayer2 suggested?
On the other hand why make thing so difficult,  simply add mysql to the backup then be sure to add the backup  into the remaster when prompted?
Sorry, can you explain this more, I'm fairly new to tcl, so I'm not sure what the backup is. Are you talking about mydata.tgz?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11635
Re: Remastering Question
« Reply #6 on: July 02, 2012, 02:34:19 AM »
Hi leekimpark
While it may be possible to automate this, it's too easy to get wrong, so I won't attempt it. How about this:
Create a file called  CopyMysql  containing
Code: [Select]
#!/bin/sh
SRC=$1
DEST=$2

cd /mnt/$SRC/DirectoryContainingMysql
mkdir -p /mnt/$DEST/tce/optional
echo mysql.tcz >> /mnt/$DEST/tce/onboot.lst
cp mysql.* /mnt/$DEST/tce/optional
for i in `cat mysql.tcz.dep`; do cp $i* /mnt/$DEST/tce/optional
Replace   DirectoryContainingMysql   with the path to where the extension is on the CD, for example,  cde/optional
if that is where the extension is in your remaster.
Make the file executable by entering    chmod 755 CopyMysql
To run the script, just enter   CopyMysql SRC DEST
Where SRC is CDs mount point (sr0, sr1, etc.) and DEST is the drive you installed to (sda2, hdb1, etc.)
Quote
Are you talking about mydata.tgz?
Yes, that's what he is referring to, and I don't think that is what you want for this.

Offline leekimpark

  • Newbie
  • *
  • Posts: 14
Re: Remastering Question
« Reply #7 on: July 02, 2012, 03:48:51 AM »
Is there really no way to automate the execution of this script? The problem is that I'll be installing tcl on about at least a hundred identical computers, so I desperately need some form of automated installer. Everything else I've just about figured out in order to write the script, I got remastering working, and installing from command line (http://forum.tinycorelinux.net/index.php/topic,12298.msg66248.html#msg66248). I've looked through the forums, but I can't find anything explicitely saying how to do this. Do I need to modify core.gz or something?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11635
Re: Remastering Question
« Reply #8 on: July 02, 2012, 11:25:03 AM »
Hi leekimpark
And this is the value of providing all the information for what you are trying to do. Since you are looking to
replicate an environment to multiple identical machines, one way to do this is:
Set up one machine configured the way you want all the machines set up. Then use tar to save the directory
structure, something like:
Code: [Select]
tar -czf MasterImage.tar.gz /mnt/sda3/Now remaster a new disc. Add a setup directory to it containing the  MasterImage.tar.gz  file. Open the bootlocal.sh
file and add commands to partition and format the target hard drive the way you want it. Then add:
Code: [Select]
tar -xzf /mnt/sr0/setup/MasterImage.tar.gzBurn a new disc. Booting the disc should set up a virgin machine that matches the original.
Replace  sr0  and  sda3  with appropriate values.

     [EDIT]: Made corrections and added clarifications.
     [EDIT2]: More corrections, the syntax for the tar commands had errors.
« Last Edit: July 02, 2012, 09:06:48 PM by Rich »

Offline leekimpark

  • Newbie
  • *
  • Posts: 14
Re: Remastering Question
« Reply #9 on: July 02, 2012, 12:56:41 PM »
Hi Rich,
Sorry for not being clear about my original goals. Anyways:
Quote
Now remaster a new disc. Add a setup directory to it containing the  MasterImage.tar.gz  file. Open the bootlocal.sh
file and add commands to partition and format the target hard drive the way you want it. Then add:
This is the step I'm having trouble with, specifically adding the directory and changing bootlocal.sh I'm currently using ezremaster and I can't seem to find an option to do what you're saying. Are you talking about remastering manually, because the wiki instructions aren't working for me.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11635
Re: Remastering Question
« Reply #10 on: July 02, 2012, 02:03:16 PM »
Hi leekimpark
OK, I just took a look at the version of ezremaster  that is on my TC4.1 CD and I don't see how to do it either.
Copy the ISO file you originally downloaded when you burned your first disc to your master machine.
You will need to unpack, make changes, and repack the ISO manually. Search the forum or the wiki again
for how to do that. The basic steps are:
1. Create a mount point for the ISO and mount it
2. Create a working directory and copy the contents from the mount point to the working directory
3. cd to the working directory and add you new subdirectory containing your MasterImage.tar.gz file
4. Unpack the initrd file you are booting with (tinycore.gz, microcore.gz, core.gz)
5. Edit the bootlocal file and repack the initrd
6. Use the mkiso command to create a new ISO file
This is a rough overview. Follow the steps one at a time, and when you get stuck, supply information and
ask questions.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11635
Re: Remastering Question
« Reply #11 on: July 02, 2012, 09:22:20 PM »
Hi leekimpark
Another member pointed out some problems with the tar commands I originally gave in Reply #8, they have
been updated and are hopefully now correct.

Offline ixbrian

  • Retired Admins
  • Sr. Member
  • *****
  • Posts: 436
Re: Remastering Question
« Reply #12 on: July 02, 2012, 11:32:00 PM »
When using ezremaster the last page of the wizard is "Remaster Step #2" .   At this point you can manually make any changes such as changing bootlocal.sh.   Once you have manually made the changes, just click "Create ISO".

Offline leekimpark

  • Newbie
  • *
  • Posts: 14
Re: Remastering Question
« Reply #13 on: July 03, 2012, 03:31:29 AM »
When using ezremaster the last page of the wizard is "Remaster Step #2" .   At this point you can manually make any changes such as changing bootlocal.sh.   Once you have manually made the changes, just click "Create ISO".
Thanks, this did the trick! I've only edited bootlocal.sh though, and I'll make another post when I get around to doing what Rich suggested