Tagfiles
From Wikislax
Contents |
Software series
The packages on the Slackware installation DVD are organized in software series. For each of the software series there is a sub-directory in the /slackware64 directory :
slackware64/ |-- a |-- ap |-- d |-- e |-- f |-- k |-- kde |-- kdei |-- l |-- n |-- t |-- tcl |-- x |-- xap `-- y
Tagfile format
Each of the sub-directories contains the files for the packages and an extra file named tagfile. tagfile contains for each package in the sub-directory one line telling if the package is automatically added (ADD), recommended (REC), optional (OPT) or skipped (SKP). As an example here is an extract of tagfile for the a sub-directory :
aaa_base:ADD aaa_elflibs:ADD aaa_terminfo:REC acl:ADD acpid:REC apmd:REC attr:ADD bash:ADD . . .
Creating a tagfiles usb key
During setup, it is possible to specify an alternate location for the tagfiles. This affords changing the packages installation rules. The alternate location must include sub-directories with the same names as the software series, each sub-directory including a tagfile modified as required. Here are the commands to create this hierarchy on a usb key. Don't make any mistake on the usb key device name or you might lose all your data ! fdisk -l will help you identify the right device :
/mnt# fdisk -l /mnt# mkfs -t ext2 /dev/sdd1 /mnt# mount -t ext2 /dev/sdd1 /mnt/usb /mnt# cp -R tagfiles usb /mnt# umount usb
Using a tagfiles usb key
To use the tagfiles during system install, mount the usb key before invoking the setup command. Then when setup asks for the location, just specify where it has been mounted :
# mkdir /mnt/usb # mount -t ext2 /dev/sdd1 /mnt/usb # setup
It is also possible to wait for setup to ask for tagfiles then switch to another console and mount the required usb key from this second console.
Creating a customized tagfiles
The script below requires the slackware DVD mounted on /mnt/cdrom and creates in the current directory a tagfiles hierarchy reflecting the software installed on the system :
#! /bin/sh
SLACKWARE_DIR="/mnt/cdrom/slackware64"
PKG_DIR="/var/log/packages"
TAG_DIR=`pwd`/tagfiles
##################################################
# for all software series in slackware directory #
##################################################
cd ${SLACKWARE_DIR}
for serie in * ; do
if [ -d ${serie} ]; then
###########################################
# make target sub-directory and work file #
###########################################
mkdir -p ${TAG_DIR}/${serie}
rm ${TAG_DIR}/${serie}/tagfile
cp ${serie}/tagfile ${TAG_DIR}/${serie}/tagfile.org
##############################################
# check all packages referenced in work file #
##############################################
for package in `grep -v ^# ${TAG_DIR}/${serie}/tagfile.org|cut -d: -f1`; do
# check if package installed
if [ -f ${PKG_DIR}/${package}-[0-9]* ]; then
echo "${package}: ADD" >> ${TAG_DIR}/${serie}/tagfile
else
echo "${package}: SKP" >> ${TAG_DIR}/${serie}/tagfile
fi # package installed
done # packages in .org file
####################
# remove work file #
####################
rm ${TAG_DIR}/${serie}/tagfile.org
fi # is it a dir
done # all series process in slackware directory
Once created the tagfiles written by this script may be modified manually to adapt the installation rules. The tagfiles may be saved to a tar.gz file :
# tar -cvvf tagfiles.tar tagfiles # gzip -c tagfiles.tar > tagfiles.tar.gz # rm tagfiles.tar