Blame SOURCES/symset-table

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