Build- And Other Scripts

From RockWiki

Jump to: navigation, search

Contents

Build- And Other Scripts

Most scripts print a help text, containing a description of syntax and options, when started with the '-help' option.

./scripts/Config

./scripts/Config is the main configuration script. If no configuration name is specified via the option -cfg <config-name> the name 'default' is used. It parses the metaconfig files described in chapter 3 and creates the files in config/<config-name>/. If a config-name is specified it also has to be passed to the other scripts, too.

./scripts/Download

The ./scripts/Download script is the tool for downloading the package sources. Calling the script without any parameters prints out the help message.

You can download single files:

 ./scripts/Download download/mirror/l/linux-2.4.18.tar.bz2

All files for a single package:

 ./scripts/Download -package linux24

All files required for building the configured target:

 ./scripts/Download -required

Or simply everything:

 ./scripts/Download -all

If you don't specify a mirror using the -mirror option, the script will contact www.rocklinux.org and auto-detect the best mirror.

Downloading all files required from a local (mounted) cdrom:

 ./scripts/Download -mirror file:///mnt/cdrom/ -required

Scripts For Building Stuff

./scripts/Build-Target

Builds the configured target. Depending on your hardware and the configuration made with ./scripts/Config this may take a few days (or a week or even longer) to complete.

./scripts/Build-Pkg

Builds a single package. Calling this script without any option prints out a usage message. In most cases the options are only needed by Build-Target when building the entire distribution.

Building a single package:

 ./scripts/Build-Pkg gawk

Warning: Re-building a package might overwrite or remove config files - using the option -update backups modified files and restores them after the package build.

./scripts/Build-Tools

This script creates the 'build/xxxxxx/ROCK/tools' directory (where 'xxxxxx' is the config id) which contains various helper applications needed by Build-Pkg and other scripts.

When the script is called with the -cleanup option, a rebuild of the files in the tools directory is forced. In most cases this script will be called by other scripts (and not by the user).

./scripts/Build-CrossCC

For cross-building !ROCK Linux you need a cross-compiler. This script creates the cross-compiler for you. The cross-compiler and cross-binutils will be installed in the build/ tree where the Build-Pkg script expects them to be.

./scripts/Build-Job

This script is the client when you run ./scripts/Target in parallel build (cluster) mode.

Various Small Helpers

./scripts/Cleanup

The Cleanup script can be used to remove the src* and build* directories which are created by the build scripts. Never remove these directories manually!!!

On default ./scripts/Cleanup only removes the src* directories. the build* directories are only removed when the -full option is passed.

./scripts/Create-Links

This very simple script creates symlinks from you ROCK Linux base directory to another directory. This can be useful if you have the ROCK Linux sources on one harddisk (NFS Share, etc) and want to build somewhere else:

/disks/raid/archive/os/rock# mkdir -p /disks/fast/rock
/disks/raid/archive/os/rock# ./scripts/Create-Links /disks/fast/rock

./scripts/Create-PkgList

Creates a list of all packages available. If an architecture name is passed as parameter, only the packages available on that architecture are listed.

This script is used by ./scripts/Config in the process of creating the packages file.

./scripts/Create-PkgQueue

Creates a list of packages which could be built next. The first parameter is the maximum number of packages to print (0=no limit) and the 2nd parameter is the root directory where the script can find the /var/adm/... information it needs. E.g.:

# ./scripts/Create-PkgQueue 3 build/default-TRUNK-x86-generic/
2 X --2------9 010.050 base strace 4.4 / development/tool 159
2 X --2------9 010.052 base ltrace 0.3.10 / development/tool 85
2 X --2-4----9 010.055 base perl5 5.6.1 / development/interpreter 125

The script is primarily used by ./scripts/Build-Target.

./scripts/Create-SrcTar

Creates a .tar.bz2 file containing the ROCK Linux sources. This script is used by the ROCK Linux core developers when releasing snapshots or releases.

./scripts/Create-Diff

This script is the recommended tool for creating diff patches. (When you made a change to the ROCK Linux sources and want to share your work).

E.g.: ./scripts/Create-Diff ../rock-src.orig . > mychanges.diff

./scripts/Create-CkSumPatch

This script can be used by ROCK Linux developers to automatically create the download checksums in the .desc files in one or more package repositories.

E.g.: ./scripts/Create-CkSumPatch glibc | patch -p1

./scripts/Create-DescPatch

This script can be used by ROCK Linux developers to automatically adopt the format of the package .desc files.

E.g.: ./scripts/Create-DescPatch -repository base | patch -p1

./scripts/Create-PkgUpdPatch

This script can be used by !ROCK Linux developers to automatically create package update patches (after evaluating the output of the ./scripts/Check-PkgVersion script). E.g.:


./scripts/Create-PkgUpdPatch | patch -p1 << EOT
   automake-1.6.1, bin86-0.16.3, bison-1.35, curl-7.9.6,

diffutils-2.8.1, dump-0.4b28, ifhp-3.5.7, net-snmp-4.2.4, ntp-4.1.1, pciutils-2.1.10, sendmail.8.12.3, silo-1.2.5, tree-1.4b2, util-linux-2.11q, whois_4.5.25

EOT

./scripts/Create-ErrList

Outputs the list of packages which failed to build (including the stage numbers) in the right order.

./scripts/Create-UpdList

Create a list of packages which are active in the current configuration and have changed since the binaries installed on the local system have been generated. The compare is done using the package source checksums stored in /var/adm/packages/<package-name>.

./scripts/Update-System

Update (re-build) all packages on the local system for which newer versions are available. Create-UpdList is used to generate the list of packages which do need an update.

./scripts/Help

This script expects the filename of a script in ./scripts/ and jumps to the right position in this document. It's a very simple wrapper for 'less'.

./scripts/Internal

This script is used by Clifford Wolf to release snapshots and to keep the !FTP Mirrors up-to-date.

Scripts For Doing Checks

./scripts/Check-PkgVersion

This script is used by the !ROCK Linux developers to check for new package versions. The results of the last run are always stored in a directory called checkver/ and if there is a difference in the current run, a *.msg file will be written to checkver/. (read the script for details)

E.g.:

./scripts/Check-PkgVersion -repository base
for x in checkver/*.new ; do mv -f $x ${x%.new}.txt ; done
cat checkver/*.msg > todo.txt

Note: An old *.msg file will automatically removed when you run Check-PkgVersion the next time.

./scripts/Check-PkgFormat

This script does a few very simple tests to auto-detect errors in the package *.desc and *.conf files.

E.g.: ./scripts/Check-PkgFormat -repository base

./scripts/Check-System

This script does a very simple tests to auto-detect possible problems with the host linux system.

./scripts/Check-Deps

This command checks if the current package build order is ok for solving all package dependencies.

Scripts For Updating The Source Tree

./scripts/Update-Src

Update the source tree with rsync from www.rocklinux.org. Warning: This will remove the changes you have made to the source tree.

Personal tools