| Make CD-ROM Recovery (mkCDrec)
Internals Explained |
![]() |
Copyright (c) 2000-2001 - Gratien D'haese
- IT3 Consultants
Introduction
Configuring mkCDrec
The make process
Design Goals
The Makefile itself
Running the make command
mkmakeISO9660.sh
rd-base.sh
initrd.sh
Compile Syslinux
bootflop.sh
tar-it.sh
makeISO9660.sh
Restore your system
In this article we will try to explain both parts in more detail.
The question why mkCDrec is the best suitable tool for your backups
is not on its place as mkCDrec never claimed to be a backup tool anyway!
One has to see it as a "disaster recovery" tool which is not yet standard
available in any linux distribution. Until this situation is corrected
mkCDrec can be of assistance ;-)
A word of caution: do not trust blindly that mkCDrec will do its job
without errors, therefore, please test it on a test-and-burn system which
is more or less equivalent to your production system.
In case you stumble over a bug, mail me
a bug report!
Before we go in more detail in above menu lets discuss the makefile in more detail.
| # Copyright (c) 2000-2001 Gratien D'haese
# Please read LICENSE in the source directory # VPATH=.:isofs:./bin DISKNAMES=rd-base
# local dirs
# some packages used by mkCDrec (may be replaced by higher versions)
#
all: devs dirs mformat mkmakeISO9660 $(BZ2FILES) bootflop.img
Backup_Finished
mkmakeISO9660: $(SCRIPTS)/makeISO9660.in
CDrec.iso: $(BZ2FILES) bootflop.img Backup_Finished
$(BZ2FILES): %.img.bz2: $(SCRIPTS)/%.sh
bootflop.img: $(SCRIPTS)/bootflop.sh initrd.img.gz syslinux
initrd.img.gz: $(SCRIPTS)/initrd.sh linuxrc
syslinux:
mformat:
dirs:
devs: /dev/initrd /dev/fd0u1722
/dev/initrd:
/dev/fd0u1722:
Backup_Finished:
clean:
distclean: clean
dist: distclean
utils:
test: $(SCRIPTS)/test.sh
|
All the bold items in the Makefile are headers which can be invoked separately. The most common make commands an user can use are:
make clean: cleans up all temporary files and directories. It is preferable to do this before running an new make command.
make test: this will check if your system is able to do a successfull make command. If it fails here one has to correct what the script asks you to repair.
| all: devs dirs mformat mkmakeISO9660 $(BZ2FILES) bootflop.img Backup_Finished |
The "all" will execute in order the above items. The "devs" will check
if the device /dev/initrd exists, and if not, it will make it automatically.
Thereafter, "dirs" will create the necessary temporary directories, such
as ISOFS_DIR, stage and tmp. With a "make clean" those directories are
removed again (be careful with images residing in ISOFS_DIR!). Mformat
checks id the executable mformat in installed on your system, if not, then
mkCDrec will use its mformat utility (in bin/ directory).
The "mkmakeISO9660" will create a shell script in scripts/ directory
called "makeISO9660.sh" from the input file "makeISO9660.in" file and merging
some variables from "Config.sh" file needed later on to create an ISO9660
images called by the cutstream program of tar-it.sh script depending on
being a multi-volume CD-ROM backup or not.
The BZ2FILES does only contain one file, namely rd-base! Therefore,
this line will execute the rd-base.sh script (all scripts are located in
the scripts/ directory). rd-base-sh script is responsible for making the
root ram disk which will be loaded after the inital bootloader.
The "bootflop.img" is responsible for making the initial ram disk (initrd.sh),
the syslinux boot loader, and finally the El-Torito bootfloppy (which contains
the linux kernel, syslinux boot loader and the compressed initrd images).
Finally, Backup_Finished will execute the tar-it.sh script to make
(or skip) the tar backups of your file systems. Tar-it.sh script will always
call the makeISO9660.sh script to produce the ISO9660 image on hard disk
(file called CDrec.iso) or burn it directory on a CD-R when chosen for
it in the Config.sh file).
We will try to explain all the steps in more detail following the flowchart
design:

Last changed on 12 March 2001 by Gratien D'haese