Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NOTE: Build environment and any changes like compression method, governors and schedulers, tweaks, patches are not covered.
- Tested and compiled with Linaro 4.4.3
- 1. Assuming your building environment is prepared and you have downloaded the 3.0.8 kenel from LG's Open Source Code Distribution:
- http://www.lg.com/global/support/opensource/opensource.jsp
- Category: Mobile Phones
- Model Name: KU5900
- 2. You need Toolchains: https://github.com/AdiPat/Android_Toolchains.
- Follow README or simply download zip.
- 3. Extract the zip "KU5900(Optimus Black)_Android_ICS_KU5900v30I.zip". The one you downloaded in LG's site.
- 4. My kernels are in one folder, you can create your own either mkdir command in terminal or just create new folder.
- e.g mkdir android_kernels
- 5. In the extracted zip you have 2 tar.gz's. Copy "LGKU5900_ICS_Kernel..tar.gz" to the folder you just created.
- 6. Go to that directory via terminal e.g cd android_kernels.
- 7. Untar the kernel source using following command:
- tar zxvf LGKU5900_ICS_Kernel..tar.gz
- or simply extract it using Archive manager.
- NOTE: It will be named "kernel" folder.
- 8. We need to edit the Makefile, open the untarred folder, open Makefile and look for the flags:
- ARCH ?= $(SUBARCH)
- CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
- Change it to:
- ARCH ?= arm
- CROSS_COMPILE ?= arm-eabi-
- 9. Inside drivers/net/wireless/bcm43291, you have to remove -Werror from the Makefile because the warnings were considered as errors otherwise.
- -Wall -Wstrict-prototypes -Werror \
- to:
- -Wall -Wstrict-prototypes \
- 10. Assuming in terminal you are in android_kernels directory, cd to the kernel folder:
- cd kernel
- or rename the folder e.g ku5900_v30i, then: cd ku5900_v30i
- 11. HERE'S THE IMPORTANT PART: Go to https://github.com/CyanogenMod/lge-kernel-sniper/commit/d04b912a8dce2ca70792afa65f866dd78865e00e
- Follow the commits (changes and path) and make neccessary changes.
- NOTE: For the "arch/arm/configs/cyanogenmod_p970_defconfig" it will be "arch/arm/configs/black_kt_kr_defconfig".
- For the arch/arm/mach-omap2/lge_cmdline.c, go to arch/arm/mach-omap2 and copy a ".c" file.
- 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.
- 12. If you'd like to give a name to your kernel, go to arch/arm/configs/black_kt_kr_defconfig and find:
- CONFIG_LOCALVERSION=""
- Just slap something there, e.g CONFIG_LOCALVERSION="-xxx-dirty"
- *You can also rename black_kt_kr_defconfig to something of you like e.g xxx_defconfig.
- 13. Now you need .config file. Assuming you are in the kernel directory where the Makefile is located (kernel, android_kernels) Run this command:
- make ARCH=arm black_kt_kr_defconfig
- 14. Let's try to compile it:
- make -j4 ARCH=arm CROSS_COMPILE=/home/gabwerkz/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
- NOTE a: "-j4" : The number, 4, is the number of multiple jobs to be invoked simultaneously.
- NOTE b: "/home/gabwerkz/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-" is the location of my toolchain.
- 15. If all goes well, you'll find zImage under arch/arm/boot directory.
- 16. Decompile the "boot.img" I provided, and replace the zImage inside. Compile it again and you have your own kernel.
- gabwerkz
Advertisement
Add Comment
Please, Sign In to add comment