OpenWrt Forum Archive

Topic: Kernel build

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

    Recently I tried to bring up LTE910 with Bleeding Edge r39764, and put some extra prints in option.c  (Linux3.10.32/drivers/usb/serial/, located in build_dir ) in the kernel directory which is extracted from linux3.10.32.tar.xz in the directory dl. Starting from build_dir will save time from extracting kernel and patching.
   
    I used the following command to make the sysupgrade image:
    make target/linux/{compile,install} V=99 |tee /mnt/share/Linux-compile-install.txt.
    The kernel was build into two stages. the first stage called compile deals with the modules defined in kernel and the second stage deals with the rest compiling
and linking of kernel image, compressing root file system and assebling lzma kernel image with compressed file system.

   The make output makes perfect sense, but after I loaded the image to my module, I can not see the extra print, just the original prints in option.c.

  The only way to see those extra prints was to change option.c in the compressed package linux3.10.32.tar.xz, and build the image with the following command:
    make target/linux/{clean,compile,install} V=99 |tee /mnt/share/clean-compile-install.txt
   
    Why does the first make not build the correct image?
   
    Look forward to any help!
   
    Thanks
   
   
    Tim

You need to create a patch and put that in the patches dir for the kernel, then it will be applied in the build process.

Like this:

cp $file{,.orig}
vim $file
diff -Naur $file.orig $file > $modifications.patch

Hi Borromini and written_direcon,

  Thank you all for the replies! 

  If I directly change the kernel code in build_dir, I will definitely save time from unzipping and patching the kernel code from dl.

I tried to compare the differences between the two method: the one I tried and the proper  way described in openWrt : creating and applying patches, and I found the two methods almost are the same, except that the one I tried does not go through extracting and patching.

I really want to know where the makefile in openWrt make the difference.

Thank you again!

Tim

The discussion might have continued from here.