Building tun.ko for X10 (vpnc/openvpn)? - XPERIA X10 Android Development

Both VPNC (e.g. get-a-robot-vpnc) and OpenVPN require tun.ko kernel module to work. The module is included in most popular ROMs but obviously not a part of SE kernel which we have to live with now.
Loading a tun.ko compiled for other kernels fails with a following message, for example:
adb shell dmesg
"tun: version magic '2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7' should be '2.6.29-rel preempt mod_unload ARMv7".
I tried to see if I could compile the module myself from the posted SE kernel source and using this post as a reference - forum.xda-developers.com/showpost.php?p=5692491&postcount=12, but I'm lost in git and cross-compile toolchain. I also tried changing "2.6.29-01117-g4bc62c2" to "2.6.29-rel" in the existing module with a hex editor, but that made the module invalid.
So, I wonder if someone could help?
Thanks.

crimper said:
Both VPNC (e.g. get-a-robot-vpnc) and OpenVPN require tun.ko kernel module to work. The module is included in most popular ROMs but obviously not a part of SE kernel which we have to live with now.
Loading a tun.ko compiled for other kernels fails with a following message, for example:
adb shell dmesg
"tun: version magic '2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7' should be '2.6.29-rel preempt mod_unload ARMv7".
I tried to see if I could compile the module myself from the posted SE kernel source and using this post as a reference - forum.xda-developers.com/showpost.php?p=5692491&postcount=12, but I'm lost in git and cross-compile toolchain. I also tried changing "2.6.29-01117-g4bc62c2" to "2.6.29-rel" in the existing module with a hex editor, but that made the module invalid.
So, I wonder if someone could help?
Thanks.
Click to expand...
Click to collapse
you need to recompile the kernel module (luckily kernel sources are available)

Please help
I don't know how to recompile kernel. Can you send this file here into forum? And tell us, inferior people who just want to use openvpn, how to put this file there it should be?
Why every linux/unix issue ends with advice "just recompile kernel" or "RTFM"... I don't know how to recompile it and don't know where is that f...g manual. If you mean google, please don't say that.
Thank you very much

pepouwek said:
I don't know how to recompile kernel. Can you send this file here into forum? And tell us, inferior people who just want to use openvpn, how to put this file there it should be?
Why every linux/unix issue ends with advice "just recompile kernel" or "RTFM"... I don't know how to recompile it and don't know where is that f...g manual. If you mean google, please don't say that.
Thank you very much
Click to expand...
Click to collapse
luckily for you, I made a guide in this board about how to recompile the kernel
Also in this topic about recompiling the kernel and there's infos about openvpn there too (search button will help).
And don't talk about inferior people, I really wish it was very easy to add all those stuffs but unluckily it's not. I can help you even if you're lost about kernel recompiling but I can't do all the stuffs for you.

how about searching instead of opening new thread......
http://forum.xda-developers.com/showpost.php?p=7054292&postcount=17
someone close this useless thread....

pepouwek said:
I don't know how to recompile kernel. Can you send this file here into forum? And tell us, inferior people who just want to use openvpn, how to put this file there it should be?
Why every linux/unix issue ends with advice "just recompile kernel" or "RTFM"... I don't know how to recompile it and don't know where is that f...g manual. If you mean google, please don't say that.
Thank you very much
Click to expand...
Click to collapse
We can't use a different kernel to the stock one yet, and there's no point in recompiling the 2.6.29 kernel again, as the devs are trying to run the 2.6.32 one instead for froyo - tun.ko probably should be compiled with this instead. (in fact, I think froyo is able to be run already)
I think the custom spl/bootloader now needs to be tweaked by goroh_kun, Bin4ry, jerpelea etc. to:
- Be autobooted or flashed safely
- To be stable when run
- To be able to boot to a recovery partition and/or bootloader with a key combination
Also, I think they need to:
-Sort out phone partitioning to be used with the new bootloader and recovery image.
-Then try to fix bugs in the CyanogenMod 6 rom, if there are any 'major' ones.
I think that's what the devs are trying to do.

@hunteron you are not completely right even though you can't boot a complete kernel image you can insert your own modules
Sent from my X10i using XDA App

sim-value said:
@hunteron you are not completely right even though you can't boot a complete kernel image you can insert your own modules
Sent from my X10i using XDA App
Click to expand...
Click to collapse
I'm sorry; you're right.

Mod. edit: reuse existing thread pls; CLOSED

Related

Compile X10/x10 mini kernel

Hello,
I believe a lot of us would like to do it, so let's please describe here how-to:
1. Linux
2. Mac os Leo
3. Windows
Gurus, please contribute!
Excellent initiative, I could write a short howto for Arch Linux later.
But one thing though, it might be a good idea to mention in the first post that you can't actually boot a custom kernel yet.
ddewbofh said:
Excellent initiative, I could write a short howto for Arch Linux later.
But one thing though, it might be a good idea to mention in the first post that you can't actually boot a custom kernel yet.
Click to expand...
Click to collapse
Indeed agree, but to try we need to have it!
My topic about compiling kernel sources has already many infos so do you think another similar topic is really necessary ?
alx5962 said:
My topic about compiling kernel sources has already many infos so do you think another similar topic is really necessary ?
Click to expand...
Click to collapse
Your thread is excellent but I'd guess that this thread would be more oriented towards "hand-holding", really basic guides. Your topic was very broad requiring going to the android developers site and reading their docs on cross-compilation. Gathering that info into easier guides could be beneficial, if not to demystify the process.
As it stands right now just compiling modules seems almost insurmountable. But if the information needed could be condensed into simple guides it could show that while it takes considerable time and effort it's not an impossible task even for developers not familiar with cross-compiling kernels.
And information information on setting up cross-compilers for Win, Mac and popular Linux distros is nice to have available in an easy to find topic anyway.
IMHO, the easiest way to make modules would be a virtualbox image already set up with arm gcc, kernel sources and X10 kernel config. It's a long process to set everything up; virtualbox makes this easier and cross platform.
maxrfon said:
Hello,
I believe a lot of us would like to do it, so let's please describe here how-to:
1. Linux
2. Mac os Leo
3. Windows
Gurus, please contribute!
Click to expand...
Click to collapse
Sources are here :
http://developer.sonyericsson.com/cws/download/1/823/877/1278570405/X10_mini_Donut_100630.tar.gz
Rest can be done in same way as for "big" X10.
alx5962 said:
IMHO, the easiest way to make modules would be a virtualbox image already set up with arm gcc, kernel sources and X10 kernel config. It's a long process to set everything up; virtualbox makes this easier and cross platform.
Click to expand...
Click to collapse
Do you have such virtual box image or whatever it is?
maxrfon said:
Do you have such virtual box image or whatever it is?
Click to expand...
Click to collapse
yep but can't share it as everything is set up in french and I'm sure you'll not like this
anyway, i'm sure the owner of this thread will enjoy to create one.
alx5962 said:
yep but can't share it as everything is set up in french and I'm sure you'll not like this
anyway, i'm sure the owner of this thread will enjoy to create one.
Click to expand...
Click to collapse
Yes, french for me is a bit difficult
Ok i managed to make Ubuntu on my Parallels, just finished with the gcc. Let's see how it works.
Maybe i will share it.
kernel config is included in the /etc folder if I remember well, hope it's the same for the mini X10
It's actually in /proc
zdzihu said:
It's actually in /proc
Click to expand...
Click to collapse
Hi zdzihu,
I managed somehow install arm gcc on my Ubuntu. Now it's time for the tools.
So i would like to ask what config should i use arm v4? V5?
I am so tired with this linux things, but finally at least the demo busybox compiled well
So i tried to compile with arm-v5te config but for flash read (which is normaly working) it says
Code:
# ./dump_image system /sdcard/tt.bin
error reading system: Inappropriate ioctl for device
My task it not to run flash tools available, but my own, to compile all myself, to try to do the trick with the CPU to accept kernel, that i compiled.
Thanks.
The Snapdragon is armv7 compliant, so that should be your target.
ddewbofh said:
The Snapdragon is armv7 compliant, so that should be your target.
Click to expand...
Click to collapse
http://jackytw.blogspot.com/2009/11/howto-run-native-linux-application-on.html
This tut i was using.
I can't find v7 .. Should i consider the V as the CPU ver?
Then its 1136 if i am not wrong?
maxrfon said:
http://jackytw.blogspot.com/2009/11/howto-run-native-linux-application-on.html
This tut i was using.
I can't find v7 .. Should i consider the V as the CPU ver?
Then its 1136 if i am not wrong?
Click to expand...
Click to collapse
Are you using that tool to build the toolchain? In that case it might not have the option to build for that arch. The best way to make sure you get the correct one is to build it manually from scratch.
ddewbofh said:
Are you using that tool to build the toolchain? In that case it might not have the option to build for that arch. The best way to make sure you get the correct one is to build it manually from scratch.
Click to expand...
Click to collapse
Looks like there is no other tut to build the toolchain. I searched days and nights to find something working.
I even compiled bysybox with it and it works on my x10!
But i found some sources of flash backup, called nandtools, compiled them well, no errors but the exec files are 4x bigger than the precompiled ones... And it makes the IOControl error..
the NDK won't compile, it requires Makefile or Android.mk and those are real headache to learn.
The Makefile from the archive is not compatible with NDK's make system and so on...
And so 2 weeks..
Pufff.. I am so tired if just linux things
Any hand?
Hi there, ARM is backward compatibile so compiled for v5 should run just fine. Problem must be somewhere else... I'm at work at the moment so I can't help much
By the way, there was some kind of dedicated flash tool posted already HERE, maybe you could check with jerpelea for re-upload?
zdzihu said:
Hi there, ARM is backward compatibile so compiled for v5 should run just fine. Problem must be somewhere else... I'm at work at the moment so I can't help much
By the way, there was some kind of dedicated flash tool posted already HERE, maybe you could check with jerpelea for re-upload?
Click to expand...
Click to collapse
You see, i need to compile mine, i have enough tools here already working, but my task is to compile my own and that's why i need a toolchain.
NDK is ok for the kernel, i compiled it already. But the native applications are not supported fully. Like write is deprecated and you can't use this function, and lot other limitations. So independent toolchain would help.
That's the point.
maxrfon said:
So independent toolchain would help.
Click to expand...
Click to collapse
PM sent =)

Samba/CIFS for Motorola defy froyo

I just finished building a cifs.ko module for my motorola defy from source.
As the module has some dependencies to slow-work.ko you will need to load this prior to cifs.ko.
I finished testing it on my Motorola Defy Stock Froyo ROM (Linux version 2.6.32.9-ga28fcc4) and it worked fine. I was able to listen to music from my pc via a network share.
have fun.
tuxx
p.s. i will merge slow-work and cifs into a single module in order to be compatible with single module loading programs such as cifsmanager.
Hi,
cant wait for the merge
How about adding the nls_utf8.ko ?
nls_utf8.ko
i havent had time yet to merge cifs and slow-worker however i took a minute to build nls_utf8.ko...
i haven't tested it so please let me know if it works.. and if not i'll try to fix it (dont forget to post dmesg log)
tuxx
Thanks but... cifs.ko was already working on defy. In THIS thread its asked, and HERE said how make it work.
I did a cwm3+ flasheable zip for my own use, which I am attaching here, which I had working in CM7 until they were included.
To avoid problems with utf8 characters, in cifsManager settings, load via insmod and use path:
"/system/lib/modules/slow-work.ko:/system/lib/modules/nls_utf8.ko:/system/lib/modules/cifs.ko"
Do you really need to work to merge the files? Isn't it enough?
Perilla_ said:
Thanks but... cifs.ko was already working on defy. In THIS thread its asked, and HERE said how make it work.
I did a cwm3+ flasheable zip for my own use, which I am attaching here, which I had working in CM7 until they were included.
To avoid problems with utf8 characters, in cifsManager settings, load via insmod and use path:
"/system/lib/modules/slow-work.ko:/system/lib/modules/nls_utf8.ko:/system/lib/modules/cifs.ko"
Do you really need to work to merge the files? Isn't it enough?
Click to expand...
Click to collapse
thanks for the tip.
however I dont know how the cifs.ko of the other thread was compiled.. the thread you pasted says that a hex editor was used to change the kernel version string in the binary!?! That doesn't sound like a very nice solution. Also.. i had to port a few functions such as round_jiffie() which i saw in other build instructions was simply commented out due to laziness.. I prefer a clean build in which round_jiffie() is implemented (as i presume this is for latencies and will probably play a role for battery life etc.).
However I was unaware that you can ':' separate modules with cifsmanager. Thanks for that tip.
tuxx
p.s. if anyone is interested, i just built GNU screen for android.
Well... no, the cifs I uploaded in the zip, are from the thread that the solution said (this solution), which are from the milestone 2. HERE are the cifs for milestone 2 thread, they works with defy.
tuxx42 said:
i havent had time yet to merge cifs and slow-worker however i took a minute to build nls_utf8.ko...
i haven't tested it so please let me know if it works.. and if not i'll try to fix it (dont forget to post dmesg log)
tuxx
Click to expand...
Click to collapse
Hi,
going to test it this evening on a stock 2.6.32.9-ga28fcc4. I ll try to use the "multi:module" functionality of CIFSManager.
Perilla_ said:
Thanks but... cifs.ko was already working on defy. In THIS thread its asked, and HERE said how make it work.
Click to expand...
Click to collapse
Hi,
i thought this module was for the .29 kernel and is broken for stock 2.2.2 ?
Thats why i never bothered to try...
I used those cifs from eclair to CM7 ginger!

Decompile Kernel

Hey does anybody have a TUT in how to decompile an existing kernel so i can make some changes and then recompile it?
Sent from my GT-I9001 using XDA
Hey did you ever get your answer? I am also looking to do the same thanks.
EternalFame said:
Hey does anybody have a TUT in how to decompile an existing kernel so i can make some changes and then recompile it?
Click to expand...
Click to collapse
This is not the way it's done.
You'll have to get your kernels configuration. This is done either by see if there's a /proc/config.gz using the running kernel, or using the extract-ikconfig script shipped with the kernel source to extract the configuration from the kernel file.
Code:
$ extract-ikconfig kernel.img-kernel
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.9
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_TIME=y
[...]
This configuration you supply to the kernel source. If the vendor got some specific patches (they do), you'll have to get the kernel source from them, patches included. They must supply you the source, or be in violation of the GNU General Public License.
Building the Android boot image using mkbootimg, you'll also have to get the base address from this config.
Code:
$ extract-ikconfig kernel.img-kernel | grep PHYS_OFFSET
CONFIG_PHYS_OFFSET=[B]0x00200000[/B]
Now you have everything you'll need to build a correctly configured kernel and making the Android boot image. Detailed build instructions are included in the kernel source as well.
Wow thank you
Sent from my SGH-T989 using xda premium
Can we extract kernel with dsixda kitchen?
Edward Cullen
Kernel can be extracted, rename to *.zip
purrungo said:
Kernel can be extracted, rename to *.zip
Click to expand...
Click to collapse
it kernel.lz or etc format when use extractor it say corrupted archive
why manufacturers have to provide kernel to users when they don't want users to modify their products?. Many manufacturers just sell devices, and strangely there are many dev.er who CaN overclock or patch, modify the kernel with boot.img, HOW did they do thAt??? Kernel source code sometimes is their devevloper source code, not from manufacture stock source code.
i want to de and recompile kernel file for WSA
(windows subsystem for android)
any help?
foxhackerr said:
Any help?
Click to expand...
Click to collapse
Depending on what/how much you want to modify it can be easier to patch an existing kernel than to build from scratch. Me? I'm lazy. I never build anything.
Get boot image
Extract kernel
Decompress kernel
Extract kallsyms
Disassemble kernel
Come up with a patch and patch it
Put it back together
(Steps 4 & 5 may be combined depending on your tools. I do them separately.)
Renate said:
Depending on what/how much you want to modify it can be easier to patch an existing kernel than to build from scratch. Me? I'm lazy. I never build anything.
Get boot image
Extract kernel
Decompress kernel
Extract kallsyms
Disassemble kernel
Come up with a patch and patch it
Put it back together
(Steps 4 & 5 may be combined depending on your tools. I do them separately.)
Click to expand...
Click to collapse
How to do this??
kxrma said:
How to do this??
Click to expand...
Click to collapse
Use dd if rooted or EDL or extract from update
I use my imgutil.exe
I use my imgutil.exe
I use my kallsyms.exe or cat /proc/kallsyms on a running system
I use the stock objdump processed afterward with my own findref.exe (not really released yet). You could use Ghidra.
Use any hex editor. I also use my own kpatch.exe (not really released yet).
I use my imgutil.exe

[Kernel][5.1.1][P605] Stock SELinux Permissive kernel (OI5)

