[KERNEL] [09-10-13] - SM-N9005 - SELinux Permissive - Working WiFi - Galaxy Note 3 Original Android Development

KERNEL FOR SM-N9005 - SNAPDRAGON 800 MODEL
Successfully changed SELinux status to permissive. Able to restore apps with Titanium Backup with data without force closes.
This is the stock samsung kernel source, but changed the SELinux policy from enforcing to permissive.
In the settings app, it still shows as "Permissive", see the attached image.
Flash at your own risk. Please have an available flashable tar file of a working boot.img just in case, however it works fine on my phone!
Link to stock kernels: http://forum.xda-developers.com/showthread.php?t=2459328&highlight=stock+roms
Known Issues
Wifi and exfat external storage not working
WiFi not working. To fix: modify build.prop ro.securestorage.support=true - Change to false. WiFi works on reboot (Thanks to freeza)
ExFAT external storage not working. To fix: Use https://github.com/dorimanx/exfat-nofuse
Download Here: https://www.dropbox.com/s/8ze2xzk2mcbagyc/DJT_N9005_KERNEL.tar
TODO:
- Add ExFAT to kernel
- Add Busybox / init.d capability
- Add CPU overclocking
For other kernel devs, there is new feature in Snapdragon 800 mtd where you need a different version of mkbootimg tools.

More Information
Some more info:
In the build config specified by Samsung, there is the following:
Code:
CONFIG_SEC_RESTRICT_ROOTING=y
CONFIG_SEC_RESTRICT_SETUID=y
CONFIG_SEC_RESTRICT_FORK=y
CONFIG_SEC_RESTRICT_ROOTING_LOG=y
And the build notes for the kernel say this:
$ make VARIANT_DEFCONFIG=msm8974_sec_hlteeur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig
And if we look at the SELINUX Makefile:
Code:
ifeq ($(SEC_BUILD_OPTION_SELINUX_ENFORCE),true)
EXTRA_CFLAGS += -DCONFIG_ALWAYS_ENFORCE=true
endif
My guess is that because we are "supposed" to build with the SELinux flag, then the Makefile picks this up and sets ALWAYS ENFORCE to true. So I am now rebuilding kernel now to try it without that line.

it dose not work on my stock rom

After flashing over Omega ROM 1.0 i lost WIFI (could not activate it) and external storage access.
Still SELinux was indeed permissive and data restore with Titanium was working.

bubbl3 said:
After flashing over Omega ROM 1.0 i lost WIFI (could not activate it) and external storage access.
Still SELinux was indeed permissive and data restore with Titanium was working.
Click to expand...
Click to collapse
Thankyou I will look at fixing this. I also realised lost wifi.
Sent from my SM-N9005 using xda app-developers app

danieljamie said:
Thankyou I will look at fixing this. I also realised lost wifi.
Sent from my SM-N9005 using xda app-developers app
Click to expand...
Click to collapse
Woa, how can you able to flash kernel with locked bootloader ?, how do i create tar and boot.img from the zImage ?
Thanks

rheza02 said:
Woa, how can you able to flash kernel with locked bootloader ?, how do i create tar and boot.img from the zImage ?
Thanks
Click to expand...
Click to collapse
boot.img consists of the kernel and ramdisk. You need ramdisk compiled from source, or ripped from a current working boot.img.
Then use tool mkboot to package zImage and ramdisk into boot.img (not just any mkboot, there is a special one updated for usage with snapdragon 800).
Then just use tar command in linux: tar -cvf mykernel.tar boot.img
Then flash in odin

Does this work with SM-N900W8 version?

Sorry for Out of topic,
do you compile the boot.img with the dt.img ?
Thanks

rheza02 said:
Sorry for Out of topic,
do you compile the boot.img with the dt.img ?
Thanks
Click to expand...
Click to collapse
Yes...
Use this:
https://github.com/xiaolu/mkbootimg_tools

Can you please do it for SM-900 version also ?
Sent from my SM-N900 using XDA Premium 4 mobile app

How do we make the modules for wifi and external storage ?, I able to compile my own kernel now. but can't access external storage and wifi.

rheza02 said:
How do we make the modules for wifi and external storage ?, I able to compile my own kernel now. but can't access external storage and wifi.
Click to expand...
Click to collapse
I'm wondering the same thing brother. I want to open a thread regarding kernel compiling but don't know where to do it or where to get help. Feel so stuck.
Then my dev environment died on me and make started throwing me errors randomly after I did apt-get upgrade.
Sent from my SM-N9005 using xda app-developers app

danieljamie said:
I'm wondering the same thing brother. I want to open a thread regarding kernel compiling but don't know where to do it or where to get help. Feel so stuck.
Then my dev environment died on me and make started throwing me errors randomly after I did apt-get upgrade.
Sent from my SM-N9005 using xda app-developers app
Click to expand...
Click to collapse
Do you have google+ ?, can we chat while doing this. hehe!

rheza02 said:
Do you have google+ ?, can we chat while doing this. hehe!
Click to expand...
Click to collapse
Yeah I will send you a PM

Hi, I'm in the same boat as you guys. I have compiled a kernel successfully and while WiFi works, sdcard/exfat doesn't.
We need to figure out how to get to the bottom of this! Oddly enough, kernel modules are no longer in /system/lib/modules. I guess they're baked into the kernel?
feel free to add me on google+. my xda username @ gmail

freeza said:
Hi, I'm in the same boat as you guys. I have compiled a kernel successfully and while WiFi works, sdcard/exfat doesn't.
We need to figure out how to get to the bottom of this! Oddly enough, kernel modules are no longer in /system/lib/modules. I guess they're baked into the kernel?
feel free to add me on google+. my xda username @ gmail
Click to expand...
Click to collapse
How did you get wifi working???
Sent from my SM-N9005 using xda app-developers app

And what about Exynos kernel?

