Author: aurel32
Date: 2009-07-26 15:42:02 +0000 (Sun, 26 Jul 2009)
New Revision: 3666

Removed:
   glibc-package/trunk/debian/local/etc_init.d/
   glibc-package/trunk/debian/script.in/kernelcheck.sh
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/debhelper.in/libc.postinst
   glibc-package/trunk/debian/debhelper.in/libc.preinst
   glibc-package/trunk/debian/rules.d/debhelper.mk
Log:
  * Don't ship /etc/init.d/glibc.sh anymore: the GNU libc is now smart
    enough to print "FATAL: kernel too old" alone. This also speed up
    the boot a bit.




Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog        2009-07-26 15:14:00 UTC (rev 
3665)
+++ glibc-package/trunk/debian/changelog        2009-07-26 15:42:02 UTC (rev 
3666)
@@ -2,8 +2,11 @@
 
   * debhelper.in/libc.postinst, sysdeps/depflags.pl: remove upgrade code
     for pre-etch installations.
+  * Don't ship /etc/init.d/glibc.sh anymore: the GNU libc is now smart
+    enough to print "FATAL: kernel too old" alone. This also speed up
+    the boot a bit.
 
- -- Aurelien Jarno <[email protected]>  Sun, 26 Jul 2009 17:13:32 +0200
+ -- Aurelien Jarno <[email protected]>  Sun, 26 Jul 2009 17:37:06 +0200
 
 eglibc (2.9-22) unstable; urgency=low
 

Modified: glibc-package/trunk/debian/debhelper.in/libc.postinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc.postinst       2009-07-26 
15:14:00 UTC (rev 3665)
+++ glibc-package/trunk/debian/debhelper.in/libc.postinst       2009-07-26 
15:42:02 UTC (rev 3666)
@@ -10,57 +10,6 @@
     echo LIBC
 }
 
