[GUIDE]How to build kernel from Samsung Source/Edit ramdisk[n5110/n5100]

Search This thread

Beastmode

Senior Member
Dec 28, 2010
3,821
7,347
Los Angeles
7VT7O.jpg



Team FAH-Q Presents....

Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
*Most kernels work the same way but my guide is using this source :D

Step One:
Download the samsung kernel source for your device
- www.opensource.samsung.com
- search for your device(in this case I'm using n5110)
- now download source(in this case MI1 source)
- download Beastools as you will need them later.

Step Two:
After source is downloaded you will have a giant zip file
- unzip GT-N5110_SEA_JB_Opensource_Update2.zip
- next you need to unzip the Kernel.tar.gz file(any zip manager should work)

Step Three:
Now you have your source to build your zImage(kernel) so lets get the toolchain! :D
- get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3

Step Four:
Lets edit the Makefile so it uses the toolchain.
- edit Makefile
edit "CROSS_COMPILE" to right toolchain path(You downloaded).
Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain

Step Five:
To build the kernel follow these steps.
- Open a terminal
- cd to the location of your kernel source
- exceuted the following two commands:
make kona_01_defconfig
make
- give it some time as it can take up to hours to build depending on your build machine.

Step Six:
Once zImage and modules are built get them together with the ramdisk.
- the following are the locations where to find kernel and modules:
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/arch/arm/boot/zImage

Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
- open a terminal and cd to the extracted beastools
- run this command to split ramdisk and zImage:
./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
*I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
./Unpack_kernel.sh (this is if you're lazy lol)

Step Eight:
With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
- grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
- after modules are placed and ramdisk changes are done continue to step nine.

Step Nine:
Place the ramdisk and zImage in the same beastools unzipped folder
- to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
or
- run the commands on your own:

#Ramdisk Repacking
./mkbootfs ramdisk | gzip > ramdisk-new.gz
cd ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
cd ../
#Boot.img repacking
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img

Step 10:
You will now have your new kernel named new_boot.img
- rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.

My Kernel using these steps and making boot.img insecure/enabling init.d access.
Link: Proton_test_kernel

DISCLAIMER:
As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
I am not responsible if flashing my file makes girls more attracted to you either. lol


Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons :D

In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
- page size
- base address
- ramdisk address
- cmdline

for those that didn't notice that was in there, shame on you! lol jk kinda.

Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.

** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.
 
Last edited:

DLM2583

Senior Member
Feb 14, 2012
498
29
laval qc
Pretty cool how about a guide on porting a touch wiz ROM all guide I seen before only show porting from devices that have the same chipset or same android version I'd love to learn to port
 
Last edited:

Beastmode

Senior Member
Dec 28, 2010
3,821
7,347
Los Angeles
Pretty cool how about a guide on porting a touch wiz ROM all guide I seen before only show porting from devices that have the same chipset or same android version I'd love to learn to port

My time is limited full time work and full time school :/

I have a couple of projects including this one to work on for the note 8.

After that, for sure I'll put a guide up just know theres no generic way to port touchwiz as every rom is different and theres alot of kernel dependencies for it to work.

Sent from my SCH-I605 using xda app-developers app
 

tkMOK

Member
May 3, 2011
49
3
7VT7O.jpg



Team FAH-Q Presents....

Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
*Most kernels work the same way but my guide is using this source :D

Step One:
Download the samsung kernel source for your device
- www.opensource.samsung.com
- search for your device(in this case I'm using n5110)
- now download source(in this case MI1 source)
- download Beastools as you will need them later.

Step Two:
After source is downloaded you will have a giant zip file
- unzip GT-N5110_SEA_JB_Opensource_Update2.zip
- next you need to unzip the Kernel.tar.gz file(any zip manager should work)

Step Three:
Now you have your source to build your zImage(kernel) so lets get the toolchain! :D
- get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3

Step Four:
Lets edit the Makefile so it uses the toolchain.
- edit Makefile
edit "CROSS_COMPILE" to right toolchain path(You downloaded).
Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain

Step Five:
To build the kernel follow these steps.
- Open a terminal
- cd to the location of your kernel source
- exceuted the following two commands:
make kona_01_defconfig
make
- give it some time as it can take up to hours to build depending on your build machine.

Step Six:
Once zImage and modules are built get them together with the ramdisk.
- the following are the locations where to find kernel and modules:
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/arch/arm/boot/zImage

Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
- open a terminal and cd to the extracted beastools
- run this command to split ramdisk and zImage:
./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
*I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
./Unpack_kernel.sh (this is if you're lazy lol)

Step Eight:
With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
- grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
- after modules are placed and ramdisk changes are done continue to step nine.

Step Nine:
Place the ramdisk and zImage in the same beastools unzipped folder
- to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
or
- run the commands on your own:

#Ramdisk Repacking
./mkbootfs ramdisk | gzip > ramdisk-new.gz
cd ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
cd ../
#Boot.img repacking
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img

Step 10:
You will now have your new kernel named new_boot.img
- rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.

My Kernel using these steps and making boot.img insecure/enabling init.d access.
Link: Proton_test_kernel

DISCLAIMER:
As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
I am not responsible if flashing my file makes girls more attracted to you either. lol


Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons :D

In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
- page size
- base address
- ramdisk address
- cmdline

for those that didn't notice that was in there, shame on you! lol jk kinda.

Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.

** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.
Nice 1.
I'll try this method for build different model.
:)
 

sansari123

Senior Member
Jan 30, 2013
93
6
7VT7O.jpg



Team FAH-Q Presents....

Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
*Most kernels work the same way but my guide is using this source :D

Step One:
Download the samsung kernel source for your device
- www.opensource.samsung.com
- search for your device(in this case I'm using n5110)
- now download source(in this case MI1 source)
- download Beastools as you will need them later.

Step Two:
After source is downloaded you will have a giant zip file
- unzip GT-N5110_SEA_JB_Opensource_Update2.zip
- next you need to unzip the Kernel.tar.gz file(any zip manager should work)

Step Three:
Now you have your source to build your zImage(kernel) so lets get the toolchain! :D
- get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3

Step Four:
Lets edit the Makefile so it uses the toolchain.
- edit Makefile
edit "CROSS_COMPILE" to right toolchain path(You downloaded).
Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain

Step Five:
To build the kernel follow these steps.
- Open a terminal
- cd to the location of your kernel source
- exceuted the following two commands:
make kona_01_defconfig
make
- give it some time as it can take up to hours to build depending on your build machine.

Step Six:
Once zImage and modules are built get them together with the ramdisk.
- the following are the locations where to find kernel and modules:
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/arch/arm/boot/zImage

Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
- open a terminal and cd to the extracted beastools
- run this command to split ramdisk and zImage:
./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
*I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
./Unpack_kernel.sh (this is if you're lazy lol)

Step Eight:
With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
- grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
- after modules are placed and ramdisk changes are done continue to step nine.

Step Nine:
Place the ramdisk and zImage in the same beastools unzipped folder
- to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
or
- run the commands on your own:

#Ramdisk Repacking
./mkbootfs ramdisk | gzip > ramdisk-new.gz
cd ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
cd ../
#Boot.img repacking
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img

Step 10:
You will now have your new kernel named new_boot.img
- rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.

My Kernel using these steps and making boot.img insecure/enabling init.d access.
Link: Proton_test_kernel

DISCLAIMER:
As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
I am not responsible if flashing my file makes girls more attracted to you either. lol


Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons :D

In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
- page size
- base address
- ramdisk address
- cmdline

for those that didn't notice that was in there, shame on you! lol jk kinda.

Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.

** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.

Thanks. I have looked for something like this for a while. Do you think this would work for a Galaxy Note 3? I am not asking for an exact answer; rather do know of any reason it would not? Should I use a different tool? Any gotchas? etc.
 

sansari123

Senior Member
Jan 30, 2013
93
6
Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.

Hi and thank you for the great post. I have been able to ceate the image and modules for a Note 3 device. I am not sure which boot.img you are referting to. Where do I get this? I did a search on my machine, and I don't have it. Do I need to get this file somewhere else online since I am working on a different device? I really appreciate your advice.
 

jbliz

Senior Member
Dec 25, 2013
106
13
Kendari
Code:
ahyanr@jbliz:~/Kernel$ make kona_01_defconfig
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
drivers/usb/gadget/Kconfig:1107:warning: leading whitespace ignored
drivers/motor/Kconfig:38:warning: type of 'BCM_SS_VIBRA' redefined from 'boolean' to 'tristate'
arch/arm/mach-hawaii/Kconfig:272:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:277:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:282:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:304:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:287:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:331:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:336:warning: choice value used outside its choice group
***
*** Can't find default configuration "arch/arm/configs/kona_01_defconfig"!
***
make[1]: *** [kona_01_defconfig] Error 1
make: *** [kona_01_defconfig] Error 2

PLEASE HELP :(
 

5mohsen5

Senior Member
Jan 28, 2015
88
19
Hi
is this method can change the SElinux status ? ( I want to change it to permissive )
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    7VT7O.jpg



    Team FAH-Q Presents....

    Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
    *Most kernels work the same way but my guide is using this source :D

    Step One:
    Download the samsung kernel source for your device
    - www.opensource.samsung.com
    - search for your device(in this case I'm using n5110)
    - now download source(in this case MI1 source)
    - download Beastools as you will need them later.

    Step Two:
    After source is downloaded you will have a giant zip file
    - unzip GT-N5110_SEA_JB_Opensource_Update2.zip
    - next you need to unzip the Kernel.tar.gz file(any zip manager should work)

    Step Three:
    Now you have your source to build your zImage(kernel) so lets get the toolchain! :D
    - get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3

    Step Four:
    Lets edit the Makefile so it uses the toolchain.
    - edit Makefile
    edit "CROSS_COMPILE" to right toolchain path(You downloaded).
    Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain

    Step Five:
    To build the kernel follow these steps.
    - Open a terminal
    - cd to the location of your kernel source
    - exceuted the following two commands:
    make kona_01_defconfig
    make
    - give it some time as it can take up to hours to build depending on your build machine.

    Step Six:
    Once zImage and modules are built get them together with the ramdisk.
    - the following are the locations where to find kernel and modules:
    kernel/drivers/scsi/scsi_wait_scan.ko
    kernel/drivers/net/wireless/bcmdhd/dhd.ko
    kernel/arch/arm/boot/zImage

    Step Seven:
    Lets extract the ramdisk from a stock boot.img or a recovery.img file.
    *use the beastools.zip file attached to this post to complete the following.
    - unzip my beastools.zip and place boot.img in the same extracted folder.
    - open a terminal and cd to the extracted beastools
    - run this command to split ramdisk and zImage:
    ./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
    *I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
    ./Unpack_kernel.sh (this is if you're lazy lol)

    Step Eight:
    With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
    - grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
    - after modules are placed and ramdisk changes are done continue to step nine.

    Step Nine:
    Place the ramdisk and zImage in the same beastools unzipped folder
    - to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
    or
    - run the commands on your own:

    #Ramdisk Repacking
    ./mkbootfs ramdisk | gzip > ramdisk-new.gz
    cd ramdisk
    find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
    cd ../
    #Boot.img repacking
    ./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img

    Step 10:
    You will now have your new kernel named new_boot.img
    - rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.

    My Kernel using these steps and making boot.img insecure/enabling init.d access.
    Link: Proton_test_kernel

    DISCLAIMER:
    As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
    I am not responsible if flashing my file makes girls more attracted to you either. lol


    Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons :D

    In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
    - page size
    - base address
    - ramdisk address
    - cmdline

    for those that didn't notice that was in there, shame on you! lol jk kinda.

    Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.

    ** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.
    4
    this post smells lol
    3
    30 seconds is too long of a wait to win the post lol
    3
    Pretty cool how about a guide on porting a touch wiz ROM all guide I seen before only show porting from devices that have the same chipset or same android version I'd love to learn to port

    My time is limited full time work and full time school :/

    I have a couple of projects including this one to work on for the note 8.

    After that, for sure I'll put a guide up just know theres no generic way to port touchwiz as every rom is different and theres alot of kernel dependencies for it to work.

    Sent from my SCH-I605 using xda app-developers app