Installation (from source or via apt-get)

There are several ways to install tklpatch:

Installing via apt-get

The easiest way to install tklpatch and its dependencies to a TKL appliance (or Debian or a Debian based distro eg Ubuntu) are via the package manager. TKLPatch is in the TurnKey Linux package repository so if you're using TurnKey Linux installation is as easy as:

apt-get update
apt-get install tklpatch

If you're using a non TurnKey Linux system you will first need to install the turnkey-keyring and configure sources.list. Note that the steps below assume you are using Debian or Ubuntu.

Install turnkey-keyring:

wget https://github.com/turnkeylinux/turnkey-keyring/raw/master/turnkey-release-keyring.gpg
apt-key add turnkey-release-keyring.gpg

Add TurnKey repositories to your sources list (e.g., /etc/apt/sources.list):

deb http://archive.turnkeylinux.org/debian squeeze main

Installing from source

You will need to have make installed (as well as git if you are using the 2nd way). Your distro may vary but in Ubuntu/Debian based distros it/they can be installed by:

apt-get update
apt-get install make git-core # git-core only required if installing from git repo

There are two ways to get the source:

  1. Compressed archive (zip or tar)
    • then unzip or untar: unzip <filename.zip> or tar xvfz <filename.tar.gz>
  2. Git (includes commit history):
git clone git://github.com/turnkeylinux/tklpatch.git

To install, cd into the tklpatch directory, then run:

make install

Dependencies: to use all of tklpatch's functionality you'll need to install these dependencies

apt-get install squashfs-tools genisoimage tar gzip

Comments

Jeremy Davis's picture

But it should work ok.

I built it from source on a 64-bit machine and it worked ok, sort of - had a few strange things happen with patches (don't recall the details, was a while ago now). So TBH seeing as TKL is only available as LTS (ie 8.04, 10.04 and to be 12.04) I now do all my patching in a TKL Core VM. Leads to less chance of strange things happening.

I'm very close to writing a blog post making a case for TKLPatch in the classroom. Some of you already know that this powerful SDK radically transformed how information systems is taught in our community.

My questions is this: how big a project would it be to modify TKLPatch to generate an .img instead of an ISO? Is that a titanic task? I've partially researched, but really haven't an idea which part of the knot to begin picking at. I have the Raspberry Pi in mind, of course; I believe TKLPatch in combination with the Raspbian has really powerful potential in the classroom.

Maybe the curriculum is broken, with it's focus in cisco, microsoft, and producing hardware and software "technicians." Very help desky. We've made it productive with TKLPatch, which manages to cover curriculum standards while also introducing systems engineering and coding - scripts are something. If they have an audience, then the learning is authentic and relevant to the real world. If the curriculum is broke, TKLPatch is a legitimate patch for it. What would be involved in (or where could we start with) expanding it's use so it outputs .img files for distribution?

What we know: it compiles on rpi running Raspbian (Wheezy) and applies patches beautifully with tklpatch-apply. Full stop.

Jeremy Davis's picture

Or you should be able to dd the iso staight to the SD card? That's how you convert the PVE ISO (also based on Debian Squeeze) to a USB stick...

In the case of PVE it's a simple case of (from the PVE Wiki):

dd if=pve-cd.iso of=/dev/XYZ bs=1M

And I can confirm 100% that it works. I haven't tried it with TKL but I have absolutely no reason to think that it wouldn't work...

If you wanted to make it a single script solution (rather than manually renaming), you could create a quick wrapper script for TKLPatch that accepts the same inputs (ie ISO and patch), hands the info to TKLPatch to work it's magic then just renames the resulting ISO...

Or easier still - hack TKLPatch so it simply writes an IMG file rather than an ISO (literally 3 letters to change...)

PS just a quick word of warning if you use dd to write the img to SD card: It doesn't care what it is copying or where... Be very careful that you get your inputs (if) and outputs (of) right... If you get your /dev/XYZ wrong it may merrily overwirte your OS without a care in the world...