Blame SOURCES/symset-table

67e50c
#! /bin/sh
67e50c
67e50c
# Create a table of all symbol sets defined in all /boot/symsets*.tar.gz
67e50c
# files.
67e50c
#
67e50c
# Format:
67e50c
#   kernelrelease/modver/symbol <tab> symset <tab> symset_hash
67e50c
#
67e50c
# This table is needed for computing the appropriate Requires: tags for
67e50c
# kernel module packages.
67e50c
67e50c
tmpdir=$(mktemp -t -d ${0##*/}.XXXXXX)
67e50c
trap "cd / ; rm -rf $tmpdir" EXIT
67e50c
cd $tmpdir
67e50c
67e50c
shopt -s nullglob
67e50c
for symsets in /boot/symsets-*.tar.gz; do
67e50c
    zcat $symsets \
67e50c
    | tar xf -
67e50c
done
67e50c
67e50c
for symsets in /usr/src/kernels/*/symsets-*.tar.gz; do
67e50c
    zcat $symsets \
67e50c
    | tar xf -
67e50c
done
67e50c
67e50c
for symsets in *; do
67e50c
    krel=${symsets#symsets-}
67e50c
    for symset in $symsets/*; do
67e50c
	class=${symset##*/} ; class=${class%.*}
67e50c
	hash=${symset##*.}
67e50c
	awk '
67e50c
	BEGIN { FS = "\t" ; OFS = "\t" }
67e50c
	{ sub(/0x0*/, "", $1)
67e50c
	  print krel "/" $1 "/" $2, class, hash }
67e50c
	' krel="$krel" class="$class" hash="$hash" $symset
67e50c
    done
67e50c
done
67e50c
67e50c
# vim:shiftwidth=4 softtabstop=4