Trinity Rescue Kit is able to update itself or better said, add features through the script 'updatetrk'. This requires decent Internet connectivity, direct, over a router or via a proxy server (in that case, run '. setproxy' first)
The script is very simple to handle:
Suppose you 've booted from a PC with a Windows XP (2K or NT is also good), you can run updatetrk without any option.
Since TRK 3.4, updatetrk uses a script called 'getswap' which looks for extra virtual memory on local swap partitions and Windows pagefile.sys
Updatetrk fetches external third party, non GPL software (fetches and updates all AV engines for virusscan) and creates a new TRK isofile or updates your TRK USB stick. It also saves any changes you made to your running copy of TRK. It allows you to install tarballs and even rpms and have it saved for the next time you run TRK. An example of such software is IBM Tivoli Storage Manager client. Adding this software to TRK allows you to do offline backup/restores from a TSM server.
Updatetrk can create a new isofile which you can burn or directly update your USB bootmedium. Given that you run TRK on a computer that normally runs Windows, it will use the pagefile.sys as extra swapspace on which to create its new image.
updatetrk -b [BUILDTARGET] -i [TARGETISOFILE] (or) -u [TARGETUSBDEVICE] -s -a avs,bde,clam,fprot,va -f
- -b [BUILDTARGET]
- Build location where intermediate files can be stored. Should be at least 1100mb. Make sure no other files reside in that location, as they will be included as well. If no build target is given, a script called 'getswap' will be invoked which will search for swap partitions and Windows pagefile.sys files. This pagefile will be added as swapspace and extend youir working memory. This has no consequences for your Windows system afterwards. It will just be reused.
- -i [TARGETISOFILE]
- Target dir on which to create the isofile. There should be at least 350Mb free on the target. The filename will be automatically given. If this option is omitted, the file will be created in the same location as the buildtarget. If the buildtarget is omitted, it will be created in the temp dir of the drive containing the pagefile. In general this will be c:\temp under Windows.
- -u [TARGETUSBDEVICE]
- Target USB filesystem to update. This performs a simple copy to the location you specified. In general this is the partition from which you booted TRK.
- Example 1: 'updatetrk -b /hda1/temp/trkbuilding/ -i /hda1/Docs/' This will use /hda1/temp/trkbuilding/ as construction site and create /hda1/Docs/trinity-rescue-kit-3.4-363u.iso
- Example 2: 'updatetrk -u /dev/sda4' will search for a local pagefile as construction site and copy back the files to your USB device (or fixed harddisc)
If you specify no options at all, TRK will always be created on a local pagefile as an ISO in c:\temp. If no pagefile is found, the script will exit. If you specified a specific buildtarget, the files will remain there afterwards at your convenience. Remark: option '-i' and '-u' are not useable together.
- -s avs,bde,clam,fprot,va
- Skip the inclusion of specific AV engines+updates. The syntax speaks for itself.
If you skip all AVs, updatetrk will only apply what is currently already modified on your running copy. -f Force updatetrk to build, even if not enough tempspace is available. It is possible to assign more of the swapspace to /dev/shm (the default volatile temporary storage location of Linux). Running 'getswap -s 80' f.i. will assign 80% of the total memory (ram+swap) available to /dev/shm. With 'df -h' /dev/shm you can verify if you arrive at 1.1Gb free space on this location.
Copy contents of / (root) completely and “as is” instead of cleaning up and omitting certain directories. This will include logs and bash_history as well.
Example 1: 'updatetrk -b /hda1/temp/trkbuilding/ -i /hda1/Docs/'
This will use /hda1/temp/trkbuilding/ as construction site and create /hda1/Docs/trinity-rescue-kit-3.4-363u.iso
Example 2: 'updatetrk -u /dev/sda4'
This will search for a local pagefile as construction site and copy back the files to your USB device (or fixed harddisc)
If you specify no options at all, TRK will always be created on a local pagefile as an ISO in c:\temp. If no pagefile is found, the script will exit.
If you specified a specific buildtarget, the files will remain there afterwards at your convenience.
-Option '-i' and '-u' are not useable together.
-If you're behind a proxy server, run '. setproxy' first
-If you're updating your running USB stick, hard RESET your computer as soon as updatetrk has finished, since the underlying filesystems will have changed without having been remounted.
-TRK has an empty rpm database (except for 1 package that does some basic “provides”), meaning that almost any RPM you install will protest about missing dependencies.
In many cases, the binaries would work anyway.
The easiest way to test this is by installing the rpm in this way:
Type the command: 'rpm -ivh --nodeps <package.rpm>'
Then test it by executing the binaries. If it fails because certain libraries are missing, run ldd /usr/bin/mybinary and check what library is missing. Go and look for that library on rpmfind.net and install it.
Many commercial rpms are compiled in such a way that they are compatible with most Linux distros. Most of them require glibc 2.2 or higher. TRK is glibc 2.3.4.
-If your CD/RW drive is currently available (booted from RAM or usb stick), you can directly record the isofile.
For a blank cd, run f.i. 'cdrecord trinity-rescue-kit.3.4-build-363u.iso'
If you still need to erase your rewritable CD, first run 'cdrecord -blank=fast'
What will 'updatetrk' do?
-First ask for license agreements to install commercial software
-Then, it downloads the latest engine + virus signatures for ClamAV
-Next, it downloads F-Prot + updates
-As third antivirus, it fetches Avast Antivirus + updates. You will need a valid license key handy (free registration on site)
-4th antivirusscanner is BitDefender and starts the installation procedure. This is BitDefender 's own install procedure, just follow instructions on the screen, type "accept" for the license agreement and leave everything to the default propositions.
-The last virusscanner it fetches is Vexira. No intervention is needed here.
-Finally, it copies the complete contents of /bin, /sbin /etc and /lib to your new TRK. This means that anything you modified or added in these directories will be included in your new TRK. This gives you an easy way to make small modifications/additions to TRK.
After that, updatetrk recreates its /usr filesystem squashfs image. Since this image is orignally mounted with a pseudo read/write aufs over it, volatile changes will be submitted in the new squashfs image.
Also the initrd is recreated and everything from /bin /sbin /etc /lib and /var/lib is copied to it. Logfiles and session-based changes are discarded, except if the option -a was added to the commandline. Then everything will be copied back “as is”, including bash history f.i.
This script can be run time after time to keep your antivirus signatures up-to-date.
When no destination parameter was given to TRK and you 're running TRK from CD, it will move the newly created isofile to the drive where it found your pagefile.sys in directory 'temp'. Most likely this will be C:\temp.
To get complete and up to date info, please check out the online version of the manpage: