Here is a script that I wrote to compare the symbols provided by two
kernel-headers (2.4) packages. It is just rough at this stage but I
plan to put it into my build process to warn of this kind of problem in
the future. Please feel free to use/mangle/update at will.
#!/bin/bash
######################################################################
# kernel_symbol_check December 2004
# Horms <email address hidden>
#
# kernel_symbol_check
# Check the symbols in two kernel-headers Debian packages and
# repot if they do not match and a diff of the symbols.
# Probably only works with 2.4 kernels
#
# Copyright (C) 2004 Horms
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA
######################################################################
NAME="kernel_symbol_check"
set -e
clean ()
{
rm -rf "$TMP";
}
TMP="$(mktemp -d)"
trap clean EXIT
if [ $# -ne 2 ]; then
echo "usage $NAME deb1 deb2" 1>&2
echo " where deb1 and deb2 are the full path to " 1>&2
echo " (different) 2.4 kernel header packages" 1>&2
echo 1>&2
echo " e.g. $NAME \\" 1>&2
echo " kernel-headers-2.4.27-1-686_2.4.27-2_i386.deb \\" 1>&2
echo " kernel-headers-2.4.27-1-686_2.4.27-6_i386.deb" 1>&2
echo 1>&2
exit 1
fi
Message-ID: <email address hidden>
Date: Mon, 20 Dec 2004 15:09:56 +0900
From: Horms <email address hidden>
To: Andres Salomon <email address hidden>
Cc: <email address hidden>
Subject: Incompatable ABI checker
--GvXjxJ+pjyke8COw Disposition: inline
Content-Type: text/plain; charset=us-ascii
Content-
Here is a script that I wrote to compare the symbols provided by two
kernel-headers (2.4) packages. It is just rough at this stage but I
plan to put it into my build process to warn of this kind of problem in
the future. Please feel free to use/mangle/update at will.
--
Horms
--GvXjxJ+pjyke8COw Disposition: attachment; filename= kernel_ symbol_ check
Content-Type: text/plain; charset=us-ascii
Content-
#!/bin/bash ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### #######
#######
# kernel_symbol_check December 2004
# Horms <email address hidden>
#
# kernel_symbol_check
# Check the symbols in two kernel-headers Debian packages and
# repot if they do not match and a diff of the symbols.
# Probably only works with 2.4 kernels
#
# Copyright (C) 2004 Horms
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA
#######
NAME="kernel_ symbol_ check"
set -e
clean ()
{
rm -rf "$TMP";
}
TMP="$(mktemp -d)"
trap clean EXIT
if [ $# -ne 2 ]; then headers- 2.4.27- 1-686_2. 4.27-2_ i386.deb \\" 1>&2 headers- 2.4.27- 1-686_2. 4.27-6_ i386.deb" 1>&2
echo "usage $NAME deb1 deb2" 1>&2
echo " where deb1 and deb2 are the full path to " 1>&2
echo " (different) 2.4 kernel header packages" 1>&2
echo 1>&2
echo " e.g. $NAME \\" 1>&2
echo " kernel-
echo " kernel-
echo 1>&2
exit 1
fi
PKG1="$1"
PKG2="$2"
PKG1_FILE= "${PKG1# #*/}" "${PKG1_ FILE%%_ *}"
PKG1_BASE=
PKG2_FILE= "${PKG2# #*/}" "${PKG2_ FILE%%_ *}"
PKG2_BASE=
rm -rf "$TMP/1/" "$TMP/2/"
mkdir "$TMP/1/" "$TMP/2/"
dpkg -x "$PKG1" "$TMP/1/"
dpkg -x "$PKG2" "$TMP/2/"
find "$TMP/1/ usr/src/ $PKG1_BASE/ include" -name "*.ver" -type f | \ usr/src/ $PKG2_BASE/ include" -name "*.ver" -type f | \
xargs cat | sort > "$TMP/1.sym"
find "$TMP/2/
xargs cat | sort > "$TMP/2.sym"
if diff -u "$TMP/1.sym" "$TMP/2.sym"; then
echo "No Changes"
STATUS=0
else
echo '!!!Symbol Changes, as above. Incompatible ABI!!!'
STATUS=1
fi
exit $STATUS
--GvXjxJ+ pjyke8COw- -