-# Borrowed from sysvinit's postinst.
-#      Function like update-rc.d but simpler & faster.
-#      Usage: updatercd basename start|stop NN runlevel .
-#
-#      Now we use the real update-rc.d, so now this function should
-#      be equivalent to /usr/sbin/update-rc.d.
-#
-updatercd() {
-
-       if [ ! -f /etc/init.d/$1 ]
-       then
-               return
-       fi
-
-       if [ -x /usr/sbin/update-rc.d ]
-       then
-               update-rc.d "$@" > /dev/null
-               return $?
-       fi
-
-       base=$1
-       shift
-       while [ "$1" != "" ]
-       do
-               if [ "$1" = stop ]
-               then
-                       tlet=K
-               else
-                       tlet=S
-               fi
-               lev=$2
-               shift 2
-               while [ "$1" != "." ]
-               do
-                       cd /etc/rc$1.d
-                       tmp="`echo $tlet??$base`"
-                       case "$tmp" in
-                               "$tlet??$base")
-                                       # Not present yet.
-                                       ln -s ../init.d/$base $tlet$lev$base
-                                       ;;
-                               *)
-                                       # Already present.
-                                       ;;
-                       esac
-                       shift
-               done
-               shift
-       done
-}
-
 # element() is a helper function for file-rc:
 element() {
     local element list IFS
@@ -255,14 +204,6 @@
 
     # Generate cache file /usr/lib/gconv/gconv-modules.cache
     iconvconfig || true
-
-#   # DO NOT FOLLOW THIS EXAMPLE IN OTHER PACKAGES
-    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
 
 #DEBHELPER#

Modified: glibc-package/trunk/debian/debhelper.in/libc.preinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc.preinst        2009-07-26 
15:14:00 UTC (rev 3665)
+++ glibc-package/trunk/debian/debhelper.in/libc.preinst        2009-07-26 
15:42:02 UTC (rev 3666)
@@ -5,8 +5,54 @@
 type=$1
 preversion=$2
 
+rm_conffile() {
+    CONFFILE="$1"
+
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* 
//;p}}\" /var/lib/dpkg/status`"
+        if [ "$md5sum" != "$old_md5sum" ]; then
+            echo "Obsolete conffile $CONFFILE has been modified by you."
+            echo "Saving as $CONFFILE.dpkg-bak ..."
+            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+        else
+            echo "Removing obsolete conffile $CONFFILE ..."
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
+linux_compare_versions () {
+    verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 
10000 + \2 \* 100 + \3/')))
+    verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 
10000 + \2 \* 100 + \3/')))
+
+    test $verA -$2 $verB
+}
+
+kfreebsd_compare_versions () {
+    verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
+    verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
+
+    test $verA -$2 $verB
+}
+
+kernel26_help() {
+    echo ""
+    echo "The installation of a 2.6 kernel _could_ ask you to install a new 
libc"
+    echo "first, this is NOT a bug, and should *NOT* be reported. In that 
case,"
+    echo "please add lenny sources to your /etc/apt/sources.list and run:"
+    echo "  apt-get install -t lenny linux-image-2.6"
+    echo "Then reboot into this new kernel, and proceed with your upgrade"
+}
+
 if [ "$type" = upgrade ]
 then
+    # Remove old /etc/init.d/glibc.sh init script
+    if dpkg --compare-versions "$preversion" le "2.9-22"; then
+        rm_conffile "/etc/init.d/glibc.sh"
+       update-rc.d glibc.sh remove >/dev/null
+    fi
+
     # Load debconf module if available
     if [ -f /usr/share/debconf/confmodule ] ; then
         . /usr/share/debconf/confmodule
@@ -213,11 +259,98 @@
       exit 1
     fi
   fi
-fi
 
-if [ "$type" != abort-upgrade ]
-then
-    # glibc kernel version check: KERNEL_VERSION_CHECK
+  # glibc kernel version check
+  system=`uname -s`
+  if [ "$system" = "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 | 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`
+
+      # convert "armv4l" and similar to just "arm", and "mips64" and similar
+      # to just "mips"
+      case $realarch in
+        arm*) realarch="arm";;
+        mips*) realarch="mips";;
+      esac
+
+      # The GNU libc requires a >= 2.6.18 kernel (except on m68k)
+      if [ "$realarch" != m68k ]
+      then
+          if linux_compare_versions "$kernel_ver" lt 2.6.18
+          then
+              echo WARNING: this version of the GNU libc requires kernel 
version
+              echo 2.6.18 or later.  Please upgrade your kernel before 
installing
+              echo glibc.
+              kernel26_help
+
+              exit 1
+          fi
+      fi
+
+      # The GNU libc is now built with --with-kernel= >= 2.4.1 on m68k
+      if [ "$realarch" = m68k ]
+      then
+          if linux_compare_versions "$kernel_ver" lt 2.4.1
+          then
+              echo WARNING: This version of glibc requires that you be running
+              echo kernel version 2.4.1 or later.  Earlier kernels contained
+              echo bugs that may render the system unusable if a modern version
+              echo of glibc is installed.
+              kernel26_help
+
+              exit 1
+          fi
+      fi
+
+      # From glibc 2.6-3 SPARC V8 support is dropped.
+      if [ "$realarch" = sparc ]
+      then
+          # The process could be run using linux32, check for /proc.
+          if [ -f /proc/cpuinfo ]
+          then
+             case "$(sed '/^type/!d;s/^type.*: //g' /proc/cpuinfo)" in
+                 sun4u)
+                    # UltraSPARC CPU
+                    ;;
+                 sun4v)
+                    # Niagara CPU
+                    ;;
+                 *)
+                    echo "WARNING: This machine has a SPARC V8 or earlier 
class processor."
+                    echo "Debian lenny and later does not support such old 
hardware"
+                    echo "any longer."
+                    exit 1
+                    ;;
+             esac
+          fi
+      fi
+  elif [ $system = "GNU/kFreeBSD" ] ; then
+      kernel_ver=`uname -r`
+      if kfreebsd_compare_versions "$kernel_ver" lt 6.0
+      then
+          echo WARNING: This version of glibc uses UMTX_OP_WAIT and 
UMTX_OP_WAKE
+           echo syscalls that are not present in the current running kernel. 
They
+           echo have been added in kFreeBSD 6.0.  Your system should still 
work,
+           echo but it is recommended to upgrade to a more recent version.
+      fi
+  fi
 fi
 
 #DEBHELPER#

Modified: glibc-package/trunk/debian/rules.d/debhelper.mk
===================================================================
--- glibc-package/trunk/debian/rules.d/debhelper.mk     2009-07-26 15:14:00 UTC 
(rev 3665)
+++ glibc-package/trunk/debian/rules.d/debhelper.mk     2009-07-26 15:42:02 UTC 
(rev 3666)
@@ -20,10 +20,6 @@
 define $(libc)_extra_debhelper_pkg_install
        install --mode=0644 ChangeLog 
debian/$(curpass)/usr/share/doc/$(curpass)/changelog
        install --mode=0644 nptl/ChangeLog 
debian/$(curpass)/usr/share/doc/$(curpass)/ChangeLog.nptl
-       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/" -e 
"s/DEB_HOST_ARCH/$(DEB_HOST_ARCH)/" > 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
 
@@ -156,7 +152,6 @@
          z=`echo $$y | sed -e 's#/libc#/$(libc)#'`; \
          cp $$x $$z; \
          sed -e "s#BUILD-TREE#$(build-tree)#" -i $$z; \
