I am not easily overcoming my lack of understanding of TKLpatch. What I'm trying to do at this point is add Samba to the LAMP appliance. Ultimately, I'd like to also add webmin-samba.

However, when I use the example patch, Drupal5, as a model, I get nothing. More frustrating - when I use the Drupal5 patch, I'm not getting anything. I missing a step, perhaps? Do I have to download the debs manually? If so, how do I do that?

What I can do:

sftp the ISO

Extract the ISO

Chroot and tool around the ISO manually, modify usage.txt, populate var/www.

Generate an ISO and sftp it out of the virtual machine

What I can't seem to do: anything in need of a repository.

Any help is appreciated.

Liraz Siri's picture

There seems to be a persistent misconception on your end that is confusing you on what needs to be done. That may be a product of confusing documentation so I updated the patch development page to try and explain things a bit more clearly. Thanks for the feedback!

Anyhow, tklpatch allows you to apply a "patch" to an ISO to create a new ISO. You don't need to chroot the ISO manually AT ALL. If you do chroot and change the contents of the filesystem that WONT create a tklpatch. A patch is a directory structure which includes a compact set of instructions / files which you can post on the forums here and share with others. That's easier and more transparent than sharing the entire ISO. Take a look at some of the other tklpatches (e.g., OpenVPN) that have been created for reference.

Try this:

tklpatch-example helloworld
tklpatch turnkey-core.iso helloworld
This will create an example "helloworld" patch which instructs tklpatch to install the "hello" package (which prints hello world).
Art's picture

... you chroot the iso and modify it (ie add some files or install something) (ie to make a 'new appliance'), whats the process then to take the root fs and turn it back into an iso?


Also, not everything can be made into a 'patch', are there any directions for remaking an appliance and adding things to it (like making a lamp stack with a cups print server and wiki all in one)?

Jeremy Davis's picture

You're obviously not trying hard enough!! :p

But seriously, if you have a look at the TKLPatch documentation you can see that the tklpatch command h (like all good Linux software) is a top level script that calls other modular scrpts that:

  • extract the iso
  • apply the patch (basically a bash install script and/or a collection of files to overlay on the default filesystem) using a chroot
  • regenerate an iso

The patch is a nice way of doing it as it can be easily used by others, but if you'd rather do it yourself and not share, then there is not reason why you couldn't just call the indivdual scripts one at a time (and do everything you wish manually).

Art's picture

What I wanted to do was build a turnkey app for work out of the lamp stack, add our fog server (which I have heavily customized), add a cups server to it and have it ready to go once everything is installed (fog script executes, and files are copied). Idealy I'll write a script that will modify the config file for fog to change the password to whatever the mysql password is that the user enters during the install phase.


Also, I know there is a way to re-master ubuntu disks so that when they are installed they have all the current updates and whatever apps I wanted to install on there, I'm just wondering what the process is for turnkey as the ubuntu tools do not recognize turnkey distros. 


Among the reasons for talking about such re-mastering:

  • catastrophic hardware failure (a 'fresh install' would take several hours to get the fog server back up and running with all my custom code edits)
  • building multiple servers on different hardware (ie cannot make a copy of one server and cast it to the other ones due to hardware differences)
  • if making multiple servers, no need to download the same update multiple times (hence saving bandwidth)

Now maybe I'm not completely understanding the power of patching, however I feel that re-mastering the iso is what I'd like to do.

Jeremy Davis's picture

I have used 're-mastering' before, but more for desktop systems rather than servers. Although even that I have given up on because they tend to bloat a fair bit over time, and unless you do them really regularly in my experinece the idea is often much better than the reality... But each to their own...

As for your points above:

  • TKLBAM would be a better disaster recovery solution IMO (although may be impractical for all the images as well)
  • TKLPatch patches the ISO so installation to differeing hardware is no issue (other than if the hardware isn't supported by the original ISO - although you could patch it to solve that potential issue...)
  • There are better ways around that IMO - such as an apt-proxy or even just using squid (a proxy for pretty much whatever you want...)

To go back to your origanal point though (building an 'all-in-one' type appliance) personally I prefer to virtualise. I am a big fan of Proxmox (includes both KVM - for Windows and other OS; and OVZ - for Linux inc TKL). There is some degree of redundancy, but I'm fine with that, and if most of your servers are Linux then OVZ is incredibly lightweight (the PVE devs claim that there is only a 1-3% performance hit vs hardware - I can't vouch for that, but it is pretty much like running on hardware!). The beauty of it is that if something goes really pear-shaped with a VM then you only lose that function - not everything. Also it gives me the confidence to tinker more - knowing that I'm not going to bring down the entire infrastructure because I mussed something up...

As for specifics - I haven't yet had any joy getting FOG to run in OVZ although I have read that it is possible. I currently have it running as an OVZ, but I have a 2nd intance running in KVM just as a storage node (it's the NFS that causes the issues with OVZ). I did create a FOG TKLPatch some time ago, but I recently tried it (for the above setup) and it was a bit of a fail... IRC I never got it completely polished for TKL v11 (which was Ubuntu based) and it certainly didn't 'just work' with v12 (Debian based)... But it may be of some use to you as a starting point?

Add new comment