Based on the first 5.1.1 sources, version OI5
Modifications:
SELinux unlocked
Disabled protection does not allow to boot the OS(disabled at the level of Linux kernel)
Permissive mode is set automatically at boot (without the possibility to switch back to enforce)
Before(you can do it after flash,but recommended before) installing the kernel required go to build.prop,find ro.securestorage.support and set the value to false. System may forget your WiFi passwords after flash custom kernel.
SecurityLogAgent has to be removed or frozen.
Flash kernel in odin.
v2 - SELinux fix.
Download: Google Drive
Sources: Google Drive
Blue cat said:
Based on the first 5.1.1 sources, version OI5
Modifications:
SELinux unlocked
Disabled protection does not allow to boot the OS(disabled at the level of Linux kernel)
Permissive mode is set automatically at boot (without the possibility to switch back to enforce)
Before installing the kernel required go to build.prop,find ro.securestorage.support and set the value to false. System may forget your WiFi passwords after flash custom kernel.
Flash kernel in odin.
This is my first kernel which I create on Linux. I hope everything will be working stable.
Download: Google Drive
Click to expand...
Click to collapse
Thank you - I flashed it as per your instructions. Seems to have worked fine and it's showing it as running as permissive!
Hi,
I made mine for my rom, but yours is good too.
Thank you for the comunity
Re...
Oops problems !! security notification
Alan-B said:
Hi,
I made mine for my rom, but yours is good too.
Thank you for the comunity
Re...
Oops problems !! security notification
Click to expand...
Click to collapse
I think you should remove ALL knox apk,because i never not seen security notifications on my device.
This kernel have only 2 changes.
security/selinux/Makefile and security/selinux/selinuxfs.c
Blue cat said:
I think you should remove ALL knox apk,because i never not seen security notifications on my device.
This kernel have only 2 changes.
security/selinux/Makefile and security/selinux/selinuxfs.c
Click to expand...
Click to collapse
Hi,
With my boot.img I have no this message! It is when I made out a will your that and come this message!
NB:
Your Boot and all the eliminated knoks!! (Rom deodex 5.1.1)
Alan-B said:
Your Boot and all the eliminated knoks!! (Rom deodex 5.1.1)
Click to expand...
Click to collapse
Ok,I found a solution.
You need to remove SecurityLogAgent
Bluecat, thanks for this! I wonder if you know what differences exist between the P605 and the P607T. Also, did you use the EUR_LL source from Samsung's opensource portal? Its strange that they already have the source out for the P605, but nothing yet for the P607T which received the update first. Makes me think maybe the code base is the same and its only the bloatware bundled by the carrier that differs?
I am also curious to just learn and get my hands dirty with this. Can you share the Makefile for this kernel, or just point towards the guide you used (assuming you used one) to compile this?
karthikrr said:
Bluecat, thanks for this! I wonder if you know what differences exist between the P605 and the P607T. Also, did you use the EUR_LL source from Samsung's opensource portal? Its strange that they already have the source out for the P605, but nothing yet for the P607T which received the update first. Makes me think maybe the code base is the same and its only the bloatware bundled by the carrier that differs?
I am also curious to just learn and get my hands dirty with this. Can you share the Makefile for this kernel, or just point towards the guide you used (assuming you used one) to compile this?
Click to expand...
Click to collapse
Sorry,but i dont know differences between the P605 and P607T.
Yes,sources SM-P605_EUR_LL_Opensource.zip and version OI5.
If you want check have code 607 and 605 differences or not you should check checksum both original zImage(linux kernel). Extract them from both boot.img and compare.
Version 2 use standart selinux permissive way used by mostly kernel developers,it's have many changes in code now and it's will be very long to explain how to change to permissive,just use my sources available now in first post and compare them with original sources.
If you talk about how to compile kernel...was use many guides and other forums...hard part was only create .config file
Blue cat said:
Sorry,but i dont know differences between the P605 and P607T.
Yes,sources SM-P605_EUR_LL_Opensource.zip and version OI5.
If you want check have code 607 and 605 differences or not you should check checksum both original zImage(linux kernel). Extract them from both boot.img and compare.
Version 2 use standart selinux permissive way used by mostly kernel developers,it's have many changes in code now and it's will be very long to explain how to change to permissive,just use my sources available now in first post and compare them with original sources.
If you talk about how to compile kernel...was use many guides and other forums...hard part was only create .config file
Click to expand...
Click to collapse
Will try to extract the zImage from the P607T boot.img. I do not have the P605 though, do you know if the stock boot.img is downloadable anywhere?
Thanks for uploading the source. I just finished downloading the original source from the opensource site, will compare the two and try to understand.
I do know how to complile a linux kernel, I meant can you share the .config file (not the makefile, as I wrongly stated earlier), so I can see what has changed across the entire kernel. Rather than just change one line directly in the config file to disable SELinux, I wanted to use make menuconfig and go through the whole process, just to learn more about android kernels. But since I do not know much about the hardware and driver requirements, wanted to see a stock .config as well as your changed .config to understand.
karthikrr said:
Will try to extract the zImage from the P607T boot.img. I do not have the P605 though, do you know if the stock boot.img is downloadable anywhere?
Thanks for uploading the source. I just finished downloading the original source from the opensource site, will compare the two and try to understand.
I do know how to complile a linux kernel, I meant can you share the .config file (not the makefile, as I wrongly stated earlier), so I can see what has changed across the entire kernel. Rather than just change one line directly in the config file to disable SELinux, I wanted to use make menuconfig and go through the whole process, just to learn more about android kernels. But since I do not know much about the hardware and driver requirements, wanted to see a stock .config as well as your changed .config to understand.
Click to expand...
Click to collapse
My config https://drive.google.com/file/d/0BxQroXyaGzZOSmdieTNVaFY3VjA/view?usp=sharing
Boot https://drive.google.com/file/d/0BxQroXyaGzZOVFZGZGs3YmloX2s/view?usp=sharing
I dont have original config,you can create your own on linux.
Blue cat said:
My config https://drive.google.com/file/d/0BxQroXyaGzZOSmdieTNVaFY3VjA/view?usp=sharing
Boot https://drive.google.com/file/d/0BxQroXyaGzZOVFZGZGs3YmloX2s/view?usp=sharing
I dont have original config,you can create your own on linux.
Click to expand...
Click to collapse
Brilliant! Thanks for sharing ... As and when I learn anything relevant to the issue of P605 vs. P607T, will update here.
Why does the wifi password get forgotten on every boot?
Any fix for that matter?
valexi said:
Why does the wifi password get forgotten on every boot?
Any fix for that matter?
Click to expand...
Click to collapse
Blue cat said:
Based on the first 5.1.1 sources, version OI5
Before installing the kernel required go to build.prop,find ro.securestorage.support and set the value to false. System may forget your WiFi passwords after flash custom kernel.
SecurityLogAgent has to be removed or frozen.
Flash kernel in odin.
Click to expand...
Click to collapse
Maybe you missed the update to the original post, the fix is as above, set securestorage to false. Since you have already flashed, you can still go to build.prop, make this change, reboot, and you should be fine.
karthikrr said:
Maybe you missed the update to the original post, the fix is as above, set securestorage to false. Since you have already flashed, you can still go to build.prop, make this change, reboot, and you should be fine.
Click to expand...
Click to collapse
I tried this. With ro.securestorage.support false. Still no WiFi passwords saved after reboot.
Other than that, this works great!
Xposed (for Samsung by wanam) works great!
valexi, the only thing Ive seen suggested in your case is to reflash the firmware. I do not know of any other solutions for this, because pretty much everybody with this problem seems to have solved it when they changed the securestorage thing.
BlueCat, I went ahead and compared checksums for the stock p607t and p605 kernels, they do NOT match. I also extracted the kernels themselves and the zimage files are of different sizes. I then compared the default config files of the P605_LL_EUR source with the only available source for the P607T, which is KK ... They are considerably different. I am of course going with the assumption that the core config for the kernel between KK and LL should not be TOO different, but of course, this is NOT a reliable test. Lastly, I should also say, the P607T source contained an insane number of config files in the Arch/Arm/configs folder, while the P605 source only had three files! I only compared the three that were common ... It seemed like the 607T has the config files for every possible version of the device, while the 605 one had very specific configs for that device only ... This I am speculating based on the fact that the 607T folder even had a msm8894_sec_l03ltmo_defconfig file in addition to the msm8894_sec_l03leur_defconfig file in the 605.
Will do more comparisons over the next few days, but it does seem like there are more changes under the hood between the 605 and the 607T than one would expect. I really wish samsung would release the source for the 607t, but if you check that page, there is just one single KK code there and nothing else, so it does not seem likely anytime soon
Blue cat said:
Ok,I found a solution.
You need to remove SecurityLogAgent
Click to expand...
Click to collapse
Re,
Ok remove SecurityLogAgent and folder Container it is ok...
But delete all other knox and Klm gives a problem with the playstor. (Certain protections cannot be erased)
Hey guys,
Great news around, especially with roms like Alan-B's. Thanks for sharing :good:.
Running 4.4, planning to update 5.x as soon as I'm sure I can run Linux Deploy (meaning the need of permissive kernel), though I can't find any intel about VTS (Virtual Terminal Support) enabled kernel. I've been looking for months a way to run framebuffered distros and looks like this is the solution.
I could try to make it myself but I have no experience in kernels, would someone mind give me a hand to get to this goal? At least give me a hint to "quickly" develop and try one, to see if it works and how well...
Don't even know if I'm looking the right way anymore, so thanks by advance for any help and again for the sharing :highfive:.
karthikrr said:
valexi, the only thing Ive seen suggested in your case is to reflash the firmware. I do not know of any other solutions for this, because pretty much everybody with this problem seems to have solved it when they changed the securestorage thing.
Click to expand...
Click to collapse
But when I reflash the firmware how can I set securestorage BEFORE installing permissive kernel as I don't have root to change build.prop?
valexi said:
But when I reflash the firmware how can I set securestorage BEFORE installing permissive kernel as I don't have root to change build.prop?
Click to expand...
Click to collapse
You can't. Reflash, root, edit build.prop, reboot, set wifi password once again, reboot, it SHOULD be fine. If its not after this sequence, Im not sure what else may work. Every case of this particular problem that I've seen was resolved with this solution.
Luckily I didn't reflash yet. I checked again build.prop and securestorage was true. For some reason it didn't stick first time.
I edited it again and now WiFi works as intended. So I can say that this solution works. Great kernel.
Sent from my ONE A2003 using Tapatalk