-         sed -e "/KERNEL_VERSION_CHECK/r debian/script.in/kernelcheck.sh" -i 
$$z; \
          sed -e "/NSS_CHECK/r debian/script.in/nsscheck.sh" -i $$z; \
          sed -e "/NOHWCAP/r debian/script.in/nohwcap.sh" -i $$z; \
          sed -e "s#LIBC#$(libc)#" -i $$z; \

Deleted: glibc-package/trunk/debian/script.in/kernelcheck.sh
===================================================================
--- glibc-package/trunk/debian/script.in/kernelcheck.sh 2009-07-26 15:14:00 UTC 
(rev 3665)
+++ glibc-package/trunk/debian/script.in/kernelcheck.sh 2009-07-26 15:42:02 UTC 
(rev 3666)
@@ -1,131 +0,0 @@
-linux_compare_versions () {
-    verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 
10000 + \2 \* 100 + \3/')))
-    verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 
10000 + \2 \* 100 + \3/')))
-
-    test $verA -$2 $verB
-}
-
-kfreebsd_compare_versions () {
-    verA=$(($(echo "$1" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
-    verB=$(($(echo "$3" | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \* 100 + \2/')))
-
-    test $verA -$2 $verB
-}
-
-kernel26_help() {
-    echo ""
-    echo "The installation of a 2.6 kernel _could_ ask you to install a new 
libc"
-    echo "first, this is NOT a bug, and should *NOT* be reported. In that 
case,"
-    echo "please add lenny sources to your /etc/apt/sources.list and run:"
-    echo "  apt-get install -t lenny linux-image-2.6"
-    echo "Then reboot into this new kernel, and proceed with your upgrade"
-}
-
-exit_check () {
-    EXIT_CHECK
-    exit 1
-}
-
-    system=`uname -s`
-    if [ "$system" = "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_check
-        fi
-
-        # sanity checking for the appropriate kernel on each architecture.
-        realarch=`uname -m`
-        kernel_ver=`uname -r`
-
-        # convert "armv4l" and similar to just "arm", and "mips64" and similar
-        # to just "mips"
-        case $realarch in
-          arm*) realarch="arm";;
-          mips*) realarch="mips";;
-        esac
-
-
-        # From glibc 2.3.5-7 real-i386 is dropped.
-        if [ "$realarch" = i386 ]
-        then
-            echo "WARNING: This machine has real i386 class processor."
-            echo "Debian etch and later does not support such old hardware"
-            echo "any longer."
-            echo "The reason is that \"bswap\" instruction is not supported"
-            echo "on i386 class processors, and some core libraries have"
-            echo "such instruction.  You\'ll see illegal instruction error"
-            echo "when you upgrade your Debian system."
-            exit_check
-        fi
-
-        # The GNU libc requires a >= 2.6.18 kernel (except on m68k)
-        if [ "$realarch" != m68k ]
-        then
-            if linux_compare_versions "$kernel_ver" lt 2.6.18
-            then
-                echo WARNING: this version of the GNU libc requires kernel 
version
-                echo 2.6.18 or later.  Please upgrade your kernel before 
installing
-                echo glibc.
-                kernel26_help
-                exit_check
-            fi
-        fi
-
-        # The GNU libc is now built with --with-kernel= >= 2.4.1 on m68k
-        if [ "$realarch" = m68k ]
-        then
-            if linux_compare_versions "$kernel_ver" lt 2.4.1
-            then
-                echo WARNING: This version of glibc requires that you be 
running
-                echo kernel version 2.4.1 or later.  Earlier kernels contained
-                echo bugs that may render the system unusable if a modern 
version
-                echo of glibc is installed.
-                kernel26_help
-                exit_check
-            fi
-        fi
-
-        # From glibc 2.6-3 SPARC V8 support is dropped.
-        if [ "$realarch" = sparc ]
-        then
-            # The process could be run using linux32, check for /proc.
-            if [ -f /proc/cpuinfo ]
-            then
-               case "$(sed '/^type/!d;s/^type.*: //g' /proc/cpuinfo)" in
-                   sun4u)
-                      # UltraSPARC CPU
-                      ;;
-                   sun4v)
-                      # Niagara CPU
-                      ;;
-                   *)
-                      echo "WARNING: This machine has a SPARC V8 or earlier 
class processor."
-                      echo "Debian lenny and later does not support such old 
hardware"
-                      echo "any longer."
-                      exit_check
-                      ;;
-               esac
-            fi
-        fi
-    elif [ $system = "GNU/kFreeBSD" ] ; then
-        kernel_ver=`uname -r`
-        if kfreebsd_compare_versions "$kernel_ver" lt 6.0
-        then
-            echo WARNING: This version of glibc uses UMTX_OP_WAIT and 
UMTX_OP_WAKE
-           echo syscalls that are not present in the current running kernel. 
They
-           echo have been added in kFreeBSD 6.0.  Your system should still 
work,
-           echo but it is recommended to upgrade to a more recent version.
-        fi
-    fi


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to