Guest User

Compiling KU5900 V30I Kernel

a guest
Oct 10th, 2012
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. NOTE: Build environment and any changes like compression method, governors and schedulers, tweaks, patches are not covered.
  2.  
  3. Tested and compiled with Linaro 4.4.3
  4.  
  5. 1. Assuming your building environment is prepared and you have downloaded the 3.0.8 kenel from LG's Open Source Code Distribution:
  6.  
  7. http://www.lg.com/global/support/opensource/opensource.jsp
  8. Category: Mobile Phones
  9. Model Name: KU5900
  10.  
  11. 2. You need Toolchains: https://github.com/AdiPat/Android_Toolchains.
  12. Follow README or simply download zip.
  13.  
  14. 3. Extract the zip "KU5900(Optimus Black)_Android_ICS_KU5900v30I.zip". The one you downloaded in LG's site.
  15.  
  16. 4. My kernels are in one folder, you can create your own either mkdir command in terminal or just create new folder.
  17. e.g mkdir android_kernels
  18.  
  19. 5. In the extracted zip you have 2 tar.gz's. Copy "LGKU5900_ICS_Kernel..tar.gz" to the folder you just created.
  20.  
  21. 6. Go to that directory via terminal e.g cd android_kernels.
  22.  
  23. 7. Untar the kernel source using following command:
  24. tar zxvf LGKU5900_ICS_Kernel..tar.gz
  25. or simply extract it using Archive manager.
  26.  
  27. NOTE: It will be named "kernel" folder.
  28.  
  29. 8. We need to edit the Makefile, open the untarred folder, open Makefile and look for the flags:
  30. ARCH ?= $(SUBARCH)
  31. CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
  32.  
  33. Change it to:
  34.  
  35. ARCH ?= arm
  36. CROSS_COMPILE ?= arm-eabi-
  37.  
  38. 9. Inside drivers/net/wireless/bcm43291, you have to remove -Werror from the Makefile because the warnings were considered as errors otherwise.
  39. -Wall -Wstrict-prototypes -Werror \
  40.  
  41. to:
  42.  
  43. -Wall -Wstrict-prototypes \
  44.  
  45. 10. Assuming in terminal you are in android_kernels directory, cd to the kernel folder:
  46. cd kernel
  47. or rename the folder e.g ku5900_v30i, then: cd ku5900_v30i
  48.  
  49. 11. HERE'S THE IMPORTANT PART: Go to https://github.com/CyanogenMod/lge-kernel-sniper/commit/d04b912a8dce2ca70792afa65f866dd78865e00e
  50. Follow the commits (changes and path) and make neccessary changes.
  51.  
  52. NOTE: For the "arch/arm/configs/cyanogenmod_p970_defconfig" it will be "arch/arm/configs/black_kt_kr_defconfig".
  53.  
  54. For the arch/arm/mach-omap2/lge_cmdline.c, go to arch/arm/mach-omap2 and copy a ".c" file.
  55. Rename it to "lge_cmdline.c". Open it and replace ALL codes with this: https://raw.github.com/CyanogenMod/lge-kernel-sniper/d04b912a8dce2ca70792afa65f866dd78865e00e/arch/arm/mach-omap2/lge_cmdline.c.
  56.  
  57. 12. If you'd like to give a name to your kernel, go to arch/arm/configs/black_kt_kr_defconfig and find:
  58. CONFIG_LOCALVERSION=""
  59. Just slap something there, e.g CONFIG_LOCALVERSION="-xxx-dirty"
  60. *You can also rename black_kt_kr_defconfig to something of you like e.g xxx_defconfig.
  61.  
  62. 13. Now you need .config file. Assuming you are in the kernel directory where the Makefile is located (kernel, android_kernels) Run this command:
  63. make ARCH=arm black_kt_kr_defconfig
  64.  
  65. 14. Let's try to compile it:
  66. make -j4 ARCH=arm CROSS_COMPILE=/home/gabwerkz/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
  67.  
  68. NOTE a: "-j4" : The number, 4, is the number of multiple jobs to be invoked simultaneously.
  69. NOTE b: "/home/gabwerkz/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-" is the location of my toolchain.
  70.  
  71. 15. If all goes well, you'll find zImage under arch/arm/boot directory.
  72.  
  73. 16. Decompile the "boot.img" I provided, and replace the zImage inside. Compile it again and you have your own kernel.
  74.  
  75. gabwerkz
Advertisement
Add Comment
Please, Sign In to add comment