Commit 1054b26c authored by Masanori Goto's avatar Masanori Goto

* Introduce bootstrap kernel version check script.

      - debian/debhelper.in/libc.preinst: Move detection script to...
      - debian/script.in/kernelcheck.sh: ...this, new file.
      - debian/local/etc_init.d/glibc.sh: New file, it includes kernelcheck.sh.
      - debian/debhelper.in/libc.postinst: Invoke /etc/init.d/glibc.sh as S01.
      - debian/rules.d/debhelper.mk: Add replacing KERNEL_VERSION_CHECK and
        EXIT_CHECK for libc.preinst and glibc.sh.
      - debian/debhelper.in/libc.dirs: Create etc/init.d.


svn path=/glibc-package/trunk/; revision=1026
parent 80735889
......@@ -44,6 +44,15 @@ glibc (2.3.5-5) unstable; urgency=low
- debian/control.in/main: Build-Depends falls back to gcc-3.3.
- debian/control: Update.
* Introduce bootstrap kernel version check script.
- debian/debhelper.in/libc.preinst: Move detection script to...
- debian/script.in/kernelcheck.sh: ...this, new file.
- debian/local/etc_init.d/glibc.sh: New file, it includes kernelcheck.sh.
- debian/debhelper.in/libc.postinst: Invoke /etc/init.d/glibc.sh as S01.
- debian/rules.d/debhelper.mk: Add replacing KERNEL_VERSION_CHECK and
EXIT_CHECK for libc.preinst and glibc.sh.
- debian/debhelper.in/libc.dirs: Create etc/init.d.
* Don't use absolute path name.
- debian/debhelper.in/libc.dirs: Suppress the first slash.
- debian/debhelper.in/libc-pic.dirs: Likewise.
......
......@@ -414,12 +414,12 @@ then
set_timezone
fi
# # DO NOT FOLLOW THIS EXAMPLE IN OTHER PACKAGES
# updatercd mountkernfs start 35 S .
# if [ -x /usr/sbin/invoke-rc.d ]; then
# invoke-rc.d mountkernfs start
# else
# /etc/init.d/mountkernfs 2>/dev/null || true
# fi
updatercd glibc.sh start 01 S .
if [ -x /usr/sbin/invoke-rc.d ]; then
invoke-rc.d glibc.sh start
else
/etc/init.d/glibc.sh 2>/dev/null || true
fi
fi
if [ "`uname -s`" = Linux ]; then
......
......@@ -180,141 +180,7 @@ fi
if [ "$1" != abort-upgrade ] && [ "`uname -s`" = Linux ]
then
# Test to make sure z < 255, in x.y.z-n form of kernel version
# Also make sure we don't trip on x.y.zFOO-n form
#kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d '[:alpha:]')
kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/')
if [ "$kernel_rev" -ge 255 ]
then
echo WARNING: Your kernel version indicates a revision number
echo of 255 or greater. Glibc has a number of built in
echo assumptions that this revision number is less than 255.
echo If you\'ve built your own kernel, please make sure that any
echo custom version numbers are appended to the upstream
echo kernel number with a dash or some other delimiter.
exit 1
fi
# sanity checking for the appropriate kernel on each architecture.
realarch=`uname -m`
kernel_ver=`uname -r`
# intel i386 requires a recent kernel
if [ "$realarch" = i386 ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.24
then
echo WARNING: This machine has i386 class processor.
echo Debian sarge and later, you need to use at least a 2.4.24
echo or 2.6.0 kernel on i386. Please upgrade your kernel
echo before installing glibc.
echo The reason is that "bswap" instruction is not supported
echo on i386 class processors, and newer kernel can emulate
echo such lacking instructions.
exit 1
fi
fi
# SPARC sun4m requires a recent kernel
if [ "$realarch" = sparc ]
then
cputype=`egrep '^type.*:.*sun4m' /proc/cpuinfo 2> /dev/null` || true
if [ "$cputype" != "" ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.21
then
echo WARNING: You have a cpu which requires kernel 2.4.21
echo or greater in order to install this version of glibc.
echo Please upgrade the kernel before installing this package.
echo
echo You should be able to install the latest version of the
echo sparc kernel-image in order to satisfy this need. You
echo can also download and compile the latest kernel source
echo yourself from a kernel mirror \(see http://www.kernel.org/\).
exit 1
fi
else
if dpkg --compare-versions "$kernel_ver" lt 2.2.0 #should be safe
then
echo WARNING: This version of glibc suggests atleast a
echo 2.2.0 kernel in order to work properly. 2.0.x kernels
echo will not be able to support certain functions and
echo may cause problems. 2.2 kernels have proven to be much
echo more reliable than 2.0.x kernels on the sparc platform
echo anyway, so an upgrade is suggested. If you have a 2.1.x
echo kernel is is suggested you upgrade to the latest 2.2
echo release, since it is more stable and fixes many bugs.
exit 1
fi
fi
fi
# HPPA boxes require latest fixes in the kernel to function properly.
if [ "$realarch" = parisc ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.17
then
echo WARNING: This version of glibc requires that you be running
echo atleast a 2.4.17 kernel in order to work properly. Earlier
echo kernels did not provide the proper functionality in order
echo for the system to be stable.
exit 1
fi
fi
# parisc64 boxes require latest fixes in the kernel 2.4.19-pa17 or later
# (in 2.4.x), 2.5.53-pa3 or later (in 2.5.x), to function properly.
# Note that parisc64 kernel version scheme is "`uname -r`-64".
if [ "$realarch" = parisc64 ]
then
if [ $kernel_ver = ${kernel_ver/pa/} ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.19-64
then
echo WARNING: This version of glibc requires that you be
echo running at least a 2.4.19-64 to work properly.
echo Earlier kernels did not provide the proper functionality
echo in order for the system to be stable.
exit 1
fi
else
if dpkg --compare-versions "$kernel_ver" lt 2.4.19-pa17
then
echo WARNING: This version of glibc requires that you be
echo running at least a 2.4.19-pa17 in \(2.4\) or 2.5.53-pa3
echo \(in 2.5\) to work properly.
echo Earlier kernels did not provide the proper functionality
echo in order for the system to be stable.
exit 1
fi
fi
fi
if [ "$realarch" = mips ] \
&& [ "`dpkg --print-architecture`" = mips ]
then
# MIPS (but not mipsel) require a kernel update for the msq fixes.
if dpkg --compare-versions "$kernel_ver" lt 2.4.22
then
echo WARNING: System V message queues require kernel 2.4.22 to
echo work correctly on this architecture. Some programs
echo "(including perl) may not operate correctly."
exit 1
fi
fi
# amd64 requires 2.6 kernel because we drop to support linuxthreads
if [ "$realarch" = x86_64 ] \
&& [ "`dpkg --print-architecture`" = amd64 ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.6.0
then
echo WARNING: POSIX threads library NPTL requires 2.6 and
echo later kernel on amd64. If you use 2.4 kernel, please
echo upgrade your kernel before installing glibc.
exit 1
fi
fi
# glibc kernel version check: KERNEL_VERSION_CHECK
fi
#DEBHELPER#
......
#! /bin/sh -e
#
# This script is existed for detecting depreciated kernel version to
# check glibc incompatibility.
if [ "`uname -s`" = Linux ]; then
# glibc kernel version check: KERNEL_VERSION_CHECK
fi
exit 0
......@@ -26,6 +26,10 @@ define $(libc)_extra_debhelper_pkg_install
install --mode=0644 $(DEB_SRCDIR)/nptl/ChangeLog debian/$(curpass)/usr/share/doc/$(curpass)/ChangeLog.nptl; \
;; \
esac
sed -e "/KERNEL_VERSION_CHECK/r debian/script.in/kernelcheck.sh" \
debian/local/etc_init.d/glibc.sh | \
sed -e "s/EXIT_CHECK/sleep 5/" > debian/glibc.sh.generated
install --mode=0755 debian/glibc.sh.generated debian/$(curpass)/etc/init.d/glibc.sh
# dh_installmanpages thinks that .so is a language.
install --mode=0644 debian/local/manpages/ld.so.8 debian/$(curpass)/usr/share/man/man8/ld.so.8
......@@ -173,6 +177,8 @@ $(stamp)debhelper:
sed -e "s#DEB_SRCDIR#$(DEB_SRCDIR)#" -i $$z; \
sed -e "s#LIBC#$(libc)#" -i $$z; \
sed -e "s#CURRENT_VER#$(DEB_VERSION)#" -i $$z; \
sed -e "/KERNEL_VERSION_CHECK/r debian/script.in/kernelcheck.sh" -i $$z; \
sed -e "s#EXIT_CHECK##" -i $$z; \
case $$z in \
*.install) sed -e "s/^#.*//" -i $$z ;; \
esac; \
......@@ -261,5 +267,6 @@ debhelper-clean:
rm -f debian/*.dirs
rm -f debian/*.docs
rm -f debian/*.doc-base
rm -f debian/*.generated
rm -f $(stamp)binaryinst*
exit_check () {
EXIT_CHECK
exit 1
}
# Test to make sure z < 255, in x.y.z-n form of kernel version
# Also make sure we don't trip on x.y.zFOO-n form
#kernel_rev=$(uname -r | tr -- - . | cut -d. -f3 | tr -d '[:alpha:]')
kernel_rev=$(uname -r | sed 's/\([0-9]*\.[0-9]*\.\)\([0-9]*\)\(.*\)/\2/')
if [ "$kernel_rev" -ge 255 ]
then
echo WARNING: Your kernel version indicates a revision number
echo of 255 or greater. Glibc has a number of built in
echo assumptions that this revision number is less than 255.
echo If you\'ve built your own kernel, please make sure that any
echo custom version numbers are appended to the upstream
echo kernel number with a dash or some other delimiter.
exit_check
fi
# sanity checking for the appropriate kernel on each architecture.
realarch=`uname -m`
kernel_ver=`uname -r`
# intel i386 requires a recent kernel
if [ "$realarch" = i386 ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.24
then
echo WARNING: This machine has i386 class processor.
echo Debian sarge and later, you need to use at least a 2.4.24
echo or 2.6.0 kernel on i386. Please upgrade your kernel
echo before installing glibc.
echo The reason is that "bswap" instruction is not supported
echo on i386 class processors, and newer kernel can emulate
echo such lacking instructions.
exit_check
fi
fi
# SPARC sun4m requires a recent kernel
if [ "$realarch" = sparc ]
then
cputype=`egrep '^type.*:.*sun4m' /proc/cpuinfo 2> /dev/null` || true
if [ "$cputype" != "" ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.21
then
echo WARNING: You have a cpu which requires kernel 2.4.21
echo or greater in order to install this version of glibc.
echo Please upgrade the kernel before installing this package.
echo
echo You should be able to install the latest version of the
echo sparc kernel-image in order to satisfy this need. You
echo can also download and compile the latest kernel source
echo yourself from a kernel mirror \(see http://www.kernel.org/\).
exit_check
fi
else
if dpkg --compare-versions "$kernel_ver" lt 2.2.0 #should be safe
then
echo WARNING: This version of glibc suggests atleast a
echo 2.2.0 kernel in order to work properly. 2.0.x kernels
echo will not be able to support certain functions and
echo may cause problems. 2.2 kernels have proven to be much
echo more reliable than 2.0.x kernels on the sparc platform
echo anyway, so an upgrade is suggested. If you have a 2.1.x
echo kernel is is suggested you upgrade to the latest 2.2
echo release, since it is more stable and fixes many bugs.
exit_check
fi
fi
fi
# HPPA boxes require latest fixes in the kernel to function properly.
if [ "$realarch" = parisc ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.17
then
echo WARNING: This version of glibc requires that you be running
echo atleast a 2.4.17 kernel in order to work properly. Earlier
echo kernels did not provide the proper functionality in order
echo for the system to be stable.
exit_check
fi
fi
# parisc64 boxes require latest fixes in the kernel 2.4.19-pa17 or later
# (in 2.4.x), 2.5.53-pa3 or later (in 2.5.x), to function properly.
# Note that parisc64 kernel version scheme is "`uname -r`-64".
if [ "$realarch" = parisc64 ]
then
if [ $kernel_ver = ${kernel_ver/pa/} ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.4.19-64
then
echo WARNING: This version of glibc requires that you be
echo running at least a 2.4.19-64 to work properly.
echo Earlier kernels did not provide the proper functionality
echo in order for the system to be stable.
exit_check
fi
else
if dpkg --compare-versions "$kernel_ver" lt 2.4.19-pa17
then
echo WARNING: This version of glibc requires that you be
echo running at least a 2.4.19-pa17 in \(2.4\) or 2.5.53-pa3
echo \(in 2.5\) to work properly.
echo Earlier kernels did not provide the proper functionality
echo in order for the system to be stable.
exit_check
fi
fi
fi
if [ "$realarch" = mips ] \
&& [ "`dpkg --print-architecture`" = mips ]
then
# MIPS (but not mipsel) require a kernel update for the msq fixes.
if dpkg --compare-versions "$kernel_ver" lt 2.4.22
then
echo WARNING: System V message queues require kernel 2.4.22 to
echo work correctly on this architecture. Some programs
echo "(including perl) may not operate correctly."
exit_check
fi
fi
# amd64 requires 2.6 kernel because we drop to support linuxthreads
if [ "$realarch" = x86_64 ] \
&& [ "`dpkg --print-architecture`" = amd64 ]
then
if dpkg --compare-versions "$kernel_ver" lt 2.6.0
then
echo WARNING: POSIX threads library NPTL requires 2.6 and
echo later kernel on amd64. If you use 2.4 kernel, please
echo upgrade your kernel before installing glibc.
exit_check
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment