Changing/modifying Salvare

Rebuilding the CD for your own use

It's very probable you'll have your own requirements, which the default Salvare CD image won't cater for. It's therefore easy to change the CD layout, rebuild the image and then burn it to a CD - allowing you to have your own customised Salvare CD.

Due to the fact that loop-back file systems need to be created the image can only be rebuilt on a Linux system, and must be run as the 'root' user. The CD image itself, however, can be downloaded and burnt as any user on any operating system.

The following dependencies you may need to install:

The latest build tarball can then be downloaded. Please note that as this is also designed to be overlayed on a CVS working copy it expands to the current directory.

If all the dependencies are correct, then:

make cd

...will rebuild Salvare as 'salvare.iso'. Remember that this needs to be done as 'root'. If you have any problems at this stage, then please post to the salvare-devel mailing list.

Directory structure

salvare/           NB: this directory is not included in the tarball
    Makefile            Controls the rebuilding of the Salvare CD image
    README              Introduction to the build system
    TODO                Outstanding issues to be resolved
    cdroot/             Root directory of the CD
        autorun.inf         Launches 'index.html' if the CD is used in Windows
        boot/               Disk images which contain Linux
            cdfs.img            Compressed file system image holding most of Salvare
	    isolinux/           Boot loader files
	        Salvare             The kernel image
		*.msg               Help screens
		initrd.gz           The initial RAM disk
		isolinux.bin        The boot loader itself
		isolinux.cfg        Boot loader configuration
		logo.16             The graphical boot logo
        icon_tux.ico        The CD icon for Windows
        index.html          Simple usage instructions
        launch.exe          Allows starting of arbitrary files in Windows

    src/                Sources compiled and combined to make the CD
        boot/               Kernel and boot loader files for boot disk
        cdfs/               Source of compressed filesystem
            init/               Initialisation scripts
        initrd/             Source of initial RAM disk
	    linuxrc            Moves initial RAM disk to tmpfs
                inittab             \  
                rc.0                 | Scripts controlling startup and
                rc.S                 | shutdown of operating system
                salvare/            /
        pkgs/               Installable packages control files
        welcome.msg         Salvare welcome message for boot loader and /etc/issue

Package management

Salvare currently uses a very simple form of package management: each package is controlled by a shell script in src/pkgs which responds to a defined set of command-line parameters.

Each script supports, at a minimum, the following command line options:

Take locally downloaded files and install into build tree, compiling and patching as necessary.
Remove all binaries and config files for a package.
Print the licence for this package.
Print the URL the appropriate source should be downloaded from.
The version of the package which this script handles.
Return 1 if the package is installed in the build tree, else return 0.

The script tools/listpkgs will summarise what's installed and their licences. For example:

$ tools/listpkgs
Package name                  Version    Licence    Status
busybox                       unstable   GPL        Installed
chkrootkit                    0.40       GPL        Not installed
links                         2.1pre9    GPL        Installed
mdetect                       0.5.2      QPL        Installed
openssh                       3.6.1p1    GPL        Installed

$ cd src/pkgs
$ ./ install
wget fetches tarball if not already present
tarball is unpacked, configured & compiled
appropriate binaries copied into src/cdfs/...

tools/checklibs can be used to confirm that all the necessary shared libraries are in the build tree - compilation should abort if libraries are missing. Additional options will list unused libraries and copy required libraries into position, see tools/checklibs --help for more details.

Finally, additional package management scripts would be very welcome!

Make targets

The two main make targets are cd - which produces 'salvare.iso' and tar - which produces 'salvare.tar.gz'. Usually only the former will be needed, unless you need to package up the build environment.

Please note that due to the creation and use of loopback file systems, make cd requires root privileges and must be run on a Linux box. It is possible that setuid-root or sudo hacks could be used to bypass running the entire process as root, but this has not been tested.

Boot process

  1. BIOS finds El Torito boot CD (isolinux.bin) and boots it
  2. ISOLinux locates configuration file on CD
  3. Boot loader starts kernel with appropriate initrd
  4. Kernel finds initrd and loads into /dev/ram0
  5. Boot parameter "root=/dev/ram1" tells kernel that it should run a /linuxrc if possible (as /dev/ram1 != /dev/ram0)
  6. /linuxrc sets up tmpfs, moves initrd into it, calls pivot_root and sets /proc/sys/kernel/real-root-dev to 256 (/dev/ram0) - this stops the kernel trying to mount what it thinks the root file system should be.
  7. Kernel passes control to /sbin/init (which is now in tmpfs) which, in turn, calls /etc/rc.S. This does some initial setup and then passes control to /etc/salvare/init.
    1. Mount points are sorted
    2. Common functions for initialisation scripts are loaded
    3. SCSI drivers are probed (unless 'noscsi' was passed on the kernel boot line)
    4. If there is a floppy disk present, mount it, if there is a file called bootstrp.tgz present, untar it over the root filesystem.
    5. Identify the location of the Salvare CD and mount it, if present.
    6. Set the CLOOPFILE variable to the location of cdfs.img.
    7. If the 'freecd' parameter is passed to the kernel then the cloop file is copied to tmpfs and CLOOPFILE updated.
    8. If /etc/salvare/preinit is present and executable, execute it within the current shell.
    9. cloop is used to mount CLOOPFILE at /.salvare
    10. All the executable scripts in /.salvare/init are called in turn.
    11. If present, /etc/salvare/postinit is present and executable, execute it in the current shell.
  8. Finally, init uses /etc/inittab to determine what it should run on each tty.

This process allows, for example, a boot floppy containing the kernel, initrd and some additional modules to use a tarball called bootstrp.tgz on the floppy to place /etc/salvare/preinit into the running system. This can then setup networking, download cdfs.img from the network and then update CLOOPFILE. In fact, this is exactly what the boot floppy does. (Due to disk space requirements, the modules tarball should go on a separate 1722KB floppy. A file called mirrors.txt on this disk can contain a list of URLs, one per line, which can be used in addition to the default download location.)

Getting involved

If you'd like to get involved in either Salvare itself or the website, then you may want to request having CVS write access. Even without write access, keeping an up-to-date copy of the CVS repository may be useful to you.

Due to limitations in CVS, it can't store symlinks, hardlinks etc. Therefore, CVS only controls files which are directly related to building Salvare and the directory structure and so doesn't include things like binaries, shared libraries etc. After a copy of the CVS tree has been checked out, extract the most recent release's tarball over the top of it using the following command:

tar xvzkf salvare-YYYYMMDD.tar.gz

Please note that this must be done in the same directory as your CVS copy as the tarball contents do not have a directory prefix. Also note that the 'k' flag will stop tar from overwriting any files which are already present (and therefore under CVS control).


Releases will be numbered x.y.z where:

The following roadmap will be followed for the current major releases, 0.y.z:

Initial release. Base system ready. Supports autoprobing of network, SCSI, sound (PCI only), PCMCIA, APM, hard disk partitions and mouse. Includes all functionality of tomsrtbt with (almost) full version of Perl; apt-get to install additional software; running completely from tmpfs; security tools; graphical web browser and Doom.
Support for bootstrapping complete. Boot floppy provided to retrieve rest of system over network.
Support for network booting using a PXE-compliant BIOS and a running Salvare system as DHCP server.
First stable, public, support version.

Mailing lists

There are currently two mailing lists:

For developers/advanced users of Salvare to discuss issues, ideas etc.
Notification of CVS commits.