[GUIDE][HOW TO]Compile S5670 kernel with many Features :D

Search This thread
V

vaibhavpatil192

Guest
Thanks bro
I compiled an overclocked kernel for my rom

I don't have words to thank you
 
N

n00b.androidDEV

Guest
Today i try out the Tuturial...
Is this normally that in the make kernel terminal
are much warnings?
 
N

n00b.androidDEV

Guest
And also after i change this:
CONFIG_EXT4_FS=y

must i type this in also?
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
 
Last edited:

sakindia123

Inactive Recognized Developer
May 6, 2011
4,043
9,548
Noida
The compiler will take care of it,just press yes...But Remember,the smaller the zImage is,the faster the kernel will be.
U can also strip modules-
Code:
for i in $(find . | grep .ko | grep './')
do
        echo $i
/home/sarthak/Downloads/Toolchains/arm-eabi-4.4.3/bin/arm-eabi-strip --strip-unneeded $i
done
use your own toolchain
 
  • Like
Reactions: zcop

wilfredcool007

Senior Member
Aug 20, 2011
440
1,311
Chennai
Thanks for the thread Zcop...very usefull :D :D
i tried it but i get the following error wen compilin the zimage o_O

make[1]: ../arm-2011.03/bin/arm-none-eabi-gcc: Command not found
make[1]: ../arm-2011.03/bin/arm-none-eabi-gcc: Command not found
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In function ‘conf_askvalue’:
scripts/kconfig/conf.c:105: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
scripts/kconfig/conf.c: In function ‘conf_choice’:
scripts/kconfig/conf.c:307: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
HOSTCC scripts/kconfig/kxgettext.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
drivers/usb/gadget/Kconfig:849:warning: defaults for choice values not supported
drivers/usb/gadget/Kconfig:1089:warning: defaults for choice values not supported
***
*** You have not yet configured your kernel!
*** (missing kernel config file ".config")
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `make'. Stop.
make: *** [make] Error 2
make: ../arm-2011.03/bin/arm-none-eabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
drivers/usb/gadget/Kconfig:849:warning: defaults for choice values not supported
drivers/usb/gadget/Kconfig:1089:warning: defaults for choice values not supported
***
*** You have not yet configured your kernel!
*** (missing kernel config file ".config")
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.

WHAT WRONG HAV I DONE o_O
 

zcop

Senior Member
Nov 17, 2011
282
505
Hanoi
recheck your path to your toolchain, does it correct like ../arm-2011.03/bin/arm-none-eabi- or diffirent.If it diffirrent, open Makefile in kernel folder and fix it.
recheck your config file name in make_kernel_GT-S5830.sh/B] , does it exist in arch/arm/configs
 
Last edited:

Feras.Rehman

Senior Member
Oct 6, 2011
656
1,119
Chennai
First , Thanks for making this thread


But when i try to get the oc kernel this comes! :(

And the compilation stops! :(

drivers/usb/gadget/Kconfig:849:warning: defaults for choice values not supported
drivers/usb/gadget/Kconfig:1089:warning: defaults for choice values not supported
arch/arm/configs/beni_rev01_defconfig:552:warning: override: reassigning to symbol IPV6_ROUTER_PREF
#
# configuration written to .config
#
scripts/kconfig/conf -s arch/arm/Kconfig
drivers/usb/gadget/Kconfig:849:warning: defaults for choice values not supported
drivers/usb/gadget/Kconfig:1089:warning: defaults for choice values not supported
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC arch/arm/mach-msm/acpuclock.o
arch/arm/mach-msm/acpuclock.c: In function 'acpuclk_set_div':
arch/arm/mach-msm/acpuclock.c:444:9: error: 'a11_div' undeclared (first use in this function)
arch/arm/mach-msm/acpuclock.c:444:9: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-msm/acpuclock.c:436:53: warning: unused variable 'all_div'
make[1]: *** [arch/arm/mach-msm/acpuclock.o] Error 1
make: *** [arch/arm/mach-msm] Error 2



Plzzz help me ! Waiting for your reply! :)

---------- Post added at 12:24 PM ---------- Previous post was at 12:18 PM ----------

@OP- cn u add about the init.d support to kernel ?

U can do it via kitchen!
First set working folder for the rom! (keep ur preferred boot.img in the compressed rom) ! Then u can further do it by kitchen! If u dont set up working folder , u cant build the boot.img (u can nly extract it). Then u can do the further changes u want to do to the boot.img! :)
 

zcop

Senior Member
Nov 17, 2011
282
505
Hanoi
@OP- cn u add about the init.d support to kernel ?

Does this command make kernel support init.d ?
Code:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
:confused:

At first time i add OC fearture, i got many errors because i didnt type command correctly.
Our variable is a11_div not all_div
At line 436 you type all_div, and at line 444 is a11_div so compiler confuse :D
Code:
arch/arm/mach-msm/acpuclock.c: In function 'acpuclk_set_div':
arch/arm/mach-msm/acpuclock.c:[COLOR="Red"]444[/COLOR]:9: error: 'a11_div' undeclared (first use in this function)
arch/arm/mach-msm/acpuclock.c:[COLOR="red"]444[/COLOR]:9: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-msm/acpuclock.c:[COLOR="red"]436[/COLOR]:53: warning: unused variable 'all_div'

Recheck it with
Code:
/* Set proper dividers for the given clock speed. */
static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s)
{
	uint32_t reg_clkctl, reg_clksel, clk_div, src_sel, [COLOR="Red"][B]a11_div[/B][/COLOR];

	reg_clksel = readl(A11S_CLK_SEL_ADDR);

	/* AHB_CLK_DIV */
	clk_div = (reg_clksel >> 1) & 0x03;
	/* CLK_SEL_SRC1NO */
	src_sel = reg_clksel & 1;
	[COLOR="Red"][B]a11_div[/B][/COLOR]=hunt_s->a11clk_src_div;
	if(hunt_s->a11clk_khz>600000) {
	a11_div=0;
	writel(hunt_s->a11clk_khz/19200, MSM_CLK_CTL_BASE+0x33C);
	udelay(50);
}

	/*
	 * If the new clock divider is higher than the previous, then
	 * program the divider before switching the clock
	 */
	if (hunt_s->ahbclk_div > clk_div) {
		reg_clksel &= ~(0x3 << 1);
		reg_clksel |= (hunt_s->ahbclk_div << 1);
		writel(reg_clksel, A11S_CLK_SEL_ADDR);
	}

	/* Program clock source and divider */
	reg_clkctl = readl(A11S_CLK_CNTL_ADDR);
	reg_clkctl &= ~(0xFF << (8 * src_sel));
	reg_clkctl |= hunt_s->a11clk_src_sel << (4 + 8 * src_sel);
	reg_clkctl |= hunt_s->a11clk_src_div << (0 + 8 * src_sel);
	writel(reg_clkctl, A11S_CLK_CNTL_ADDR);

	/* Program clock source selection */
	reg_clksel ^= 1;
	writel(reg_clksel, A11S_CLK_SEL_ADDR);

	/*
	 * If the new clock divider is lower than the previous, then
	 * program the divider after switching the clock
	 */
	if (hunt_s->ahbclk_div < clk_div) {
		reg_clksel &= ~(0x3 << 1);
		reg_clksel |= (hunt_s->ahbclk_div << 1);
		writel(reg_clksel, A11S_CLK_SEL_ADDR);
	}
}


or download mine
http://www.mediafire.com/?ij6opq34e2q9qh7
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    You need linux enviroment to compile kernel.
    Suggest: Install Ubuntu 64bit.
    Download:http://www.ubuntu.com/download/ubuntu/download
    Select Ubuntu 11.10 and 64bit version

    Hardware required:
    CPU >= 1,5Ghz
    Ram >= 2GB
    HDD atleast 20GB space left

    After complete download Ubuntu. You have 3 choices:
    -Install Ubuntu in VMware
    -Install Ubuntu like system OS
    -Install Ubuntu like a soft in Windows
    I recommend the 3rd way.

    Extract ISO file with winzip or winra or 7z to a folder.
    Go in to that folder run wubi.exe
    s1.png

    s2.png

    s3.png


    Restart to complete install ubuntu.

    If you want to uninstall Ubuntu: go to Control Panel and uninstall Ubuntu like other soft in windows.

    Ubuntu 11.10 come with a wifi problem. Broadcom chip has no driver. Solution:
    -Turn on wifi on S5670
    -USB tether
    -Now you have internet
    -Follow pitures to solve problem
    s4.png

    s5.png

    s6.png

    s7.png

    s8.png
    15
    Download S5670 Newest Source release

    https://opensource.samsung.com/index.jsp


    Link Mediafire

    Download Toolchain to compile kernel
    https://sourcery.mentor.com/sgpp/lite/arm/portal/package8734/public/arm-none-eabi/arm-2011.03-42-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
    After download complete follow pitures :p
    s9.png

    s10.png

    s11.png

    s12.png

    s13.png

    s14.png

    s15.png

    s16.png

    s17.png

    s18.png

    s19.png


    After all workplace should like this
    s20.png


    How to open Terminal
    s21.png

    s22.png

    s23.png

    Or use combo key: CTRL+ALT+T

    Open Terminal copy command below an paste in Terminal
    Code:
    sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind

    Now you need a boot.img that you want to modify kernel. Exp: Boot.img from DXKT4 :D
    You need tool to unpack, repack boot.img
    http://www.mediafire.com/?zdw766gu35o0fb6
    Thank to ketut.kumajaya about his useful tool.
    Extract to folder android
    In Terminal
    Code:
    cd /home/[COLOR="red"]your username[/COLOR]/android/boot.img-tools
    Now copy boot.img to folder called source_img in boot.img-tools folder above
    Open Readme.txt
    Follow the guide to extract boot.img
    ============================================================================================
    After extract boot.img done
    Code:
    cd /home/[COLOR="Red"]your username[/COLOR]/android/GT-S5830_kernel/kernel
    Code:
    gedit Makefile
    A text file open
    Ctrl+F type: cross_compile
    Find:
    Code:
    CROSS_COMPILE   =../../toolchain/arm-eabi-4.4.3/bin/arm-eabi-
    Change to
    Code:
    CROSS_COMPILE   =../arm-2011.03/bin/arm-none-eabi-
    Ctrl+S
    Close
    Code:
    cd /home/[COLOR="Red"]your username[/COLOR]/android/boot.img-tools/boot/lib/modules
    Code:
    strings fsr.ko | grep vermagic
    You'll see something like this
    Code:
    vermagic=2.6.35.7-perf-[COLOR="Red"]CL783107[/COLOR] preempt mod_unload ARMv6
    Go to home/android/GT-S5830_kernel/kernel/arch/arm/configs
    Find beni_rev01_defconfig open with gedit( double click to file > Display)
    Find line
    Code:
    CONFIG_LOCALVERSION="-perf"
    change to
    Code:
    CONFIG_LOCALVERSION="-perf-[COLOR="Red"]CL783107[/COLOR]"

    The RED depends on your boot.img so it's diffirent the one from mine
    10
    GUIDE make kernel SUPPORT EXT2,3,4
    Open beni_rev01_defconfig
    find line "File systems" edit "# CONFIG_EXT3_FS is not set" to "CONFIG_EXT3_FS=y"
    Code:
    # File systems
    #
    CONFIG_EXT2_FS=y
    CONFIG_EXT2_FS_XATTR=y
    # CONFIG_EXT2_FS_POSIX_ACL is not set
    # CONFIG_EXT2_FS_SECURITY is not set
    # CONFIG_EXT2_FS_XIP is not set
    # CONFIG_EXT3_FS is not set
    [COLOR="Blue"]CONFIG_EXT4_FS=y[/COLOR]
    CONFIG_EXT4_USE_FOR_EXT23=y
    CONFIG_EXT4_FS_XATTR=y
    # CONFIG_EXT4_FS_POSIX_ACL is not set
    # CONFIG_EXT4_FS_SECURITY is not set
    # CONFIG_EXT4_DEBUG is not set
    Save and exit
    Go to folder where boot.img extracted
    Code:
    cd /home/your username/android/boot.img-tools/boot/
    Open init.rc with Gedit.
    We a going to add mount point so system can mount EXT4 partition. By default, system only mount partition with RFS file system.Add red line to init.rc
    Code:
    # Mounting of /cache
    [COLOR="Red"][B]mount ext4 /dev/block/stl14 /cache wait nosuid nodev noatime nodiratime noauto_da_alloc[/B][/COLOR]
    mount rfs /dev/stl14 /cache nosuid nodev check=no
    
    # Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
    # We chown/chmod /data again so because mount is run as root + defaults
    [COLOR="red"][B]mount ext4 /dev/block/stl13 /data wait nosuid nodev noatime nodiratime noauto_da_alloc[/B][/COLOR]
    mount rfs /dev/stl13 /data nosuid nodev check=no
    
    # Mount /system rw first to give the filesystem a chance to save a checkpoint
    [COLOR="red"][B]mount ext4 /dev/block/stl12 /system ro wait noatime nodiratime noauto_da_alloc[/B][/COLOR]
    mount rfs /dev/stl12 /system ro check=no
    10
    Add OC and Undervolt Feature to kernel
    GO to /home/Your username/android/GT-S5830_kernel/kernel/arch/arm/mach-msm/
    Open acpuclock.c with Gedit
    Find
    Code:
    static void acpuclk_set_div

    and fix it like this

    Code:
    static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s) 
    {
          uint32_t reg_clkctl, reg_clksel, clk_div, src_sel, [B][COLOR="Blue"]a11_div[/COLOR][/B];
          reg_clksel = readl(A11S_CLK_SEL_ADDR);
          /* AHB_CLK_DIV */
          clk_div = (reg_clksel >> 1) & 0x03;
         /* CLK_SEL_SRC1NO */
         src_sel = reg_clksel & 1;
    [B] [COLOR="blue"]    a11_div=hunt_s->a11clk_src_div;
         if(hunt_s->a11clk_khz>600000) {
         a11_div=0;
         writel(hunt_s->a11clk_khz/19200, MSM_CLK_CTL_BASE+0x33C);
         udelay(50);
    }[/COLOR][/B]
    /*
    * If the new clock divider is higher than the previous, then
    * program the divider before switching the clock
    */
    ........etc.......

    Now find this line
    Code:
    /* 7x27 normal with GSM capable modem - PLL0 and PLL1 swapped */

    Add
    Code:
    { 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, [COLOR="Blue"][B]7[/B][/COLOR], 160000 },
    { 1, 768000, ACPU_PLL_2, 2, 2, 160000, 2, [COLOR="Blue"][B]7[/B][/COLOR], 160000 },
    { 1, 800000, ACPU_PLL_2, 2, 0, 200000, 3, [COLOR="Blue"][B]7[/B][/COLOR], 122880 },
    after { 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 122880 }, and before { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0} }

    The Blue column is set voltage for cpu. MSM7227 has voltage range from 1.2 to 1.35V as value 1 to 7.

    Here is some Frequency if you 'd like to add more
    Code:
    { 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
    { 1, 691200, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
    { 1, 710400, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
    { 1, 729600, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
    { 1, 748800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
    { 1, 768000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
    { 1, 787200, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 }, 
    { 1, 800000, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
    { 1, 806400, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 }, 
    { 1, 825600, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
    { 1, 844800, ACPU_PLL_0, 4, 0, 211200, 3, 7, 122880 },
    { 1, 864000, ACPU_PLL_0, 4, 0, 216000, 3, 7, 122880 },

    AND another Freq provide by pratyush.creed
    Code:
    	{ 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 122880 },
     	{ 1, 614400, ACPU_PLL_2, 2, 0, 153600, 3, 6, 122880 },
     	{ 1, 672000, ACPU_PLL_2, 2, 0, 168000, 3, 6, 122880 },
     	{ 1, 729600, ACPU_PLL_2, 2, 0, 182400, 3, 7, 122880 },
    	{ 1, 800000, ACPU_PLL_2, 2, 0, 200000, 3, 7, 122880 },

    Due to some isues about not set default Freq that make phone run at max Freq as default. Here
    Open beni_rev01_defconfig find line
    Code:
    # CONFIG_MSM_CPU_FREQ_SET_MIN_MAX is not set
    change to
    Code:
    CONFIG_MSM_CPU_FREQ_SET_MIN_MAX=y
    And add this below CONFIG_MSM_CPU_FRQ_MIN_MAX
    Code:
    CONFIG_MSM_CPU_FREQ_MAX=600000
    CONFIG_MSM_CPU_FREQ_MIN=245000

    Orig Thread for help me solve this out
    http://xdaforums.com/showthread.php?t=1348951

    ----------------------------------------------------------------------------------------------------------------------------------------
    Add IO Scheduler and CPU Governor Feature to kernel
    Download source :http://www.mediafire.com/?o576hx1ei74ah27
    Extract zip file to /home/your username/android/GT-S5830_kernel/

    Add options to config file
    Go to /home/your username/android/GT-S5830_kernel/kernel/arch/arm/configs/
    Open beni_rev01_defconfig find line
    Code:
    IO Schedulers
    Add 2 line below under IO Scheduler
    Code:
    CONFIG_IOSCHED_VR=y
    CONFIG_IOSCHED_SIO=y

    Now find line
    Code:
    CPU Power Management
    Code:
    CONFIG_CPU_FREQ_GOV_BRAZILIANWAX=y
    CONFIG_CPU_FREQ_GOV_HOTPLUG=y
    CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
    CONFIG_CPU_FREQ_GOV_SCARY=y
    CONFIG_CPU_FREQ_GOV_LIONHEART=y
    CONFIG_CPU_FREQ_GOV_LAZY=y
    CONFIG_CPU_FREQ_GOV_SMOOTHASS=y
    CONFIG_CPU_FREQ_GOV_SAVAGEDZEN=y
    CONFIG_CPU_FREQ_GOV_INTERACTIVEX=y
    CONFIG_CPU_FREQ_GOV_LAGFREE=y
    CONFIG_CPU_FREQ_GOV_MINMAX=y
    CONFIG_CPU_FREQ_GOV_SMARTASS2=y
    add them under CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
    Save and exit
    Recompile your kernel again.
    Thank to wilfredcool007 by rush me and give me info :p