Xiaomi kernel reverse-engineering?

Hello guys. Found this guide for kernel reverse-engineering via IDA pro. I have done several steps, but can`t separate the image itself from the extractor in the zImage file. Should i even continue, or the idea is useless? Is it`s useful, you can download and try to unpack the zimage by yourself, and i also have the symbols for a script.
[email protected] said:
Hello guys. Found this guide for kernel reverse-engineering via IDA pro. I have done several steps, but can`t separate the image itself from the extractor in the zImage file. Should i even continue, or the idea is useless? Is it`s useful, you can download and try to unpack the zimage by yourself, and i also have the symbols for a script.
Click to expand...
Click to collapse
I saw your post about this in another thread, and I did not want to discourage you, so I kept quiet. But, since you now ask directly, I will advise you to not waste your time. Even with full source code, kernel hacking is not for the faint-hearted, and is far from a trivial exercise. With no source code (or with incomplete source code), you might as well want to try getting hedgehogs to fly to Mars ...
Hi there! First, I'm no dev (got some experience about building Roms/Kernel from source) so sorry if I ask noobish things .
I got the same problem with the mi4s zimage (want to reverse engineer because official kernel sources are incomplete..) couldn't I just extract everything out of boot partition and create the source-code out of that? or what's the Problem by doing this? If the extracted source code (for whatever reason) is incomplete, wouldn't it be possible to get the missing things from official source released by xiaomi?
Thanks in advance
wertus33333 said:
...couldn't I just extract everything out of boot partition and create the source-code out of that? or what's the Problem by doing this? If the extracted source code (for whatever reason) is incomplete, wouldn't it be possible to get the missing things from official source released by xiaomi?
Click to expand...
Click to collapse
You want to extract compilable linux kernel source code from a compiled kernel? Sorry to disappoint you - but human beings will learn to climb a rope from Europe to the moon before you could achieve it. You might be able to disassemble the kernel, but you would not get anything near something compilable.
Hint: if it could readily be done, do you not think someone in these and other forums would have done it already?
DarthJabba9 said:
You want to extract compilable linux kernel source code from a compiled kernel? Sorry to disappoint you - but human beings will learn to climb a rope from Europe to the moon before you could achieve it. You might be able to disassemble the kernel, but you would not get anything near something compilable.
Hint: if it could readily be done, do you not think someone in these and other forums would have done it already?
Click to expand...
Click to collapse
There are lots of people who already did this! (see xiaomi forums redmi 3s, mi pad, Samsung galaxy s3, i9000/9001 etc. etc.). And those kernel are indeed working (even better than the ones from source) (yes, I tried it).
U ask why no one already did this? maybe because Mi4s community is very small (not even our own section..) and its quite a new device.
So why is it possible with other phones but not with mi4s?
Ty for help and explanation
Btw, can u explain it technically? not like "humans will learn to breathe in space before"....
wertus33333 said:
There are lots of people who already did this! (see xiaomi forums redmi 3s, mi pad, Samsung galaxy s3, i9000/9001 etc. etc.). And those kernel are indeed working (even better than the ones from source) (yes, I tried it).
Click to expand...
Click to collapse
If you mean that somebody patched a binary kernel, yes, that can be done, and I have done it myself. If you mean that somebody disassembled a binary kernel into compilable source code, I very much doubt that. If you claim that others have done it, why not post a link to the source code that they extracted, so that we too can try our hands at compiling it?
wertus33333 said:
U ask why no one already did this? maybe because Mi4s community is very small (not even our own section..) and its quite a new device.
So why is it possible with other phones but not with mi4s?
Click to expand...
Click to collapse
I am totally unconvinced about the claim that "it is possible with other phones". Please show the evidence.
wertus33333 said:
Ty for help and explanation
Btw, can u explain it technically? not like "humans will learn to breathe in space before"....
Click to expand...
Click to collapse
A simple example - http://blog.packagecloud.io/eng/201...-and-disassmble-a-linux-kernel-image-vmlinuz/
Scroll to the bottom of the page and see what you will get for your efforts. Try compiling that. Better still, try editing it to add missing things or fix/remove broken things, and then compiling it. Finally, you are talking about 15 million lines of source code. Good luck.
for example here: http://en.miui.com/thread-125557-1-1.html
http://forum.xda-developers.com/android/software-hacking/how-to-reverse-engineer-kernel-t3137384
Maybe we're talking about different matters, I just want to implement UV and OC in the original xiaomi kernel to use it with smiui... As you seem to know a lot about linux kernels, how can this be done?
Greetz
wertus33333 said:
for example here: http://en.miui.com/thread-125557-1-1.html
http://forum.xda-developers.com/android/software-hacking/how-to-reverse-engineer-kernel-t3137384
Click to expand...
Click to collapse
These are the bases of your claim that it can be done? I cannot see anywhere in those two threads where anybody was able to do anything useful with what was being proposed.
wertus33333 said:
Maybe we're talking about different matters, I just want to implement UV and OC in the original xiaomi kernel to use it with smiui... As you seem to know a lot about linux kernels, how can this be done?
Click to expand...
Click to collapse
I know how to compile linux kernels when the full source code exists. I also know how to patch such sources to edit/add/remove specific things. I also know how to patch an uncompressed binary kernel if I know exactly which offset(s) to patch and which values to substitute for what is already there. I have done this for 32-bit RK3188 android kernels in my old tablets (search the ARCTABLET forums and you might see some of my historic work on overclocking RK3188 binary kernels). This was easier for RK kernels than for MTK, and much can go wrong. If all is that is needed for what you want to do is to change specific values at specific offsets, then all you need is a hex editor and the necessary information about offsets/values. If you are trying to add a new feature, then you need the full source code from the vendor.
Get yourself a backup phone before trying anything of the sort. Like I said before, I wish you good luck!
Thank you for that information. Wouldn't it be possible to edit the things in zimage (unpacked) and then just re-pack it and use it? There shouldn't be anything missing if I'm able to find the correct offset for the lzo compressor...
wertus33333 said:
Thank you for that information. Wouldn't it be possible to edit the things in zimage (unpacked) and then just re-pack it and use it?
Click to expand...
Click to collapse
It is a binary file, which of course you can edit with a hex editor. But what exactly are you proposing to edit in it?
Isn't it an image containing files from Kernel? Otherwise they wouldn't talk about extracting it... Yes, I need to edit it with a hex-editor to remove the lzo header (zimage is a self extracting archive, but i want to extract it with normal zip extractor) but cant find where the header starts.
wertus33333 said:
Isn't it an image containing files from Kernel? Otherwise they wouldn't talk about extracting it... Yes, I need to edit it with a hex-editor to remove the lzo header (zimage is a self extracting archive, but i want to extract it with normal zip extractor) but cant find where the header starts.
Click to expand...
Click to collapse
Your questions show a misunderstanding of what a kernel is. The best I can do is to refer you to Android kernel development information - see e.g.,
http://www.99droid.com/android-kernel-development-tutorial-let-the-development-begin/
http://source.android.com/source/index.html
http://source.android.com/source/building-kernels.html
At this point, I bow out of this discussion.

Categories

Resources