Hi all,

I am compiling
https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.tar.bz2
I have gcc 4.9.2 installed on my Debbian 8.0. I have compiled
linux-kernel-2.6.32 on this box. Somebody may point out that this is old
version and i do not waste time in compile but this is requirement and i
have to do it.
Currently  i have applied following patches to this kernel:

*diff -Narup linux-2.6.20-orig/arch/i386/boot/compressed/misc.c
linux-2.6.20/arch/i386/boot/compressed/misc.c*
*--- linux-2.6.20-orig/arch/i386/boot/compressed/misc.c 2007-02-04
11:44:54.000000000 -0700*
*+++ linux-2.6.20/arch/i386/boot/compressed/misc.c 2007-02-09
12:04:46.000000000 -0700*
*@@ -372,8 +372,8 @@ asmlinkage void decompress_kernel(void **
* #endif*

*  makecrc();*
*- putstr("Uncompressing Linux... ");*
*+ putstr("Starting... ");*
*  gunzip();*
*- putstr("Ok, booting the kernel.\n");*
*+ //putstr("Ok, booting the kernel.\n");*
*  return;*
* }*
*diff -Narup linux-2.6.20-orig/kernel/printk.c linux-2.6.20/kernel/printk.c*
*--- linux-2.6.20-orig/kernel/printk.c 2007-02-04 11:44:54.000000000 -0700*
*+++ linux-2.6.20/kernel/printk.c 2007-02-09 12:04:24.000000000 -0700*
*@@ -115,6 +115,8 @@ static int preferred_console = -1;*
* /* Flag: console code may call schedule() */*
* static int console_may_schedule;*

*+static int printk_dots = 1;*
*+*
* #ifdef CONFIG_PRINTK*

* static char __log_buf[__LOG_BUF_LEN];*
*@@ -122,6 +124,14 @@ static char *log_buf = __log_buf;*
* static int log_buf_len = __LOG_BUF_LEN;*
* static unsigned long logged_chars; /* Number of chars produced since last
read+clear operation */*

*+static int __init printk_dots_setup(char *str)*
*+{*
*+    printk_dots = simple_strtoul(str, NULL, 10);*
*+    return 1;*
*+}*
*+*
*+__setup("printk_dots=", printk_dots_setup);*
*+*
* static int __init log_buf_len_setup(char *str)*
* {*
*  unsigned long size = memparse(str, &str);*
*@@ -359,7 +369,16 @@ static void _call_console_drivers(unsign*
*  log_buf_len);*
*  __call_console_drivers(0, end & LOG_BUF_MASK);*
*  } else {*
*- __call_console_drivers(start, end);*
*+ if (msg_log_level <= 2 /* KERN_CRIT, KERN_ALERT, KERN_EMERG */*
*+    || printk_dots == 0) {*
*+ __call_console_drivers(start, end);*
*+ }*
*+ else {*
*+ char orig = LOG_BUF(start);*
*+ LOG_BUF(start) = '.';*
*+ __call_console_drivers(start, start + 1);*
*+ LOG_BUF(start) = orig;*
*+ }*
*  }*
*  }*
* }*

*Index: linux-2.6.20.4/Makefile*
*===================================================================*
*--- linux-2.6.20.4.orig/Makefile*
*+++ linux-2.6.20.4/Makefile*
*@@ -412,10 +412,12 @@ ifeq ($(config-targets),1)*
* include $(srctree)/arch/$(ARCH)/Makefile*
* export KBUILD_DEFCONFIG*

*-config %config: scripts_basic outputmakefile FORCE*
*+config: scripts_basic outputmakefile FORCE*
*+ $(Q)mkdir -p include/linux include/config*
*+ $(Q)$(MAKE) $(build)=scripts/kconfig $@*
*+%config: scripts_basic outputmakefile FORCE*
*  $(Q)mkdir -p include/linux include/config*
*  $(Q)$(MAKE) $(build)=scripts/kconfig $@*
*-*
* else*
* #
===========================================================================*
* # Build targets only - this includes vmlinux, arch specific targets,
clean*
*@@ -1439,7 +1441,7 @@ endif*
*  $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)*

* # Modules*
*-/ %/: prepare scripts FORCE*
*+/: prepare scripts FORCE*
*  $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \*
*  $(build)=$(build-dir)*
* %.ko: prepare scripts FORCE*

*Index: linux-2.6.20.4/scripts/mod/sumversion.c*
*===================================================================*
*--- linux-2.6.20.4.orig/scripts/mod/sumversion.c*
*+++ linux-2.6.20.4/scripts/mod/sumversion.c*
*@@ -8,6 +8,7 @@*
* #include <errno.h>*
* #include <string.h>*
* #include "modpost.h"*
*+#include <linux/limits.h>*

* /**
*  * Stolen form Cryptographic API.*

*--- ../linux/arch/i386/kernel/Makefile  2007-03-23 13:52:51.000000000
-0600*
*+++ arch/i386/kernel/Makefile   2015-05-26 08:54:54.206372389 -0600*
*@@ -56,7 +56,7 @@*

* # The DSO images are built using a special linker script.*
* quiet_cmd_syscall = SYSCALL $@*
*-      cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \*
*+      cmd_syscall = $(CC) -m32 -nostdlib $(SYSCFLAGS_$(@F)) \*
*                          -Wl,-T,$(filter-out FORCE,$^) -o $@*

* export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)*


After this i got some error while make bzImage as follows:

*  LD      arch/i386/lib/built-in.o*
*  CC      arch/i386/lib/bitops.o*
*  AS      arch/i386/lib/checksum.o*
*  CC      arch/i386/lib/delay.o*
*  AS      arch/i386/lib/getuser.o*
*  CC      arch/i386/lib/memcpy.o*
*  AS      arch/i386/lib/putuser.o*
*  AS      arch/i386/lib/semaphore.o*
*  CC      arch/i386/lib/strstr.o*
*  CC      arch/i386/lib/usercopy.o*
*In file included from include/linux/blkdev.h:10:0,*
*                 from arch/i386/lib/usercopy.c:10:*
*include/linux/pagemap.h: In function ‘fault_in_pages_readable’:*
*include/linux/pagemap.h:222:16: warning: variable ‘c’ set but not used
[-Wunused-but-set-variable]*
*  volatile char c;*
*                ^*
*  AR      arch/i386/lib/lib.a*
*  GEN     .version*
*  CHK     include/linux/compile.h*
*  UPD     include/linux/compile.h*
*  CC      init/version.o*
*  LD      init/built-in.o*
*  LD      vmlinux*
*kernel/built-in.o: In function `mutex_lock':*
*(.sched.text+0xea5): undefined reference to `__mutex_lock_slowpath'*
*kernel/built-in.o: In function `mutex_unlock':*
*(.sched.text+0xeb5): undefined reference to `__mutex_unlock_slowpath'*
*Makefile:744: recipe for target 'vmlinux' failed*
*make: *** [vmlinux] Error 1*

I am doing this as a requirement. Please help me resolve this issue.
Thanks in advance.
Dhiraj

Reply via email to