[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

little patch for kallsyms (kernel2.6) (package : initscripts)



#kallsyms is used in kernel 2.6 instead of ksyms
#should the logs off kallsyms be written to /var/log/ksyms.$i or to
/var/log/kallsyms.$i or maybe even both
#to keep compatibility with programs that read these files?! 



Kristof Vansant (Belgium)
? kallsyms.patch
Index: rc.d/rc.sysinit
===================================================================
RCS file: /usr/local/CVS/initscripts/rc.d/rc.sysinit,v
retrieving revision 1.374
diff -u -r1.374 rc.sysinit
--- rc.d/rc.sysinit	17 Nov 2003 19:53:49 -0000	1.374
+++ rc.d/rc.sysinit	24 Nov 2003 11:25:32 -0000
@@ -5,6 +5,10 @@
 # Taken in part from Miquel van Smoorenburg's bcheckrc.
 #
 
+#detect the kernel branch
+KERNEL_BRANCH=`/bin/uname -r | /bin/cut -c -3`
+                                                                              
+
 # Rerun ourselves through initlog
 if [ -z "$IN_INITLOG" -a -x /sbin/initlog ]; then
     exec /sbin/initlog -r /etc/rc.d/rc.sysinit
@@ -818,6 +822,20 @@
 dmesg -s 131072 > /var/log/dmesg
 # Also keep kernel symbols around in case we need them for debugging
 i=5
+
+#kallsyms is used in kernel 2.6 instead of ksyms
+#should the logs off kallsyms be written to /var/log/ksyms.$i or to /var/log/kallsyms.$i or maybe even both
+#to keep compatibility with programs that read these files?! 
+if [ "$KERNEL_BRANCH" = "2.6" ]; then
+                                                                                
+        kallsyms=kallsyms
+else
+        kallsyms=ksyms
+                                                                                
+fi
+
+
+
 while [ $i -ge 0 ]; do
 	if [ -f /var/log/ksyms.$i ]; then
 		chmod 0600 /var/log/ksyms.$i
@@ -829,7 +847,7 @@
   uname -a
   cat /proc/cpuinfo
   [ -r /proc/modules ] && cat /proc/modules
-  [ -r /proc/ksyms ] && cat /proc/ksyms
+  [ -r /proc/$kallsyms ] && cat /proc/$kallsyms
 } > /var/log/ksyms.0
 chmod 600 /var/log/ksyms.0
 # create the crash indicator flag to warn on crashes, offer fsck with timeout

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]