% $Id: download.tex,v 1.2 2001/01/09 16:57:30 wrk Exp $

\section{Download}

\subsection{Downloading the ROCK Linux distribution scripts}

First thing to do is to find one of the \rockl\ versions and download
it from \url{http://www.rocklinux.org/}. Stable versions are even
numbered on the second digit (like 1.2.0) but can be a tad
old. Development versions are uneven (like 1.3.2) and the current
development version is called 'DEV'. A tar ball is less than a
Megabyte in size and downloads quickly.

\rock's stable versions go hand-in-hand with stable \linux\ kernel 
versions. Nevertheless most \rock\ users use the development versions
of \rockl\ anyway. One addicting feature of \rock\ is that you get the
latest version of every package, including the kernel. The development
versions of \rock\ have proven to be pretty robust. Nevertheless a
development version can potentially break your system.

Untar the file and it unpacks documentation, installation scripts and
the directories for the to-be-downloaded packages.

The size of \rockl\ is so small because it is only contains the
basic system (scripts) for downloading the kernel and packages from
the Internet. The rest of the distribution gets downloaded in the next
phase.


\subsubsection{Using the scripts}

Once you have unpacked the distribution you can see directories like:

\begin{itemize}
  \item Documentation - which includes the INSTALL and FAQ documents
  \item scripts - which contains the scripts
  \item pkg-config - which contains the definitions for downloading and installing packages
  \item pkg-archive - where the downloaded tar files will be stored
\end{itemize}

The scripts are invoked from the \rock\ directory. E.g. 

\begin{verbatim}
# ./scripts/Download -base.
\end{verbatim}

The latest versions of \rock\ come with a nice help system. If you start 
a script without parameters it will tell you what to do. You can also
call help directly. E.g.

\begin{verbatim}
# ./scripts/Help Download
\end{verbatim}

\subsection{Downloading the ROCK distribution}

Downloading the full \rockl\ distribution takes a while - depending
on how fast you can move 300 Mb over your pipe. While waiting you may
want to go out, sleep, work and go through that routine again.

\begin{quote}
I drink to make other people interesting
\end{quote}

\begin{verbatim}
# ./scripts/Download -base
\end{verbatim}

Downloads the base packages with which you can build a running system.

\begin{verbatim}
# ./scripts/Download -ext
\end{verbatim}

Downloads the extension packages.

The Download script may complain you have the wrong version of bash
and you need wget.  I had to download both because the RedHat
distribution had an old version of the first and lacked the
second. Either fetch the rpm or build them after a source download
from ftp.gnu.org.

\subsubsection{Missing files?}

When files are not found Download gives an error. It could be the file has
changed version number or even moved to another site. This occurs regularly, 
but fortunately it is manageable.

Missing packages are not necessarily a problem. If you are aware what
a package does and you know you don't actually need it you can pretty
much ignore the error. For base packages it is usually a good idea
to fetch them all.

Read the FAQ on 'I have problems downloading the source-code-package'.

It may be useful to download the most recent version of \rock\ since it will
reflect the most recent state of the originals. 

Another option is to try some of the mirrors that are around for \rock. Often
you'll find missing packages with:

\begin{verbatim}
# ./scripts/Download --mirror url [options]
\end{verbatim}

For example:

\begin{verbatim}
# ./scripts/Download -mirror \
    ftp://ftp.nluug.nl/pub/os/linux/distr/rock/rock-Devel/ -base
\end{verbatim}

In practice it may be useful to start with a mirror first (as the connection
may be fastest).

To actually find which files are missing run:

\begin{verbatim}
# ./scripts/Download -list-missing    ; ROCK 1.3.11
# grep missing check.log|less         ; Earlier versions
\end{verbatim}

You can find the urls by looking at the files in
/pkg-config/\$packagename/* for base packages and
/ext-config/\$packagename for the extension packages (e.g. parted)

If the URL does not work find the new package. Visit the directory by
hand and check whether the package name has changed (usually the
version number). Otherwise visit a mirror or start searching for a tar
ball through \url{http://www.freshmeat.net/},
\url{http://www.google.com/} etc.

Once you have the package fetch it through the Download script and set
the chksum to the return value of /scripts/Download -mk-cksum
\$package.tarball.  Documentation on the package format can be found
at
\url{http://www.rocklinux.org/people/ripclaw/articles}.

Some versions of \rock\ got mirrored or contain a snapshot of one
distribution.  One place you could try is
\url{ftp://ftp.nluug.nl/pub/os/linux/rock/} (other mirrors are planned soon)
and have a look around they are there in bz2 format, so just copy them
into their required directory, making sure you are getting the right
version. You can do it by hand or use \rock's mirror download:

\begin{verbatim}
# ./scripts/Download -mirror full_url -all
\end{verbatim}

It is useful to run the output to a logging file. E.g.:

\begin{verbatim}
# ./scripts/Download -all 1>stdout.log 2>stderr.log
\end{verbatim}

If you download the file manually, copy it to the appropriate
directory and re-execute the download script in order to have the file
converted to bzip2 format.

If you do get in contact with the remote host, but the file is
missing, do as above. If the file has been replaced by a more recent
version, edit: pkg-config/\verb|<|package\verb|>|/puzzle.pz

to match the new version. Then execute: ./scripts/Puzzle

Puzzle needs mmv (to rename/move files) and if it is not on your
system you may fetch it from:

\begin{verbatim}
# wget ftp.unix-ag.org/pub/os/linux/i386/misc/mmv-1.01b.tar.gz
\end{verbatim}

But a good chance it is already sitting in your distribution:

\begin{verbatim}
# ls pkg-archive/mmv*
\end{verbatim}

Because it was a RedHat version I was building and compiling on, I
fetched and installed the mmv.rpm version (quicker than fixing
the compile time nesting error).

\begin{verbatim}
# wget http://www.tux.org/pub/distributions/SuSE/i386/6.4/suse/ap1/mmv.rpm
# rpm -i mmv.rpm
\end{verbatim}

after trying \verb|# ls archive/mmv*|

Normally I would have looked in the \rock\ mmv package conf file and
checked what \rock\ does when compiling mmv. That would give the answer.

Note: There is a patch for mmv at
\url{http://www.rocklinux.org/people/ripclaw/sparc/patches/mmv/} which
was created for the SPARC port but should work on all architectures.

After running Puzzle you can rerun the Download script.

\subsection{Modified packages}

Another useful feature of \rock\ is to check for modified version 
numbers on the ftp package sites with:

\begin{verbatim}
./scripts/Internal checkver
\end{verbatim}

Output you can find in the ./checkver* files. It lists all the available
versions on every ftp site.

\subsection{Updating packages}

Instead of downloading all the packages every time you update the main
\rockl\ distribution scripts it is easy to upgrade the distribution from 
an older download. Just move to bz2 packages to the new *-archive
directories and execute the Download script. 

To get rid of unused packages (otherwise your HDD may sink under its own
weight):

\begin{verbatim}
./scripts/Download -list-unknown | xargs rm -vf
\end{verbatim}
