Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: leekimpark 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.
-
After looking around the forums some more, I found http://forum.tinycorelinux.net/index.php/topic,4261.msg22536.html#msg22536 (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:
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.
-
Hi leekimpark
After using the CD to install, you could try something like this:
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.
-
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.
-
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?
-
Hi leekimpark
After using the CD to install, you could try something like this:
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?
-
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
#!/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.)
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.
-
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 (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?
-
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:
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:
tar -xzf /mnt/sr0/setup/MasterImage.tar.gz
Burn 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.
-
Hi Rich,
Sorry for not being clear about my original goals. Anyways:
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.
-
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.
-
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.
-
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".
-
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