Code:
parentDir
|-- mkbootimg
|--/XXDEV-ramdisk/
+--/Kernel-folder/
Code:
makeKernel
Code:
#!/bin/sh
export KDIR=`readlink -f ../Kernel-folder/`
if [ -z ${1} ]; then
echo "Enter the device code"
exit 1;
else
export DEV=$1
fi
case $DEV in
XXDEV) export DEFCONFIG="XXDEV_defconfig";
export RDIR="XXDEV-ramdisk";;
*) echo "Not a valid device"
exit 2;;
esac;
cd $KDIR;
echo "Making $DEFCONFIG";
if [ -z $3 ]; then
make $DEFCONFIG ARCH=arm || exit 3;
nice -n 10 make modules -j4 ARCH=arm || exit 4;
nice -n 10 make -j4 ARCH=arm || exit 5;
else
echo "Bypassing kernel make."
fi
find -name '*.ko' -exec cp -av {} ../$RDIR/lib/modules/ \;
chmod 644 ../$RDIR/lib/modules/* ;
cd ..;
cd ./$RDIR
pwd;
find . | cpio -o -H newc | gzip -9 > ../$RDIR.cpio.gz
cd ..
./mkbootimg --kernel $KDIR/arch/arm/boot/zImage --ramdisk $RDIR.cpio.gz -o boot.img && echo "Made boot image."
tar cf ./Finished/Kernel-$2-$DEV.tar boot.img
echo "Made Kernel-$2-$DEV.tar"
exit 0;
Code:
parentDir/makeKernel XXDEV whateverVersionNumber
Now stop pestering me, I'm not a helpdesk. All of the above is easily found if you search for it.

I've managed to fix both sdcard(EXFAT) and WiFi

Related

[GUIDE] Newbie-Proof Tutorial Howto Compile Kernel For Galaxy Ace incl. Screenshot

Hi guys. U might not know me but in the past i've compiled my own custom kernel for galaxy ace. So in this tutorial i'll provide tutorial step by step howto compile kernel for anyone who wish to try. i'll try to make this as simple as possible for anyone to understand. But do excuse my poor english tho, its not my spoken language nor my native language
1- Most important of all is that u need to have linux installed in your pc. In this tutorial i use Fedora 17 gnome 64bit freshly installed, so i'll be providing indepth tutorial using fedora. But it really doesnt matter which distro i use; ubuntu, fedora, opensuse, debian, arch etc, in theory u can compile kernel in all linux distro u can think of, as long its linux. Sorry windows guys, no kernel compiling for u
Please note that i said installed. U need to have a linux distro installed, by dualbooting or by virtualisation using vmware or virtualbox, as long as its intalled. Livecd or liveusb enviroment wont work, mandatory need installed enviroment. But dont ask me howto install linux, google is always your friend, ask him/her
Click to expand...
Click to collapse
2- We need to setup our linux with suitable enviroment to build the kernel, by installing dev package etc. First we need to make sure that our system is uptodate. Old package combined with newer one can result in error when compiling. Open linux terminal and type
Code:
sudo yum upgrade
next is to install needed dev package for kernel compiling
Code:
sudo yum install gcc libstdc++ ncurses-devel java-1.7.0-openjdk java-1.7.0-openjdk-devel
Because i'm using 64bit fedora, i also need to install 32bit libs. Ignore this if you're using fedora 32bit.
Code:
sudo yum install glibc-devel.i686 gtk2-devel.i686 gtk-nodoka-engine.i686 libcanberra.i686 libcanberra-gtk2.i686 PackageKit-gtk-module.i686 GConf2.i686 ncurses-libs.i686 xulrunner.i686
Click to expand...
Click to collapse
3- Next is to download and install arm crosscompile toolchain. In this tutorial i use latest toolchain from Codesourcery
Choose to download the EABI release, for ARM processor
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Download the linux installer as its easier to setup.
Click to expand...
Click to collapse
4- Now we can install the toolchain, but first we need to make it executable. Open terminal and do
Code:
chmod +x /path/to/file/arm-2011.09-69-arm-none-eabi.bin
or just right click on the file and tick to allow executing in permission tab
then just install it. Still in terminal, do
Code:
sh /path/to/file/arm-2011.09-69-arm-none-eabi.bin
and gui installer will appear. Just accept the default choice and continue with the installation until finish.
Click to expand...
Click to collapse
5- For extracting archive, i use this nice bash profile script as universal extract command. Edit bashrc profile file
Code:
gedit ~/.bashrc
and add this on the bottom of the file
Code:
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
and save the file. U need to logout and relogin for this script to take effect.
Now create working dir for later use
Code:
mkdir ~/android && mkdir ~/android/kernel_compiling && mkdir ~/android/ramdisk_extract
Click to expand...
Click to collapse
6- Next, download ace's kernel source. U can grab stock kernel source from here. In this tutorial i download the GT-S5570-S5670-S5830_Opensource_GB.zip.
and extract it
Code:
extract ~/GT-S5570-S5670-S5830_Opensource_GB.zip
u'll get two file, GT-S5830_kernel.tar.gz and GT-S5830_platform.tar.gz. The GT-S5830_kernel.tar.gz is what we need, now extract and copy it into earlier working folder we created (the ~/android/kernel_compiling)
Code:
extract ~/GT-S5830_kernel.tar.gz && cp -R ~/kernel/* ~/android/kernel_compiling
Now that folder should have a bunch of folder and files in it. Thats our kernel source tree.
Click to expand...
Click to collapse
7- Grab boot.img from any stock rom and also wifi module (ar6000.ko) that came with the rom for that kernel. We will need that ar6000.ko later.
Now copy the boot.img into our earlier working folder (~/android/ramdisk_extract)
Code:
cp ~/boot.img ~/android/ramdisk_extract
Click to expand...
Click to collapse
8- Download this tool to extract ramdisk from the boot.img, and extract it into the same folder that we put our boot.img earlier
Code:
cd ~/android/ramdisk_extract && extract ~/Bootimgutils.zip
Now make those three file that we extracted executable
Code:
chmod +x ~/android/ramdisk_extract/mkbootimg && chmod +x ~/android/ramdisk_extract/repack_bootimg.pl && chmod +x ~/android/ramdisk_extract/repack_bootimg.pl
or just use the right click like step 4 above.
Click to expand...
Click to collapse
9- Time to extract ramdisk from the boot.img. Still in terminal do
Code:
cd ~/android/ramdisk_extract && BASE="0x$(od -A n -h -j 34 -N 2 boot.img|sed 's/ //g')0000" && echo $BASE
Note the output, eg
Code:
0x13600000
So thats our kernel base parameter
Now to extract ramdisk
Code:
cd ~/android/ramdisk_extract && ./split_bootimg.pl boot.img && mkdir ramdisk && cd ramdisk && gzip -dc ../boot.img-ramdisk.gz | cpio -i
Note the output, eg
Code:
Page size: 4096 (0x00001000)
Kernel size: 3137536 (0x002fe000)
Ramdisk size: 3153892 (0x00301fe4)
Second size: 0 (0x00000000)
What we need is the pagesize. Now we know that its 4096.
Now after we look into the ramdisk_extract folder theres a bunch of files produced, and in the folder itself contain another folder, ramdisk. In the ramdisk folder contains our actual extracted ramdisk including bootlogo, modules, scipts etc. In case u were wondering, this is where the famous cfroot autoroot script works its magic.
Click to expand...
Click to collapse
Still excited after all this terminal thingy? Good.. keep up the spirit
Now we continue.
10- From previous step we know that ace's kernel base parameter is 0x13600000 and pagesize is 4096. We now look into kernel repack script to make sure its right
Code:
gedit ~/android/ramdisk_extract/repack_bootimg.pl
and look for predefined base parameter and pagesize. It should look like this in line 19
Code:
system ("./mkbootimg --kernel $ARGV[0] --ramdisk ramdisk-repack.cpio.gz --base 0x13600000 --pagesize 4096 -o $ARGV[2]");
Good. The predefined kernel base parameter and pagesize is same with out earlier test result, so no need to alter the file.
Click to expand...
Click to collapse
11- We now need to find localversion of samsung's proprietary module in the extracted ramdisk. In terminal do
Code:
cd ~/android/ramdisk_extract/ramdisk/lib/modules && strings fsr.ko | grep vermagic
and it should produce output like this
Code:
vermagic=2.6.35.7-perf-CL382966 preempt mod_unload ARMv6
what needed is the -CL382966, thats the module localversion.
It depends on which stock boot.img we use. Different boot.img might have different output, what i've shown is what i got from boot.img that i'm using, yours might be different. Do note of the parameter, we need that later.
Click to expand...
Click to collapse
12- Now we look into our kernel source tree folder (~/android/kernel_compiling). There should be a file named make_kernel_GT-S5830.sh. We open that file
Code:
gedit ~/android/kernel_compiling/make_kernel_GT-S5830.sh
or
Code:
head ~/android/kernel_compiling/make_kernel_GT-S5830.sh
it contain something like this
Code:
make cooper_rev03_defconfig
make
edit that file abit to be
Code:
make clean
make cooper_rev03_defconfig
make
and save. Now we know that ace's defconfig (kernel config file) is cooper_rev03_defconfig.
it should be in ~/android/kernel_compiling/arch/arm/configs
now we edit the defconfig
Code:
gedit ~/android/kernel_compiling/arch/arm/configs/cooper_rev03_defconfig
and look for this line
Code:
CONFIG_LOCALVERSION="-perf"
and edit it to include our localversion we got from step 11 above. In my case its -CL382966 so i edited it to be
Code:
CONFIG_LOCALVERSION="-perf-CL382966"
Click to expand...
Click to collapse
13- Next we need to modify kernel makefile to include crosscompile toolchain path and define build for arm architecture
Code:
gedit ~/android/kernel_compiling/Makefile
and look for this section
Code:
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?=
#CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
ARCH =arm
CROSS_COMPILE =../../toolchain/arm-eabi-4.4.3/bin/arm-eabi-
edit it to be
Code:
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?=
#CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
ARCH =arm
CROSS_COMPILE =/home/anonymous/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/arm-none-eabi-
Do note that the path to crosscompile toolchain is not the same as that for u. Lets say that your linux account username is johndoe, the correct path should be
Code:
CROSS_COMPILE =/home/johndoe/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin/arm-none-eabi-
so just change it accordingly.
Click to expand...
Click to collapse
14- Still editing the makefile from step 13 above, look for this section
Code:
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks
and modify it to be
Code:
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-w \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-error=unused-but-set-variable \
-Wno-format-security \
-fno-delete-null-pointer-checks
and save the file.
Click to expand...
Click to collapse
15- Moment of truth, now we compile the kernel!!
But do make sure that the script from step 12 above is executable
Code:
chmod +x ~/android/kernel_compiling/make_kernel_GT-S5830.sh
then, we compile!!
Code:
cd ~/android/kernel_compiling && ./make_kernel_GT-S5830.sh
if everything working according to plan, there should be a nice bunch of output tailing in terminal, dont close it!! Make yourself a nice hot cup of coffee and wait... wait... wait...
Click to expand...
Click to collapse
Look who's still reading
16- And wait untill it finish. On my dualcore asus laptop with 2gb ram it took a good 20 minutes to finish compiling. If nothing goes wrong, last output will be something like
Code:
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 7 modules
CC arch/arm/common/cpaccess.mod.o
LD [M] arch/arm/common/cpaccess.ko
CC arch/arm/mach-msm/dma_test.mod.o
LD [M] arch/arm/mach-msm/dma_test.ko
CC arch/arm/mach-msm/reset_modem.mod.o
LD [M] arch/arm/mach-msm/reset_modem.ko
CC arch/arm/oprofile/oprofile.mod.o
LD [M] arch/arm/oprofile/oprofile.ko
CC drivers/input/evbug.mod.o
LD [M] drivers/input/evbug.ko
CC drivers/net/wireless/libra/librasdioif.mod.o
LD [M] drivers/net/wireless/libra/librasdioif.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
Congratulations!! u just compile your own kernel
Click to expand...
Click to collapse
17- Next is to repack our newly compiled kernel with the extracted ramdisk from step 9 earlier. Our compiled kernel will be in form of zImage file, located in ~/android/kernel_compiling/arch/arm/boot.
So in terminal do
Code:
mv ~/android/ramdisk_extract/boot.img-kernel ~/android/ramdisk_extract/boot.img-kernel.bak && cp ~/android/kernel_compiling/arch/arm/boot/zImage ~/android/ramdisk_extract/boot.img-kernel && cd ~/android/ramdisk_extract && ./repack_bootimg.pl boot.img-kernel ramdisk bootnew.img
At last we did it. Our kernel is ready, look in ~/android/ramdisk_extract, theres a new file named bootnew.img. Thats what we accomplish this far. Now the bootnew.img can be flash using cwm or such. Remember the ar6000.ko in step 7 earlier? Thats the wifi module. If this compiled kernel flashed and boot fine, just replace phone default wifi module in /system/lib/modules with our own wifi module from step 7 and wifi will work
Click to expand...
Click to collapse
So thats it for now. I'll continue again with advanced steps like pulling patch from github to add cpu governor and disk io scheduler, compressing kernel with better lzma compression for smaller filesize and more stuff later
For now, kernel compiled using this guide should boot on original galaxy ace (not the "i" variant, because we using original ace source, not the "i" variant source. both using different hadware) running stock rom or rom based on stock (because we using stock ramdisk extracted from stock boot.img, will not work on cm because it uses its own ramdisk).
And credit also goes to ketut.kumajaya and madman for some info i got from them that i included in this guide.
another placeholder
No offence bro , nice guide and all , but if I remember all guides should be in General
This was sent from a Galaxy Ace. Problem?
Its development guide
Btw nice one
Gonna try it again on my pc
Hopefully this time my pc get the kernel to compile and dont stuck at some parts
Sent from my i9070 using xda premium
Great guide! I'm going to try it since its holiday now! Thanks!
Respecting others never hurt, let's build a better XDA community.
Nice guide
an0nym0us_ nice, I hope you will add to this guide how to make boot.img.
btw fedora is nice UI
going to install it instead of Linux mint
CoolCatGetHome said:
btw fedora is nice UI
going to install it instead of Linux mint
Click to expand...
Click to collapse
thats pure gnome 3.x where as mint comes with themed one / you installed different shell
@anonymous_ in ubuntu i don't think you can directly do sh packagename
you need to do
Code:
dpkg-reconfigure -plow dash
and select No and then run /bin/sh packagename
dragonnn said:
an0nym0us_ nice, I hope you will add to this guide how to make boot.img.
Click to expand...
Click to collapse
yes, thats what i intended with this tuts. until succesful creating boot.img, or maybe even further until creating cwm flashable zip.
madman said:
thats pure gnome 3.x where as mint comes with themed one / you installed different shell
@anonymous_ in ubuntu i don't think you can directly do sh packagename
you need to do
Code:
dpkg-reconfigure -plow dash
and select No and then run /bin/sh packagename
Click to expand...
Click to collapse
thank you. yes thats true for ubuntu, to change from using bash to sh.
but since this tuts is using fedora so i'm writing what relevant with fedora. fedora stil uses sh by default
Nice guide. Moved to General.
You have great english for a non-native speaker
And how universal is this? If I had the kernel source for any phone this might apply?
Sent from my Nexus S using xda premium
scoffyburito said:
You have great english for a non-native speaker
And how universal is this? If I had the kernel source for any phone this might apply?
Sent from my Nexus S using xda premium
Click to expand...
Click to collapse
pretty much universal.
got kernel source+boot.img for the ramdisk+correct base parameter+correct pagesize+correct defconfig and u can compile for any device.
an0nym0us_ said:
Hi guys. U might not know me but in the past i've compiled my own custom kernel for galaxy ace. So in this tutorial i'll provide tutorial step by step howto compile kernel for anyone who wish to try. i'll try to make this as simple as possible for anyone to understand. But do excuse my poor english tho, its not my spoken language nor my native language
Click to expand...
Click to collapse
A little late... lol... great work
Also to compile faster make -j[number of cores+1]
example
Dual core
make -j3
Sent from my GT-S5830 using XDA
scoffyburito said:
You have great english for a non-native speaker
And how universal is this? If I had the kernel source for any phone this might apply?
Sent from my Nexus S using xda premium
Click to expand...
Click to collapse
Just that module local version will not be applicable as only samsung kept fsr modules proprietory closed... Newer Samsung devices don't have it as i observed
Sent from Galaxy Ace which just landed on "MOON"
i get yum not found
SonyXperiaAce said:
i get yum not found
Click to expand...
Click to collapse
you should read that guide uses fedora as compiling system and you are probably new to linux as well as package managers and using ubuntu so steps are somewhat different
We can just guess that he use ubuntu, if so its apt-get.
But please dont tell u try that on windows cmd
Btw difference only for yum and apt-get, and package name. Anything else is the same. And ubuntu needs more dev package to be installed than fedora. Thats why I love fedora

[Xperia P/U/Sola/Go] Better Internet Wi-Fi and 3G

Hello all! This is my first thread and here I'm presenting you better Internet weather you're on Wi-Fi or 3G.
Requirements:
1. Any ICS/JB ROM except CM.
2. Root.
The method is as follows:
1. Open Root Explorer.
2. Make your way to root>system>build.prop.
3. Tap and hold build.prop and tap "Open in Text Editor".
4. Add these lines to end of your build.prop:
Code:
#Better internet browsing & download speed
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.hspa=4096,87380,256960,4096,16384,256960
#3G Tweaks
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.hsupa.category=5
5. Press menu button and tap "Save and Exit".
6. Exit Root Explorer.
7. Re-boot phone.
8. Enjoy!
REMEMBER to hit THANKS better than saying!
cy56 said:
Hello all! This is my first thread and here I'm presenting you better Internet weather you're on Wi-Fi or 3G.
****ONLY FOR STOCK ICS***
This Mod is only for Stock ICS because this Mod is already present in Custom ROMs.
Requirements:
1. Stock ICS.
2. Root.
3. Unlocked Bootloader.
Click to expand...
Click to collapse
I'm sorry bro, why do we need unlocked bootloader for this?
Because I've tried this on locked bootloader and I've to flash my Stock FTF again I hadn't tried anymore due to my exams. Try if u can had this on locked bootloader.
And, sorry for late reply (if I did).
Sent from my ST25i using XDA Premium 4 mobile app
Why wouldn't it work on stock JB?
Sent from a polarized, modified, undying, amazingly talented and extremely naughty phone.
That's Work on locked Bootloader it's Works Good
Also try it on Xperia Sola Works Too
Thanks
:laugh:
Vtrendzzy said:
Why wouldn't it work on stock JB?
Sent from a polarized, modified, undying, amazingly talented and extremely naughty phone.
Click to expand...
Click to collapse
It works on JB too! I said for ICS because all JB custom ROMs already have this.
If your ROM doesn't have this, you can try this.... By the way I should change it to both ICS & JB.....
Sent from my ST25i using XDA-Developers Premium App.
REMEMBER to hit THANKS if I helped you, it's better than saying and doesn't costs nothing!
Work on kk?
Sent from my Xperia P using XDA Premium 4 mobile app
@cy56
Wouldn't it be much more simple to make a flashable zip that would reduce the how to install instructions to about 2 lines only?
Could some one make a zip of it to install with cwm?
That would help a lot lf people
Not CWM Flashable!
Potloodje said:
Could some one make a zip of it to install with cwm?
That would help a lot lf people
Click to expand...
Click to collapse
Hey! This is not CWM Flashable because if you make flashable ZIP and flash it, it'll replace your whole build.prop file and you'll get bootloop.
And, By the way, this method is so easy that anyone can do it. As I've provided whole process in step-by-step, you can do it on closed eyes! :victory: (PS: Don't try doing this closing your eyes :laugh: :laugh: )
Work on KK?
Sent from my Xperia Sola using Tapatalk
cy56 said:
Hey! This is not CWM Flashable because if you make flashable ZIP and flash it, it'll replace your whole build.prop file and you'll get bootloop.
Click to expand...
Click to collapse
Making a flashable zip that would not replace the whole build.prop is so easy that anyone can do it.
e.g. by executing this simple shell script:
Code:
#!/system/bin/sh
echo "\
line one\n\
line2\n\
lineN" >> /system/build.prop
Is that easy or what?
A bit too easy maybe as it would keep adding the lines at the bottom of build.prop every time it is executed, so something a bit more complicated is needed, like this
Code:
#!/system/bin/sh
BUSYBOX="/sbin/busybox"
SED="$BUSYBOX sed"
WC="$BUSYBOX wc"
#
COMMENT1="# YOUR COMMENT START"
COMMENT2="# YOUR COMMENT END"
MYLINES="\
$COMMENT1\n\
line1\n\
line2\n\
lineN\n\
$COMMENT2"
#
EXPECTEDLINES=`echo "$MYLINES" | $SED 's/'"$MYLINES"'/'"$MYLINES"'/' | $WC -l`
if [ "$EXPECTEDLINES" == "" ]; then exit 1 fi;
FOUNDLINES=`$SED -e '/'"$COMMENT1"'/,/'"$COMMENT2"'/!d' build.prop | $WC -l`
if [ "$FOUNDLINES" == "0" ]; then
echo "$MYLINES" >> build.prop
exit 0;
fi
exit 2;
And if you don't want to rely on CWM having busybox, add busybox to the zip and change
BUSYBOX="/sbin/busybox"
to
BUSYBOX=`dirname $0`"/busybox"
or just
BUSYBOX=`/tmp/busybox"
See? Anyone can do it
ChikeD said:
Making a flashable zip that would not replace the whole build.prop is so easy that anyone can do it.
e.g. by executing this simple shell script:
Code:
#!/system/bin/sh
echo "\
line one\n\
line2\n\
lineN" >> /system/build.prop
Is that easy or what?
A bit too easy maybe as it would keep adding the lines at the bottom of build.prop every time it is executed, so something a bit more complicated is needed, like this
Code:
#!/system/bin/sh
BUSYBOX="/sbin/busybox"
SED="$BUSYBOX sed"
WC="$BUSYBOX wc"
#
COMMENT1="# YOUR COMMENT START"
COMMENT2="# YOUR COMMENT END"
MYLINES="\
$COMMENT1\n\
line1\n\
line2\n\
lineN\n\
$COMMENT2"
#
EXPECTEDLINES=`echo "$MYLINES" | $SED 's/'"$MYLINES"'/'"$MYLINES"'/' | $WC -l`
if [ "$EXPECTEDLINES" == "" ]; then exit 1 fi;
FOUNDLINES=`$SED -e '/'"$COMMENT1"'/,/'"$COMMENT2"'/!d' build.prop | $WC -l`
if [ "$FOUNDLINES" == "0" ]; then
echo "$MYLINES" >> build.prop
exit 0;
fi
exit 2;
And if you don't want to rely on CWM having busybox, add busybox to the zip and change
BUSYBOX="/sbin/busybox"
to
BUSYBOX=`dirname $0`"/busybox"
or just
BUSYBOX=`/tmp/busybox"
See? Anyone can do it
Click to expand...
Click to collapse
Ohh man you really know a lot of programming. Can u teach me from basics? Pls
Sent from my ST27i using XDA Premium 4 mobile app
Or you can simply create a build entry
Hukanawa said:
Or you can simply create a build entry
Click to expand...
Click to collapse
Whazet?
@cy56
The net.tcp.buffersize props make absolutely no change at all as the are set by init.
The ro.ril props are not present at stock at all so at best they do no harm.
Never works for me....
ChikeD said:
Making a flashable zip that would not replace the whole build.prop is so easy that anyone can do it.
e.g. by executing this simple shell script:
Code:
#!/system/bin/sh
echo "\
line one\n\
line2\n\
lineN" >> /system/build.prop
Is that easy or what?
A bit too easy maybe as it would keep adding the lines at the bottom of build.prop every time it is executed, so something a bit more complicated is needed, like this
Code:
#!/system/bin/sh
BUSYBOX="/sbin/busybox"
SED="$BUSYBOX sed"
WC="$BUSYBOX wc"
#
COMMENT1="# YOUR COMMENT START"
COMMENT2="# YOUR COMMENT END"
MYLINES="\
$COMMENT1\n\
line1\n\
line2\n\
lineN\n\
$COMMENT2"
#
EXPECTEDLINES=`echo "$MYLINES" | $SED 's/'"$MYLINES"'/'"$MYLINES"'/' | $WC -l`
if [ "$EXPECTEDLINES" == "" ]; then exit 1 fi;
FOUNDLINES=`$SED -e '/'"$COMMENT1"'/,/'"$COMMENT2"'/!d' build.prop | $WC -l`
if [ "$FOUNDLINES" == "0" ]; then
echo "$MYLINES" >> build.prop
exit 0;
fi
exit 2;
And if you don't want to rely on CWM having busybox, add busybox to the zip and change
BUSYBOX="/sbin/busybox"
to
BUSYBOX=`dirname $0`"/busybox"
or just
BUSYBOX=`/tmp/busybox"
See? Anyone can do it
Click to expand...
Click to collapse
I tried it many times but it never works for me. But I tried a different method which doesn't required programming and that method never works for me thereby giving me "Infinite Bootloop"!
If someone wants to have flashable ZIP please contact him!​
Works for me!
ChikeD said:
Whazet?
@cy56
The net.tcp.buffersize props make absolutely no change at all as the are set by init.
The ro.ril props are not present at stock at all so at best they do no harm.
Click to expand...
Click to collapse
I don't know programming hence I don't know what each and every content does. I found this in many ROMs and they gave me better internet stability as in Stock ROM my downloads are usually halted so I shared this for those users who don't have this in their ROMs. I don't know the original creator of this so I can't thank him.
Try it!
jjssore said:
Work on KK?
Sent from my Xperia Sola using Tapatalk
Click to expand...
Click to collapse
KK Nightly's latest build already have some 3G and Wi-Fi tweaks different from this. If you don't have you can have a try!
But before trying make a backup of your current ROM from CWM.
cy56 said:
I don't know programming hence I don't know what each and every content does. I found this in many ROMs and they gave me better internet stability as in Stock ROM my downloads are usually halted so I shared this for those users who don't have this in their ROMs. I don't know the original creator of this so I can't thank him.
Click to expand...
Click to collapse
So how do you know it works, what difference does it make?
I think it is better not to post things you don't know about, unless it's a share/link to app or MOD someone did.
Maybe there are RMs it works, but ROMs have many other changes that may make it work.
cy56 said:
KK Nightly's latest build already have some 3G and Wi-Fi tweaks different from this. If you don't have you can have a try!
But before trying make a backup of your current ROM from CWM.
Click to expand...
Click to collapse
where i can find link kk nightly ? and any bugs?

[HOW-TO] extract kernel from source, compile, and insert on GPE (510)

How to extract the boot image from your tablet, set up adb, compile a new kernel with cool options, and put it back on your device!
UPDATED for Lolipop 12-4-14
This is a complete guide from start to finish, copy and paste style. If you own a gpe510, or any other AOSP device and a computer running Debian Linux, you can do all of this.
If all you want is the modified kernel, download from here:
Sleekai Kernel For The LG GPad 8.3 V510(GPE)
​
I am hoping people will add to this with new ideas and patches in order to make the GPE a better device. I see the potential for all sorts of neat stuff.
This guide assumes a basic knowledge of linux operating systems. I am using a Debian 64 bit (wheezy stable) to compile my kernel. I have used many, many hours of the day to figure this out properly, with specific thanks going to Pete of Pete's Blog for his image tools.
But first, lets keep this simple. As usual, you are on your own if you brick your device, though I don't see how you could if you are paying attention!
There are dependencies for building your own kernel, and you will definitely want to use a 64 bit system as a 32 bit will not work properly for kitkat.
Here are all of the packages you will need, and they will draw in further dependencies when you install, but these are it! So, here we go:
Open a terminal, su to root and:
Code:
dpkg --add-architecture i386
##This will allow for the use of some 32 bit librarys that we will need for both adb and the kernel compile. Then:
Code:
apt-get update ; apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 libc6-i686:i386 lzop liblzo2-dev libgpm2:i386 git-core git gnupg flex bison gperf libsdl1.2-dev libesd0-dev build-essential zip curl gedit libncurses5-dev zlib1g-dev fakeroot lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
Next, you will need to install adb and have your permissions set up.
In order to do this you will need to go into the developer options on your device to enable debugging on your tablet. Go to settings/about tablet/build number, and tap on build number several times to unlock the developer options.
then:
You will need to create new udev rules for your device in/etc/udev/rules.d on your computer.
Use "lsusb" in your terminal to find the manufactures code of your device. it will show up as a nexus 4, or Google device.
You will need to create a file in your computer in /etc/udev/rules.d/99-android.rules.
You can use gedit if you like:
Code:
gedit /etc/udev/rules.d/99-android.rules
Put the following inside and save, changing the manufactures code as necessary to fit your device, and change “your-login” to your login name on your computer.
Code:
# Google Nexus devices
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", OWNER="your-login" # Google Nexus devices
18d1 is the manufacturers code.
You will then want to restart udev on your computer:
Code:
service udev restart
you will now have permissions to access your android device from user space.
Now to download adb and get started. You should probably not use adb from the Debian repositories, as it may be an older version. the V510 is using kitkat android and needs the latest build of adb to work properly. It is a good idea to get rid of any old adb files on your computer first. The code below will do just that.
Code:
apt-get purge android-tools-adb android-tools-fastboot
Now download the latest adb bundle from here:
http://developer.android.com/sdk/index.html
Move it into a new directory,
*note -the version number may be different.
Code:
mkdir ~/adb
Code:
cd ~/adb
Code:
unzip adt-bundle-linux-x86_64-20131030.zip
su to root and Move the bundle to /opt:
Code:
mv adt-bundle-linux-x86_64-20131030 /opt/android-sdk-linux-x86_64-20131030
Other google products reside in /opt, this should too. This takes a minute or so on slow machines.
Next we need to link adb to /usr/bin
Code:
ln -s /opt/android-sdk-linux-x86_64-20131030/sdk/platform-tools/adb /usr/bin
Code:
ln -s /opt/android-sdk-linux-x86_64-20131030/sdk/platform-tools/fastboot /usr/bin
We are ready to begin working on the device! first start the adb server and look for your device.
Code:
adb start-server
Code:
adb devices
You will then need to confirm the connection on your tablet screen to allow access from your computer.
Okay, wev'e got this first part set up. it's time to begin working on a kernel!
Lets get started.
I want to extract and build my zimage in $userspace, so open a terminal from /home and:
Code:
mkdir ~/android
Download the source package LG-V510(G-Pad 8.3 Google Play Edition)_Android_KK_V510_11c from here :
https://www.lg.com/global/support/opensource/opensourceList?types=ALL&search=lgv510
and open it to find three folders, including a kernel folder. Move the kernel folder to ~/android and then:
Code:
cd ~/android
Download the current eabi-4.6 Google tool chain to ~/android to cross compile your android kernel:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8
When it completes, enter ~/android/kernel and get ready to compile a new kernel from the source code.
Code:
cd ~/android/kernel
Do the following each time you compile another kernel. This insures the correct path.
Code:
export PATH=$PATH:~/android/arm-eabi-4.8/bin
Code:
arm-eabi-gcc --version
you should get:
Code:
arm-eabi-gcc (GCC) 4.6.x-google 20120106 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Continue on! we are not done yet!
Code:
export ARCH=arm
Code:
export SUBARCH=arm
Code:
export CROSS_COMPILE=arm-eabi-
Code:
export KERNEL_DEFCONFIG=palman_defconfig
Code:
make clean
Code:
make palman_defconfig
Doing the above prepares your kernel build environment, while the following code opens a interface to configure the kernel. You can simplify this later however you wish.
But for now,
Code:
make menuconfig
At this point make whatever changes you wish to the config file. for a list of the changes I have made, and that are in the kernel available to download, look in the sleekai kernel thread. (At start of thread, or in my signature).
After saving your changes,
Code:
make
Or conversely
Code:
make -o2
which will optimize the make. I recommend using simply "make" first, as the other may not properly show errors should any occur.
and go make a pot of coffee, and probably drink the whole pot! This will take a while.
At the end you will see that the "zimage is ready"
If you have errors, then you probably have dependency problems. If not, Yay! You compiled your first kernel, but we are not done yet!
The zimage you just produced is stored in /kernel/arch/arm/boot/zImage
To put both the zimage and any modules into a separate folder inside of ~/android so as to make extracting them easier:
Code:
mkdir ~/android/kernel_output
Code:
cp ~/android/kernel/arch/arm/boot/zImage ~/android/kernel_output/zImage
Code:
find ~/android/kernel -name "*.ko" -exec cp {} ~/android/kernel_output/ \;
The above code will find all the modules for your kernel. We don't need them for this tutorial, but it still is mighty handy!
Extract your boot image (boot.emmc.win) for the ramdisk You may also download the stock.zip from the sleekai kernel thread
Now make a backup to transfer to your computer.
Reboot to recovery on your tablet. I'm using TWRP. If you are using something else it should be just as easy.
Code:
adb reboot recovery
Only tick the boot
make a backup to your sd card. I changed the name to boot.bac to keep it simple
reboot
make sure the backup of boot is present using a file explorer. I am using ES File explorer.
On your computer, pull the file using adb
Code:
adb start-server
Code:
adb devices
Code:
adb pull /storage/sdcard1/TWRP/BACKUPS/LG0000606708987/boot.bac /home/sleek
sleek is my user name, replace with yours or use tilde.
What we are after is the "boot.emmc.win" file. We will only need this and the zImage to compile a new boot image and run it on your tablet.
The tools to extract the kernel and ramdisk from the boot.emmc.win you will need the following boot image tools installed on your computer.
So, again, lets keep this simple. All the tools are forked to my github for ease of use.
So lets install the tools! Ready?
As Root:
Code:
mkdir /usr/src/android
Code:
mkdir /usr/src/android/boot
Code:
cd /usr/src/android/
Code:
git clone https://github.com/sleekmason/bootimg-tools.git
Code:
cd bootimg-tools/libmincrypt/
Code:
gcc -c *.c -I../include
Code:
ar rcs libmincrypt.a *.o
Code:
cd ../mkbootimg
Code:
gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
Code:
cp mkbootimg /usr/local/bin/
Code:
cd ../cpio
Code:
gcc mkbootfs.c -o mkbootfs -I../include
Code:
cp mkbootfs /usr/local/bin/
Code:
cd /usr/src/android/bootimg-tools/mkbootimg/
Code:
wget https://raw.github.com/sleekmason/bootimg-tools/master/mkbootimg/unmkbootimg.c
Code:
gcc -o unmkbootimg unmkbootimg.c
Code:
cp unmkbootimg /usr/local/bin/
Now everything is in place to make a new boot image for your tablet!
Finishing this up is easy.
As root, we made a directory in /usr/src/android/boot for your boot.emmc.win file to be torn apart:
Code:
cd /usr/src/android/boot
Copy your new zImage and the boot.emmc.win file you extracted from your device.
Note* "/home/sleek" is the path on my computer, and should be changed to reflect yours!
Code:
cp /home/sleek/android/kernel_output/zImage /usr/src/android/boot
Code:
cp /home/sleek/boot.emmc.win /usr/src/android/boot
Now unpack the boot.emmc.win file to get the ram disk
Code:
unmkbootimg -i boot.emmc.win
Now you may remove the current boot.emmc.win file, and the resultant kernel file as we will be making new ones, and rename the zImage file you moved here to "kernel".
Code:
rm boot.emmc.win kernel && mv zImage kernel
Now repack using the command given to you during the unpack:
Code:
mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x80208000 --ramdisk_offset 0x82200000 --second_offset 0x81100000 --tags_offset 0x80200100 --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=palman lpj=67677 vmalloc=300M' --kernel kernel --ramdisk ramdisk.cpio.gz -o boot.emmc.win
Note* For 500 users this may be different. Simply use the command from the prompt.
You should now have a brand new boot.emmc.win image in /usr/src/android/boot!!
To push back on your device to test
Code:
adb reboot bootloader
Code:
fastboot boot boot.emmc.win
USING the above will only put your kernel build into memory and should not hurt your device if something goes wrong. Use the command below to make it permanent.
If everything works well, you should see the change you made to the /general/perf-localversion/ in your settings under kernel. from there it's up to you to hack away! make new and unique kernels!
If you want your kernel to survive reboot do;
Code:
fastboot flash boot boot.emmc.win
then:
Code:
fastboot reboot
You can expect a slow bootup on the first go around as your new kernel populates the widgets, etc..
NOTE*For the use of the latest eabi-4.7 google toolchain, you will need the libglibc libraries from the "testing" branch as gcc 4.7 is in testing. I advise completing the guide with eabi 4.6 first before trying 4.7.
The gamma correction though enabled in 4.6, isn't near as good as the native compile using 4.7. If you want the screen to look like it does in my kernels, you will need 4.7
For the eabi-4.7:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7
That's it! Good luck! Remember, If you post a kernel you have made, you will need to show your kernel source, etc . . . Git hub is a good choice to keep track of changes you make. Best regards, Sleekmason
If you are a v500 user and want to build your own kernel!
First, read the above post as you will be following the steps listed there.​
There are just a couple of changes that you will need to do, and maybe a riddle to figure out as well. Read on.
You will need to download the v500 source from here: https://www.lg.com/global/support/opensource/opensourceList?superOsCategoryId=CAT00000001&osCategoryId=
Look for the LGV500 kernel source.
Where it says "palman" for the defconfig items, you will want to replace that with the defconfig for the 500, so replace palman with awifi-perf,
like this:
Code:
export KERNEL_DEFCONFIG=awifi-perf_defconfig
Code:
make awifi-perf_defconfig
Important
Follow the guide and build with the Google Toolchain eabi4.6 first
LG compiled for the 500 and 510 using the eabi4.6. It works, and will give you a feel for the process, and allow you to use your kernel.
Note*
I use the google toolchain eabi-4.7 for the sleekai kernels as it changes the gamma to reasonable defaults on the 510 without further tweaking. After compiling a kernel or two to get a feel for it, you should try using the 4.7 toolchain. To do so, you will probably need the libglibc libraries from the "testing" branch. Look it up.
caveat: I recieved a compile error for the v500 when I used the eabi-4.7 . . . . . yeah. You'll have to work that out.
There is a modified anykernel script for emmc devices out there (Search Google or here in xda). You will have to use the anykernel script after making your boot.emmc.win image as fastboot won't work on the 500. There may be another way .... But I don't know what it is.
Edit* There are now two different kernels for the LG GPad 8.3 V500(awifi) located in the development section of the forum.
Best of luck! -sleekmason
Can this be used to create a kernel for the non Google Play Edition Gpad to be able to allow us to install the Google Play edition ROM on it
Sent from my SM-N900W8 using Tapatalk
Canadoc said:
Can this be used to create a kernel for the non Google Play Edition Gpad to be able to allow us to install the Google Play edition ROM on it
Sent from my SM-N900W8 using Tapatalk
Click to expand...
Click to collapse
I would think so. I edited the above to show how to put the image back on your device. You should be able to use any source you wish to compile with. My thoughts are that you might wish to examine the differences in the ram disk if any.
sleekmason said:
Howdy, I would like to share how to download the kernel source for the gpe, compile a new custom kernel, and insert into your LG gpad GPE 510.
...
Click to expand...
Click to collapse
Thanks for the guide. Making GPE kernel was my next step in trying to get the GPE ROM to work on v510.
I just made guide for getting your Android build environment going if you want to use it on your blog or where ever.
http://forum.xda-developers.com/showthread.php?t=2629008
The problem with v500 is that it does not have fastboot so we can not flash kernel like how you can on v510.
@ AndroidUser00110001 Hi! I know that somebody tweaked the Any kernel to work on emmc devices... Maybe it could be adapted? Actually getting the menuconfig and make should be the same process as well as repacking the image. I take it just getting it back on the 500 device is the problem?
I will add your link to this post for setting up a build environment if that is okay.
sleekmason said:
@ AndroidUser00110001 Hi! I know that somebody tweaked the Any kernel to work on emmc devices... Maybe it could be adapted? Actually getting the menuconfig and make should be the same process as well as repacking the image. I take it just getting it back on the 500 device is the problem?
I will add your link to this post for setting up a build environment if that is okay.
Click to expand...
Click to collapse
Is that the koush any kernel? I was going to mess with that too. I just need a small break now. Took a few days to get new system exactly how I want it.
Go ahead and use guide...mo problem at all.
AndroidUser00110001 said:
Is that the koush any kernel? I was going to mess with that too. I just need a small break now. Took a few days to get new system exactly how I want it.
Go ahead and use guide...mo problem at all.
Click to expand...
Click to collapse
Yes, from here: http://forum.xda-developers.com/showthread.php?t=847265
I noted that boot was on block nncblk0p21 on our device, and not 22? better double check that. I tried it Anykernel as well to no avail when getting this set up. Fastboot is Awesome!
It's taxing to get it set up right. Seems like things change very often for the dependencies based on other package changes. I ussually go with testing but redid two partitions with stable. The 32 bit is just going to sit there, which seems kinda silly due to the need for extra packages in 64 to compile for 32 but whatever. Yeah.
AndroidUser00110001 said:
Thanks for the guide. Making GPE kernel was my next step in trying to get the GPE ROM to work on v510.
I just made guide for getting your Android build environment going if you want to use it on your blog or where ever.
http://forum.xda-developers.com/showthread.php?t=2629008
The problem with v500 is that it does not have fastboot so we can not flash kernel like how you can on v510.
Click to expand...
Click to collapse
I don't understand, what are the differences bettween the v500 and v510? they both have the same hardware, but not the same boot partition or something like that?
ayziaa said:
I don't understand, what are the differences bettween the v500 and v510? they both have the same hardware, but not the same boot partition or something like that?
Click to expand...
Click to collapse
The boot on the 500 cannot be fully unlocked.
This is not the appropriate place to ask that kind of question should be asked in general or in troubleshooting. Also, there are already many threads about this same question please use the search utility to find them. Thank you.
i was thinking of writing a tutorial about this as well for the v500 but this better than i would have done Well done...
sleekmason said:
Yes, from here: http://forum.xda-developers.com/showthread.php?t=847265
I noted that boot was on block nncblk0p21 on our device, and not 22? better double check that. I tried it Anykernel as well to no avail when getting this set up. Fastboot is Awesome!
It's taxing to get it set up right. Seems like things change very often for the dependencies based on other package changes. I ussually go with testing but redid two partitions with stable. The 32 bit is just going to sit there, which seems kinda silly due to the need for extra packages in 64 to compile for 32 but whatever. Yeah.
Click to expand...
Click to collapse
Another tool that i ported to the lg g pad a bit back along with loki-doki...
Quick hint, dont bother with direct mmc naming as qcom (i dont know if the other chip makers do the same thing, as i have only had qcom devices) has given us a simple naming scheme...
should only be used by people who know how to use this,
darkassain said:
i was thinking of writing a tutorial about this as well for the v500 but this better than i would have done Well done...
Another tool that i ported to the lg g pad a bit back along with loki-doki...
Quick hint, dont bother with direct mmc naming as qcom (i dont know if the other chip makers do the same thing, as i have only had qcom devices) has given us a simple naming scheme...
should only be used by people who know how to use this,
Click to expand...
Click to collapse
Thank you! Have you successfully used your script to push a kernel onto the 500 Or 510?
I would think this could be very handy for sharing a custom kernel for the 510, but would like to see somebody report a positive test result. Very cool!
sleekmason said:
Thank you! Have you successfully used your script to push a kernel onto the 500 Or 510?
I would think this could be very handy for sharing a custom kernel for the 510, but would like to see somebody report a positive test result. Very cool!
Click to expand...
Click to collapse
yes back before when there wasnt a overclocked kernel i basically used this to push it when i would compile just the kernel (didnt maintain so i now use dyn's)...
yes this is only for the v500 as this has the extra loki step, but it shouldnt be hard to modify so it does not do that extra step
darkassain said:
i was thinking of writing a tutorial about this as well for the v500 but this better than i would have done Well done...
Another tool that i ported to the lg g pad a bit back along with loki-doki...
Quick hint, dont bother with direct mmc naming as qcom (i dont know if the other chip makers do the same thing, as i have only had qcom devices) has given us a simple naming scheme...
should only be used by people who know how to use this,
Click to expand...
Click to collapse
Hi, can you just use a generic anykernel updater script too?
For example to flash a packed boot.img
Code:
run_program("/tmp/busybox", "dd", "if=/dev/block/platform/msm_sdcc.1/by-name/boot", "of=/tmp/boot.img");
run_program("/tmp/unpackbootimg", "-i", "/tmp/boot.img", "-o", "/tmp/");
run_program("/tmp/repack-ramdisk.sh");
run_program("/tmp/mkbootimg.sh");
run_program("/tmp/busybox", "dd", "if=/tmp/newboot.img", "of=/dev/block/platform/msm_sdcc.1/by-name/boot");
mako and flo can do like this.. I think HTC One as well, since they are all similar qcom chipsets maybe this device can too
poondog said:
Hi, can you just use a generic anykernel updater script too?
For example to flash a packed boot.img
Code:
run_program("/tmp/busybox", "dd", "if=/dev/block/platform/msm_sdcc.1/by-name/boot", "of=/tmp/boot.img");
run_program("/tmp/unpackbootimg", "-i", "/tmp/boot.img", "-o", "/tmp/");
run_program("/tmp/repack-ramdisk.sh");
run_program("/tmp/mkbootimg.sh");
run_program("/tmp/busybox", "dd", "if=/tmp/newboot.img", "of=/dev/block/platform/msm_sdcc.1/by-name/boot");
mako and flo can do like this.. I think HTC One as well, since they are all similar qcom chipsets maybe this device can too
Click to expand...
Click to collapse
thanks for reminding me the any kernel uploaded by me won't work as it doesn't parse Loki images xorrectly, I'll upload the correct one once I have access to my pc
darkassain said:
thanks for reminding me the any kernel uploaded by me won't work as it doesn't parse Loki images xorrectly, I'll upload the correct one once I have access to my pc
Click to expand...
Click to collapse
could you please re-post to a different thread rather than hijacking this thread, as your script does not work with the 510 currently and I do not want to go to get confused with my kernel how to. what started out to maybe become relevant apparently will not and so shouldn't be confused with what I'm doing here. I will be happy to try working with your script if you would open up an appropriate thread. Thank you.
Installed kenel and booted. Now to install trickster mod and fix the dang gamma.
gunnyman said:
Installed kenel and booted. Now to install trickster mod and fix the dang gamma.
Click to expand...
Click to collapse
Excellent!! Pleased to know that you are able to use it. Have you changed your gamma settings?
I did on mine and am pleased with the result. I'm using 248, 252, 255 using trickster mod What are you going with?
sleekmason said:
Excellent!! Pleased to know that you are able to use it. Have you changed your gamma settings?
I did on mine and am pleased with the result. I'm using 248, 252, 255 using trickster mod What are you going with?
Click to expand...
Click to collapse
havent messed around too much.
I had a thought about this and I think it would be awesome if we could incorporate faux123's bits for gamma and color control. His fauxcontrol offers much more granular control than trickster.
I'm thankful to have what we have, and THANK YOU for sharing it, but like any good geek I WANTS MOAR!!!!!
gunnyman said:
havent messed around too much.
I had a thought about this and I think it would be awesome if we could incorporate faux123's bits for gamma and color control. His fauxcontrol offers much more granular control than trickster.
I'm thankful to have what we have, and THANK YOU for sharing it, but like any good geek I WANTS MOAR!!!!!
Click to expand...
Click to collapse
me too! I'll look into it. There are other apps besides trickster to give you more control. I think at the kernel level everything we need is unlocked. And yeah, he knows his business like nobody else eh? I'm just persistent.

[ROM]Samsung S3 Intl Sailfishos

Hi there!
Following the hadk pdf from jolla porting guide.
I've got the sailfishos working on terminal android running. Booting on top attempting since monday tonight.
I'll explain more and I'll give more shots on working.
My issue now is to build the boot, recovery image to flash and boot it. The jolla sailfishos as a GUI operating system on Galaxy S3 I9300 model.
FIY : filename = sfa-i9300-ea-1.0.8.19-my1.tar.bz2
Instructions for chroot co,pilation on ubuntu amd64 x86_64 bit:
Code:
sudo mkdir -p /srv/mer/
mkdir -p $HOME/mer/
nano .bashrc
export $MER_ROOT=/srv/mer/
export $MER_ROOT=$HOME/mer/
ctrl +x to save and y
but type sudo apt-get install -y curl
for do the downloading file.
next do the following commands on terminal:
export $MER_ROOT=/srv/mer/
cd $HOME; curl -k -O https://img.merproject.org/images/mer-sdk/mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2 ;
sudo mkdir -p $MER_ROOT/sdks/sdk ;
cd $MER_ROOT/sdks/sdk ;
sudo tar --numeric-owner -p -xjf $HOME/mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2 ;
echo "export MER_ROOT=$MER_ROOT" >> ~/.bashrc
echo 'alias sdk=$MER_ROOT/sdks/sdk/mer-sdk-chroot' >> ~/.bashrc ; exec bash ;
echo 'PS1="MerSDK $PS1"' >> ~/.mersdk.profile ;
sdk
Now, do the following instructions:
$HOST>
nano $HOME/.hadk.env
export MER_ROOT="[/home/$user]"
export ANDROID_ROOT="$MER_ROOT/android/droid"
export VENDOR="[samsung]"
export DEVICE="[i9300]"
ctrl +x and y for save it.
nano $HOME/.mersdkubu.profile
function hadk() { source $HOME/.hadk.env${1:+.$1}; echo "Env setup for $DEVICE"; }
export PS1="HABUILD_SDK [\${DEVICE}] $PS1"
hadk
save it again
nano $HOME/.mersdk.profile
function hadk() { source $HOME/.hadk.env${1:+.$1}; echo "Env setup for $DEVICE"; }
hadk
now save this file.
Now in ctrl + alt + x, it will show a terminal:
type this:
sdk
type your password
hadk
TARBALL=ubuntu-quantal-android-rootfs.tar.bz2
curl -O http://img.merproject.org/images/mer-hybris/ubu/$TARBALL
UBUNTU_CHROOT=/parentroot/$MER_ROOT/sdks/ubuntu
sudo mkdir -p $UBUNTU_CHROOT
sudo tar --numeric-owner -xvjf $TARBALL -C $UBUNTU_CHROOT
hadk
ubu-chroot -r /parentroot/$MER_ROOT/sdks/ubuntu
exit
git config --global user.name "Your Name"
git config --global user.email "Your email"
back again for
hadk
cd $HOME
mkdir -p $HOME/mer/android/droid
repo init -u git://github.com/mer-hybris/android.git -b hybris-10.1
repo sync
after this, you will have HABUILD_SDK
DEVICE=i9300
export $DEVICE
source build/envsetup.sh
breakfast $DEVICE
now type
make hybris-hal
But now as a ota file for flashing on i9300, in this last 2 days in my laptop core2Duo Extreme I'm facing overheating.
So, everyone can test it.
Code:
A little change on mount fixups.
Go to the directory hybris/hybris-boot
nano mount-fixups on i9305| encore)
put the "i9305" | "encore" | "i9300")
Script for booting sailfishingos on an android terminal. This script is to mount the binds folders and for fixing for preventing the /dev/null issue when we all boot the chroot sailfishos.
name of the script : sailfishos.sh - made it on the /extsdCard/ folder.
1) nano /extSdCard/sailfishos.sh and copy the following code
2) ctrl +x to save it
3) bash sailfishos.sh
Code:
su
mount -o bind /dev /data/.stowaways/sailfishos/dev
mount -o bind /proc /data/.stowaways/sailfishos/proc
mount -o bind /sys/ /data/.stowaways/sailfishos/sys
chroot /data/.stowaways/sailfishos/ /bin/su -
echo "nameserver 8.8.8.8" > /etc/resolv.conf
Code:
Procedures:
1) get cm 10.1 flash it.
2) recovery mode to flash it.
3) download my sailfish i9300 tar.bz2 from d-h.st
4) Copy it for your /extSdCard
Code:
Procedures inside adb:
1) sudo adb kill-server
2) sudo adb start-server
3) adb devices
4) adb shell
5) su
6) cd /extSdCard/
8) mkdir -p /data/.stowaways/sailfishos
8) tar --numeric-owner -xvf filename -C /data/.stowaways/sailfishos
9) mount -o bind /dev /data/.stowaways/sailfishos/dev
10) mount -o bind /proc /data/.stowaways/sailfishos/proc
11) mount -o bind /sys /data/.stowaways/sailfishos/sys
finally:
chroot /data/.stawaways/sailfishos/ /bin/su-
you'll see sailfish os version something 15
try this on it:
cd /
ls
[LINK] http://d-h.st/gX5 [/LINK]
See folders on it.
PS: I'll give more shots also more instructions very soon. Thanx.
Another PS: I'll give more news about Jolla sailfish os very soon.
But I need to tell this, I've got i9300 defconfig kernel for Jolla sailfishos very similar to defconfig i9305 kernel and I got it compiled with very success on hadk Ubuntu chroot on mine Ubuntu 14.04 LTS version.
astronfestmon said:
Hi there!
Following the hadk pdf from jolla porting guide.
I've got the sailfishos working on terminal android running. Booting on top attemptinh since yesterday tonight.
Code:
Procedures:
1) get cm 10.1 flash it.
2) recovery mode to flash it.
3) download my sailfish i9300 tar.bz2 from d-h.st
4) Copy it for your /extSdCard
Code:
Procedures inside adb:
1) sudo adb kill-server
2) sudo adb start-server
3) adb devices
4) adb shell
5) su
6) cd /extSdCard/
8) mkdir -p /data/.stowaways/sailfishos
8) tar --numeric-owner -xvf filename -C /data/.stowaways/sailfishos
9) mount -o bind /dev /data/.stowaways/sailfishos/dev
10) mount -o bind /proc /data/.stowaways/sailfishos/proc
11) mount -o bind /sys /data/.stowaways/sailfishos/sys
finally:
chroot /data/.stawaways/sailfishos/ /bin/su-
you'll see sailfish os version something 15
try this on it:
cd /
ls
[LINK] http://d-h.st/gX5 [/LINK]
sees folders on it.
Click to expand...
Click to collapse
Screenshots?
Sent from my SM-G900F using XDA Free mobile app
Fantastic... I'll give a try. Plz provide some more details, screenshots & new features from your currently running sailfish os. Thanx for sharing
i fed with adb commands & not able to flash
Uhm ... I gonna wait for this ...
Sent from my SM-G900F using XDA Free mobile app
how to install ?
When I had the rom for flashing in recovery. I'll explain it.
For now, it can be installed through the adb, to work it inside the android terminal.
astronfestmon said:
When I had the rom for flashing in recovery. I'll explain it.
For now, it can be installed through the adb, to work it inside the android terminal.
Click to expand...
Click to collapse
any update on this?
I followed the above procedure and I can see the Sailfish version and the files list from adb. What next?
EDIT: Just saw your PS in OP
In the end of the week probably I'll release the boot kernel working on.
astronfestmon said:
In the end of the week probably I'll release the boot kernel working on.
Click to expand...
Click to collapse
I've successfully built boot and recovery images, packed the zip for flashing in recovery but there is a problem with the boot.img.
I'm trying to find out why it doesn't boot (the phone stays at the galaxy logo)
The actual guide for porting misses some stuff and there are errors here and there. Besides, there is a problem with the trusty chroot, quantal is working.
Aye. I've notice that.
I'm fixing some issues in quantal chroot.
E.g. inside the sources.list I add the 12.04 lts mirrors. Made by a website with the sources.list for 12.04 lts mirrors.
Yeah. I've done the boot kernel image and it made the same as you.
But with meld diff I've compared the i9305 defconfig with mine i9300 defconfig.
I'm going to test it with the changes meld diff made with a comparison with i9305 defconfig.
Now I made a make systemtarball and I'll try a make bootimage or a make factory_image for it.
astronfestmon said:
Aye. I've notice that.
I'm fixing some issues in quantal chroot.
E.g. inside the sources.list I add the 12.04 lts mirrors. Made by a website with the sources.list for 12.04 lts mirrors.
Yeah. I've done the boot kernel image and it made the same as you.
But with meld diff I've compared the i9305 defconfig with mine i9300 defconfig.
I'm going to test it with the changes meld diff made with a comparison with i9305 defconfig.
Now I made a make systemtarball and I'll try a make bootimage or a make factory_image for it.
Click to expand...
Click to collapse
It would be great if you could make it to boot.
I will try to compile the kernel with CONFIG_CMDLINE="console=tty0" . I'm hoping that would direct kernel panic message to the screen so we could idenfity what the problem is with booting hybris-boot.img
So... Any development?
Sent from my Nexus 5 using XDA Premium 4 mobile app
Hi! All of you! I'm doing efforts between these days. In these vacation days. I'll report more when I got home back.
astronfestmon said:
Hi! All of you! I'm doing efforts between these days. In these vacation days. I'll report more when I got home back.
Click to expand...
Click to collapse
Hi, I've also been trying to port sailfish os to i9300. I've been successful in creating an image that works, i.e. got it to boot into sailfish but there are some issues that I haven't been able to fix, like for instances, the wlan is detected but fails to establish a connection with any network, GSM is also not working. A full list with details can be found here https://wiki.merproject.org/wiki/Adaptations/libhybris
Maybe we should try to work together to get a fully functional sailfish os image
Cheers
---------- Post added 19th August 2014 at 12:01 AM ---------- Previous post was 18th August 2014 at 11:12 PM ----------
redrum781 said:
I've successfully built boot and recovery images, packed the zip for flashing in recovery but there is a problem with the boot.img.
I'm trying to find out why it doesn't boot (the phone stays at the galaxy logo)
The actual guide for porting misses some stuff and there are errors here and there. Besides, there is a problem with the trusty chroot, quantal is working.
Click to expand...
Click to collapse
The phone may be stuck at the galaxy logo, but there's a way to debug to find out what's wrong, follow this steps (only tested on linux):
1) connect your phone with the computer, the initramfs in boot.img will create a network interface (phone's ip is: 192.168.2.15) and enable a telnet deamon (default port: 23) and also a udhcp server, so luckily the computer will ask for an ip that everything will be set up automatically. If not try configuring static ip (192.168.2.20 and adding a route to 192.168.2.0)
2) telnet 192.168.2.15
3) when you're in the telnet session, you can check /diagnostic.log (i think) it will show why the boot failed. It is possible to execute commands into the init, by writing to (/init-ctl/stdin)
When logged into the telnet session it will dump a bit of information, be sure to read it as is useful .
Also check HADK 9.2 Operating Blind on an Existing Device
PS: the files may contain mistakes as I wrote this post without checking for the correct names (I don't have sailfish flashed at the moment).
Also consider visiting the IRC channel (#sailfishos-porters), if you're not doing it already
Hope it helps
rusty88 said:
Hi, I've also been trying to port sailfish os to i9300. I've been successful in creating an image that works, i.e. got it to boot into sailfish but there are some issues that I haven't been able to fix, like for instances, the wlan is detected but fails to establish a connection with any network, GSM is also not working. A full list with details can be found here https://wiki.merproject.org/wiki/Adaptations/libhybris
Maybe we should try to work together to get a fully functional sailfish os image
Cheers
---------- Post added 19th August 2014 at 12:01 AM ---------- Previous post was 18th August 2014 at 11:12 PM ----------
The phone may be stuck at the galaxy logo, but there's a way to debug to find out what's wrong, follow this steps (only tested on linux):
1) connect your phone with the computer, the initramfs in boot.img will create a network interface (phone's ip is: 192.168.2.15) and enable a telnet deamon (default port: 23) and also a udhcp server, so luckily the computer will ask for an ip that everything will be set up automatically. If not try configuring static ip (192.168.2.20 and adding a route to 192.168.2.0)
2) telnet 192.168.2.15
3) when you're in the telnet session, you can check /diagnostic.log (i think) it will show why the boot failed. It is possible to execute commands into the init, by writing to (/init-ctl/stdin)
When logged into the telnet session it will dump a bit of information, be sure to read it as is useful .
Also check HADK 9.2 Operating Blind on an Existing Device
PS: the files may contain mistakes as I wrote this post without checking for the correct names (I don't have sailfish flashed at the moment).
Also consider visiting the IRC channel (#sailfishos-porters), if you're not doing it already
Hope it helps
Click to expand...
Click to collapse
Will this os improve our device? Whats the pro and the con for a change (if it works finaly)?[emoji4]
MaxAndroided said:
Will this os improve our device? Whats the pro and the con for a change (if it works finaly)?[emoji4]
Click to expand...
Click to collapse
well maxAndroided all I can say at the moment is that the OS looks very promising... the UI is very smooth. Is another approach to mobile interaction based on gestures. I'm really loving it, sadly I can used it for day to day activities yet.
The jolla phone at the moment is able to run android apps and hopefully soon that will be available for any image built for android phones. So what that means is that if you don't find a suitable native app for sailfish os, you can always run your favorite android app in sailfish os
Anyone that wants to help bring sailfish os to i9300 is welcome to help, so if you have any idea on how to debug and fix the issues let me know
PS: if any one would like to try it, take a look at my previous post here
rusty88 said:
well maxAndroided all I can say at the moment is that the OS looks very promising... the UI is very smooth. Is another approach to mobile interaction based on gestures. I'm really loving it, sadly I can used it for day to day activities yet.
The jolla phone at the moment is able to run android apps and hopefully soon that will be available for any image built for android phones. So what that means is that if you don't find a suitable native app for sailfish os, you can always run your favorite android app in sailfish os
Anyone that wants to help bring sailfish os to i9300 is welcome to help, so if you have any idea on how to debug and fix the issues let me know
PS: if any one would like to try it, take a look at my previous post here
Click to expand...
Click to collapse
@rusty88, I am no developer/expert, but is there any way we can try and use I9300 native libraries or binaries to make GSM (or some other functionality for that matter) work? maybe RIL libs/binaries for GSM?
msri3here said:
@rusty88, I am no developer/expert, but is there any way we can try and use I9300 native libraries or binaries to make GSM (or some other functionality for that matter) work? maybe RIL libs/binaries for GSM?
Click to expand...
Click to collapse
yes @msri3here technically that is what i'm doing, its using RIL lib based on cm10.1.3 that was working fine before I flash sailfish, but on sailfish the log that RIL daemon dumps is really a mess and haven't figure out why is failing. One thing that I've notice is that RILD (one of its child process) creates the socket at /dev/socket/rild but it's killed afterwards, the sockets disappear and the process restarts all over again
Stracing RILD is not helping either as it seems that everything is Ok.
I'm trying to buy a new smartphone for day to day use so I can dedicate more time to debug on my i9300.
rusty88 said:
well maxAndroided all I can say at the moment is that the OS looks very promising... the UI is very smooth. Is another approach to mobile interaction based on gestures. I'm really loving it, sadly I can used it for day to day activities yet.
The jolla phone at the moment is able to run android apps and hopefully soon that will be available for any image built for android phones. So what that means is that if you don't find a suitable native app for sailfish os, you can always run your favorite android app in sailfish os
Anyone that wants to help bring sailfish os to i9300 is welcome to help, so if you have any idea on how to debug and fix the issues let me know
PS: if any one would like to try it, take a look at my previous post here
Click to expand...
Click to collapse
tried your rom but stuck on "samsung galaxy s 3 gt-i9300" screen nothing is happening plus if i touch the screen i get a response from the capacitive buttons but thats all

Building Samsung Open-Source Kernel and disable DEFEX

I'm going to show you how to build a custom kernel, and a custom boot.img.
Requirements
A linux OS
Kernel source code from Samsung
Android Image Kitchen (Required for the SEANDROID metadata it appends automatically)
GCC Cross Compilation Toolchain 4.8 (You may just clone the repo with git, or download a zip)
Hypothetical workspace directory on the filesystem: /workspace, now prepare it like this:
/workspace/kernel - this is where the kernel source code will be, this is what we will build. Extract the downloaded Kernel.tar.gz here
/workspace/build - this is the kernel compilation result, populated by the build
/workspace/toolchain - this is the required cross-compilation toolchain you download or check-out from the google link
/workspace/kitchen - Extract Android Image Kitchen here
Click to expand...
Click to collapse
Go to http://opensource.samsung.com/reception.do and search for SM-J415, download one of the results, extract Kernel.tar.gz to /workspace/kernel. I believe SWA stands for South West Asia, and MAE - Middle-east Africa, it doesn't matter which you pick, it is related to radio regulations.
Now overwrite the file /workspace/kernel/build_kernel.sh with:
Code:
#!/bin/bash
# The cross compilation toolchain path
export TOOLCHAIN=$(pwd)/../toolchain/arm-linux-androideabi-4.8
# This is the directory for the compiled kernel
export OUTDIR="O=$(pwd)/../build"
export PATH=$TOOLCHAIN/bin:$PATH
export ARCH=arm
export CROSS_COMPILE=arm-linux-androideabi-
export THREADS=$(nproc --all)
export COMMON_ARGS="-j$THREADS $OUTDIR arch=arm CFLAGS_MODULE=-fno-pic arch=arm"
if [ "$1" == "build" ]; then
make $COMMON_ARGS j4primelte_sea_open_defconfig
make $COMMON_ARGS
elif [ "$1" == "rebuild" ]; then
make $COMMON_ARGS
elif [ "$1" == "clean" ]; then
make $COMMON_ARGS distclean
make $COMMON_ARGS clean
else
echo "./build_kernel.sh build|rebuild|clean"
fi
Building kernel source code
Run the script:
$ cd /workspace/kernel/
edit: /workspace/kernel/arch/arm/configs/j4primelte_sea_open_defconfig
change CONFIG_SECURITY_DEFEX=y to CONFIG_SECURITY_DEFEX=n
$ bash build_kernel.sh build
It should build normally, if it fails there's something wrong with your OS setup. After a long time, you should see the compiled and compressed kernel with the DTP appended at:
/workspace/target/arch/arm/boot/zImage-dtb
The kernel configuration it created from the defconfig files in the kernel source tree is at
/workspace/target/.config
Build a new boot.img
$ cd /workspace/kitchen
$ bash unpackimg.sh /path/to/a/boot/or/recovery.img
Now you will have the unpacked kernel in: /workspace/kitchen/split_img/boot.img-zImage
Delete it
$ rm split_img/boot.img-zImage
Link the built custom kernel there instead
$ ln -s /workspace/target/arch/arm/boot/zImage-dtb /workspace/kitchen/split_img/boot.img-zImage
Now each time you create the boot.img, it will include your custom kernel instead.
Tweak the files and ramdisk as much as you want, and repackage the boot.img
$ bash repackimg.sh
Now you have a boot.img at /workspace/kitchen/image-new.img that is ready to flash to the device. You can unpack custom recoveries the same way as you unpacked boot.img to make them use your custom kernel.
Kernel configurations tried
CONFIG_SECURITY=n - boot loop
CONFIG_SECURITY_SELINUX=n - boot loop
CONFIG_SECURITY_DEFEX=n - works
CONFIG_DM_VERITY=n - works, does not prevent initramfs from using DM-VERITY, you still need some sort of ramdisk hack to disable verification of the next boot phase after initrd.
Often when editing the defconfig files, the same variables are declared in many different files so you might be better off using "sed' to change the variables, example:
$ grep -lr "CONFIG_SECURITY=y" | while read line; do sed -i 's/CONFIG_SECURITY=y/CONFIG_SECURITY=n/g' $line; done
When running "build_kernel.sh build", it will print "configuration written to .config" so verify that the variable was actually changed in the final config /workspace/build/.config
kapmino269 said:
and I think ,They aren't kernel see
Click to expand...
Click to collapse
No that is the latest kernel source code running on the latest firmware. You can use either of those 2 downloads from opensource.samsung.com
kapmino269 said:
it isn't working .
Click to expand...
Click to collapse
The kernel source code is on the Samsung opensource website.... there are two versions one that is MEA ( for Middle East and Africa roms) and the other one for SWA. It works if compiled properly
kapmino269 said:
ok
i have questions loop device depend on kernel and if it is .
How to add support?
Click to expand...
Click to collapse
It seems it depends on the kernel support but I haven't actually tried messing around that stuff
kapmino269 said:
it isn't working .
Click to expand...
Click to collapse
You need to install gcc, python and make before you run the command bash build_kernel.sh build
sudo apt install gcc make python
kapmino269 said:
I knew steps man I used Ubuntu for 2 years without windows .
thank you .
Click to expand...
Click to collapse
Do you tried make mrproper and make clean before you run build_kernel.sh?
kapmino269 said:
ok
i have questions loop device depend on kernel and if it is .
How to add support?
Click to expand...
Click to collapse
Type "make xconfig" in the kernel directory, and a window will open for configuring the .config file in that same directory.
Search for "Loopback device support" and add a checkmark (not a dot, so that the module is built into the kernel.)
kapmino269 said:
it isn't working .
Click to expand...
Click to collapse
Can you please provide a log or something? It sounds like you are missing dependencies in your operating system for building kernels.
how do you flash the new boot.img with a samsung device?
kapmino269 said:
By twrp
Click to expand...
Click to collapse
Thanks!!
I ended up using https://forum.xda-developers.com/showthread.php?t=2446269 which is pretty easy as well.
I am now stuck on how to enable wifi after flashing a different kernal.
Kernal = samsung opensource
Rom = nouget 7.1.1 (different to opensource kernal)
Any suggestions?
heavy load said:
Thanks!!
I ended up using https://forum.xda-developers.com/showthread.php?t=2446269 which is pretty easy as well.
I am now stuck on how to enable wifi after flashing a different kernal.
Kernal = samsung opensource
Rom = nouget 7.1.1 (different to opensource kernal)
Any suggestions?
Click to expand...
Click to collapse
Install the Magisk module LIBSECURE_STORAGE COMPANION
ashyx said:
Install the Magisk module LIBSECURE_STORAGE COMPANION
Click to expand...
Click to collapse
Thanks Ashyx, I had a play with your kernal on github, nice work there!
I ended up downloading a stock rom matching the samsung opensource kernal build number, worked out of the box.
kapmino269 said:
See that :
@ashyx any help
I NEED TO ADD SOME MODULES.
Click to expand...
Click to collapse
It's telling you the path to the defconfig doesn't exist.
Either the name is wrong or it doesn't exist in the config directory.
kapmino269 said:
This, I solved it yesterday, Thanks .
But I have 2 problems :
1- Device is arm and at bulid_kernel.sh tell me to use toolchain arch64 ,
Which I should Use arm or arm64 ,
I confused as cpu is arm64 .
https://www.qualcomm.com/products/snapdragon/processors/425
Or
Ndk
https://developer.android.com/ndk/downloads/index.html
2- Which command I should write after menuconfig
./build_kernel.sh
Or
make -jX .
Click to expand...
Click to collapse
Just use whichever is in the build script.
You will need to add menuconfig to build_kernel.sh before make or your changes will be lost.
Then run build_kernel.sh
kapmino269 said:
@ashyx ,all is ok .
The error from clang and there is 2 config files .
Fixed and I will test kernel but I have problem when compiling I choose lz4 type ,do U see I should choose another .
Also where is zimage now ,i compiled manually not with build_kernel.sh .
Click to expand...
Click to collapse
You don't need the export arguments which are contradictory anyway, as you have already defined your toolchain and architecture before hand.
Also the boot image does not need to be lz4. The compiler will tell you where the finished zImage is when completed. You should find it in the boot directory of the arm64 directory if you are not using OUT_DIR statements.
kapmino269 said:
Sorry ashyx this is last thing ,
-You told me later that device is arm not arm64 .
In Your twrp thread .
-Also defconfig of device in /arch/arm .
-Arch=arm in build_kernel.sh .
-Gsi system armaonly only work on the device .
-All apps told that device is arm .
I confused ,
Please tell that it is right to use arm64 tool chain .
Or How did U build it ?
By arm64 toolchain or arm toolchain ?
Very Thank U .
Click to expand...
Click to collapse
I was just going by the screen shot you posted. Like I said your commands are contradictory.
You have both arm and arm64 toolchains defined in the same script.
You also have an export statement for arm64 directly under a statement for an arm toolchain.
Not sure why you added both?
As far as I can see the architecture you're compiling for is arm, so you need an arm toolchain.
kapmino269 said:
It contains errors
Click to expand...
Click to collapse
This is the script I use.
You will need to modify the path to your toolchain.
can i use the source code to build kernel for android 10 one ui if the source built for mm

Categories

Resources