[kernel] r14205 - dists/trunk/linux-2.6/debian/templates/image.plain.bug

Bastian Blank waldi at alioth.debian.org
Wed Sep 2 15:11:40 UTC 2009


Author: waldi
Date: Wed Sep  2 15:11:38 2009
New Revision: 14205

Log:
debian/templates/image.plain.bug/include-1tainted:
Produce long text for taint check.

Modified:
   dists/trunk/linux-2.6/debian/templates/image.plain.bug/include-1tainted

Modified: dists/trunk/linux-2.6/debian/templates/image.plain.bug/include-1tainted
==============================================================================
--- dists/trunk/linux-2.6/debian/templates/image.plain.bug/include-1tainted	Wed Sep  2 10:25:19 2009	(r14204)
+++ dists/trunk/linux-2.6/debian/templates/image.plain.bug/include-1tainted	Wed Sep  2 15:11:38 2009	(r14205)
@@ -10,23 +10,30 @@
 TAINT_WARN=9
 TAINT_CRAP=10
 
+_check() {
+  if [ $(($tainted & 1<<$1)) -ne 0 ]; then
+    result_short="$result_short$2"
+    result_long="$result_long * $3\n"
+  fi
+}
+
 add_1tainted() {
   tainted=$(cat /proc/sys/kernel/tainted)
   if [ "$tainted" -gt 0 ]; then
-    local s
-    [ $(($tainted & 1<<$TAINT_PROPRIETARY_MODULE)) -ne 0 ] && s="P" || s="G"
-    [ $(($tainted & 1<<$TAINT_FORCED_MODULE)) -ne 0 ] && s="${s}F"
-    [ $(($tainted & 1<<$TAINT_UNSAFE_SMP)) -ne 0 ] && s="${s}S"
-    [ $(($tainted & 1<<$TAINT_FORCED_RMMOD)) -ne 0 ] && s="${s}R"
-    [ $(($tainted & 1<<$TAINT_MACHINE_CHECK)) -ne 0 ] && s="${s}M"
-    [ $(($tainted & 1<<$TAINT_BAD_PAGE)) -ne 0 ] && s="${s}B"
-    [ $(($tainted & 1<<$TAINT_USER)) -ne 0 ] && s="${s}U"
-    [ $(($tainted & 1<<$TAINT_DIE)) -ne 0 ] && s="${s}D"
-    [ $(($tainted & 1<<$TAINT_OVERRIDDEN_ACPI_TABLE)) -ne 0 ] && s="${s}A"
-    [ $(($tainted & 1<<$TAINT_WARN)) -ne 0 ] && s="${s}W"
-    [ $(($tainted & 1<<$TAINT_CRAP)) -ne 0 ] && s="${s}C"
-    echo '** Tainted:' $s "($tainted)" >&3
-    echo >&3
+    local result_short result_long
+    _check $TAINT_PROPRIETARY_MODULE 'P' 'Proprietary module has been loaded.'
+    _check $TAINT_FORCED_MODULE 'F' 'Module has been forcibly loaded.'
+    _check $TAINT_UNSAFE_SMP 'S' 'SMP with CPUs not designed for SMP.'
+    _check $TAINT_FORCED_RMMOD 'R' 'User forced a module unload.'
+    _check $TAINT_MACHINE_CHECK 'M' 'System experienced a machine check exception.'
+    _check $TAINT_BAD_PAGE 'B' 'System has hit bad_page.'
+    _check $TAINT_USER 'U' 'Userspace-defined naughtiness.'
+    _check $TAINT_DIE 'D' 'Kernel has oopsed before.'
+    _check $TAINT_OVERRIDDEN_ACPI_TABLE 'A' 'ACPI table overridden.'
+    _check $TAINT_WARN 'W' 'Taint on warning.'
+    _check $TAINT_CRAP 'C' 'Module from drivers/staging has been loaded.'
+    echo "** Tainted: $result_short ($tainted)" >&3
+    printf "$result_long" >&3
   else
     echo '** Not tainted' >&3
     echo >&3



More information about the Kernel-svn-changes mailing list