I9300 Kexec-Hardboot - Galaxy S III Android Development

Hello! So I've been trying to Kexec-Hardboot another custom kernel. I'm using Agni Kernel which has Kexec-Hardboot implemented. I patched the guest kernel to copy atags to be able to make it a guest kernel. Everytime I try to execute the guest kernel, the phone turns off for about 30 seconds and then boots to the ptevious kernel.
kexec --load-hardboot zImage --initrd=ramdisk --mem-min=0x44000000 --command-line=" androidboot.selinux=permissive buildvariant=userdebug"
kexec -e
Tried different --mem-min values but still the same. Tried cat'ing /proc/cmdline for --command-line. I even Tried recompiling Agni and enabling ram_console and copy atags. Still the same. If anyone could please help me here. Thanks
EDIT: Managed to implement kexec on TWRP but still the same. last_kmsg shows no trace of kexec

Post it in Q&A section not here

Sorry I didn't know there was a discussion section for this. I can't move this thread.

Related

tun.ko for NEXUS ONE available?

as I am behind the GFW of CN I am eager to get openvpn to work (trying with TunnelDroid, with vpn binaries of WITOPIA...
unfortunately i can't get the connection to work, and apparently it is because of the lacking tun.ko
I took the only tun.ko I can find online (vpn connnections, for DROID...), but apparently the current Nexus One kernel does not support.
Does anybody have a tun.ko file that works on Nexus One?
thanks....
I have the exact same problem.......I need a tun.ko to start using witopia to get through the stupid ISP block on google Voice !!
So if anyone has any working tun.ko PLEASE PLEASE help us out !!
I got it !!
Finally......I managed to extract the tun.ko from Modaco's latest build, so credit goes to Modaco for this, I just extracted it for those who like to stick to Stock Roms (like myself for now).
I tested it and it works
How do you guys like openvpn on android? is it pretty stable? Has anyone tried using Access Server?
Are you sure you're running the stock OS?
I am still getting those messages:
insmod: init_module 'tun.ko' failed (Exec format error)
and in dmesg:
tun: version magic '2.6.29.6-cm-teknologist-0.1 preempt mod_unload ARMv7 ' should be '2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7 '
@chirayu : Well, I dont like it so much right since it still needs ALOT of work. Its lacking ALOT of things right now.
@sjakub : Yep, im running the latest ERE36 update. But yea its a stock image.
I didnt see any of the errors you mentioned. I got differnet errors while I was trying it with Witopia, which didnt really work out, but it doesnt seem like a tun driver issue, it was something about an encryption key not available, still working on that.
I have ERE27, that could be why. Where did you get that update from?
Can you get some other module from that phone (like bcm4329.ko) and look for 'vermagic' string inside?
Also, how did you extract tun.ko from that build? Maybe it's possible to extract one from the ERE27-based build?
sjakub said:
Also, how did you extract tun.ko from that build? Maybe it's possible to extract one from the ERE27-based build?
Click to expand...
Click to collapse
Well, the tun.ko is tested and works fine on ERE27 and ERE36 updates so that shouldnt be the problem.
As for the other files, like bcm4329.ko . Why would you need that ? It should be there by default ? as far as i know that module is responsible for certain wireless activities, I do have that file with me if you need it.
As to how i extracted, its simple.....I made a NAND backup of my stock image then flashed Modaco's latest update including the tecknologist kernel which supported tunneling and therefore included the tun.ko. Copied the file to the sdcard, then restored the backup and copied the files to /system/lib/modules
I don't NEED that module.
I would like to know what is the value of "vermagic" inside.
This is the string that describes the version of the kernel used.
Now, if it's something like '2.6.29-01117-g4bc62c2' and the one in the tun.ko you posted is '2.6.29.6-cm-teknologist-0.1' it means that you're somehow able to load module that has a different vermagic than a kernel. If the vermagic in bcm4329.ko is '2.6.29.6-cm-teknologist-0.1' it means that you have a different version of the kernel (and not the stock one). I have no idea why it would be working with ERE27 in that case, unless it was modified ERE27, not the stock one. Or, you were able to load an incompatible module somehow. In that case I would start investigating how to do that with my kernel as well
Hm, or you could check you phone's info:
Could you, on your phone, go to "Settings->About phone" and check what it says under "Kernel version"?
Thanks!
Finaly! I figured out how to build tun.ko module for the stock kernel.
If anybody wants to repeat that:
* I have Android OpenSource installed in /opt/android
* In /opt/android I did: git clone git://android.git.kernel.org/kernel/msm.git kernel-nexus
* In kernel-nexus I did:
- git checkout -b origin/android-msm-2.6.29-nexusone
- git checkout HEAD^
(The last operation reverses one revision, I needed a previous revision from the tree. Different revisions generate modules with different vermagic values)
(Actually, instead of previous two this should work as well - it should checkout the correct revision: git checkout 4bc62c230b2942bea72c3b5258e3e4f1d6cb534b )
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- distclean
- adb pull /proc/config.gz
- gunzip config.gz
- mv config .config
- Edited .config: changed "# CONFIG_TUN is not set" to: "CONFIG_TUN=m"
- make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
- The driver ends up in: drivers/net/tun.ko
- You can verify if it is going to match the kernel by running:
+ strings drivers/net/tun.ko | grep 2.6.29
+ It should produce "vermagic=2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7"
+ The "2.6.29-01117-g4bc62c2" should be the same as the "Kernel version" in "Settings->About phone" on your phone.
* Now you can upload the module to your phone. I did:
- adb shell mount -o remount,rw /dev/block/mtdblock3 /system
- adb push drivers/net/tun.ko /system/lib/modules/
- adb shell mount -o remount,ro /dev/block/mtdblock3 /system
- And you can use adb shell, enter /system/lib/modules and run: insmod tun.ko
- It should work
The module is attached.
hey Sjakub..
I have tried using your module and I got the same thing like with the one i extracted from Modaco's mod. The tunnel droid gets stuck at "Connecting" any ideas?
Thanks again for all your work mate appreciate it !
Cyanogen Roms have built-in openvpn support. I don't have any problem using Tunneldroid on CM 5.0.4.1. I got the tun.ko error only when I was on the stock ROM. I'm also behind the GFW. Witopia does the trick for me.
thank you sjakub~i used to use your tun.ko working very well with tunneldroid.but after i update the kernel that supports tethering.the tun.ko doesn't work... the new kernel version is:2.6.29-gad36b87-dirty...
The tun.ko module has to be compatible with the kernel you have. Where did you get the kernel from? You need to find a source of exactly that kernel version and compile tun.ko yourself.
sjakub said:
The tun.ko module has to be compatible with the kernel you have. Where did you get the kernel from? You need to find a source of exactly that kernel version and compile tun.ko yourself.
Click to expand...
Click to collapse
i download the kernel for my nexus one from here ——code.google.com/p/android-wifi-tether/
and i follow the steps in the site to flash my rom :code.google.com/p/android-wifi-tether/wiki/NexusOneKernelUpdate
finally...i'm not able to use the previous workable tun.ko which you built...and i'm afraid that i was too amateur to complie tun.ko myself even though you have already list out the compiling steps...
Try asking authors of the wifi-tether for that module. That's probably the easiest way
sjakub said:
Try asking authors of the wifi-tether for that module. That's probably the easiest way
Click to expand...
Click to collapse
okay~i manage to browse that source in google code,though,i can't found tun.ko module.or maybe i will flash cyanogen rom which consist of all the necessary things
anyone brewing a tun.ko for nexus one froyo stock kernel. I don't see aosp code to build right now.

why hasnt anyone compiled modules for new ics kernel.

This is the edit to make modules work in the new kernel you must make the edit in the config.gz, tgen recompile the kernel with the new config
ACTIVATING MODULE LOADING SUPPORT IN THE KERNEL
Module loading support is previously disabled in the kernel, if we want to load modules in the kernel we have to enable it:
edit .config file and set: CONFIG_MODULES=y
We have the new ics, but no overclock or webtop without dock, and some other issues that tge older roms have. And its not because the new leaksare locked. Someone is just lazy or ignorant. So here it goes
You will need alot of free space 100GB or more of free space NO JOKE.
First go here: http://source.android.com/source/initializing.html
You may want androids kernel or cyanogens
androids kernel: http://android.git.kernel.org/
$git clone git://android.git.kernel.org/kernel/common
We check which branch we have downloaded: $git branch it shows * android-2.6.27, not the one we are searching for:
To list all remote available branches: $git branch -r
This is only refernce the kernel number for the bionic is up to 3.0 so when you git branch-r choose one for the bionic
$git checkout --track -b android-goldfish-2.6.29 origin/android-goldfish-2.6.29 $git branch
Cyanogens Follow all steps and restart computer then go here: http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
After you have installed everything you are ready to create a complete distro from scratch.
Now go to adb and pull your working config.
adb pull /proc/config.gz
$gunzip config.gz # uncompressit. $cp config .config # renameitinto.config
Now you can edit .config file the way it suits you the most.
But really all we want is the modules for overclock and symsearch to be compiled for our new kernel
CROSS_COMPILE environment variable stores the path to the arm cross compiling toolchain. I use the one which comes with android source code.
$ARCH=arm CROSS_COMPILE=/path/to/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
Executing make will build the kernel.
Last lines will show:
Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/zImage is ready
So we have obtained Image and zImage kernel binary files.
ACTIVATING MODULE LOADING SUPPORT IN THE KERNEL
Module loading support is previously disabled in the kernel, if we want to load modules in the kernel we have to enable it:
edit .config file and set: CONFIG_MODULES=y
$ ARCH=arm CROSS_COMPILE=/path/to/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
I am asked about some options when executing make. I ask yes for module related options.
After compiling I see several modules have been built.
MODPOST 6 modules CC drivers/video/fb_sys_fops.mod.o LD [M] drivers/video/fb_sys_fops.ko CC drivers/video/syscopyarea.mod.o LD [M] drivers/video/syscopyarea.ko CC drivers/video/sysfillrect.mod.o LD [M] drivers/video/sysfillrect.ko CC drivers/video/sysimgblt.mod.o L drivers/video/sysimgblt.ko CC drivers/video/vfb.mod.o LD [M] drivers/video/vfb.ko
Ok so now we have a kernel that supports modules, but we still need the overclock.so or opptimizer.so compiled for this kernel. This is wete I stop because I dont have any of those modules and this was merely for information really. To get someone to compile our kernel for modular support.
I'm not even sure how Motorola phone devs even get the option to recompile the kernels seeing as how the locked bootloader doesn't let us modify the stock kernel in any way.
If/when we get Kexec, I could see this being an option, however.
It is easy to compile the kernel and edit it and even put it to the motorola droid.
There is actualy 2 ways not just 1.
1. first use follow steps compile kernel and apply it to a boot.img using an android-kitchen.( google android-kitchen) Once you allpy it to a boot.img we can flash in recovery or use an rsd lite and flash using the .xml just replace the boot.img with the modified kernel boot.img. The boot.img for the .875 is 8.3 megs as is the .902 boot.img.
2. use any kernel updater from kuash in recovery wich will replace the current zImage with the new kernel compiled in the steps you just followed.(google android any kernel updater)
So Like I said why hasnt anyone compiled a new kernel.
The Motorola Droid has an unlocked bootloader. The Droid Bionic does not. That is why kernel development barely ever happens on Moto devices.
Feel free to try to flash unsigned images to your Bionic. Let us know how that goes.

mainline linux kernel

I found out that recent versions of the mainline linux kernel can boot on our motorola razr-i without any additional patches. Most of the hardware doesn't work. Only usb and emmc drivers are working. Maybe I or someone else can try if I get some more hardware working. To this post, I attached the kernel config file I used in my builds and the initramfs init script which I used for debugging. So if somebody wants to see the 4.18 kernel running he can use this files.

Any way of hiding root or installing Magisk?

So I'm running the latest version of Evervolv Android Pie and I'm trying to hide root for apps that can detect it. At first I looked into Magisk as that has it built in, but upon reading, as well as trying it myself, it doesn't want to install. Is there a way to install it that I'm not aware of or is it just not possible? I've also looked into suhide, however I cannot get that to work either. Any info and help would be greatly appreciated, and I can provide any info that's needed. Thanks
Magisk does not work on the Hp Touchpad, it needs to modified the RAMDISK to have access to the Kernel and patch it.
This could be better, I do not know if it could be merge into the current Kernel.
https://www.xda-developers.com/kernel-assisted-superuser-kernelsu/
https://forum.xda-developers.com/android/software/root-backdoor-android-kernel-development-t3870559
Thanks for the reply, and appreciate the help. How would I go about merging it with the kernel? I know you said you didn't know if it could, but I'd want to try to see? Also, is there anyway of installing SuperSU in systemless mode so su-hide would work?
Camry2731 said:
Thanks for the reply, and appreciate the help. How would I go about merging it with the kernel? I know you said you didn't know if it could, but I'd want to try to see? Also, is there anyway of installing SuperSU in systemless mode so su-hide would work?
Click to expand...
Click to collapse
You are welcome,
The developers will have to merge the kernel Assisted SuperUSer ( kernelSU ) into the kernel branch of the Android ROM. Then it will need to be recompile, I provided a guide on how to recompile the HP Touchpad kernel:
Click HERE for the Guide
About Systemless: The boot image ( Ramdisk and Kernel ) is read only and it gets loaded into memory each time. There is no program that will be able to modified the boot image for the HP Touchpad, but the RAMDISK can be modified manually, here is a guide on how to do it:
Click HERE for the Guide to unpack and repack the Ramdisk
The Ramdisk modification only allows /system to have read and write access for SuperSU to work, it does not modified the kernel.
To modified the Kernel for systemless this is what is required and then recompile the kernel.
Click HERE to compile the kernel with root permission.
I have not look into this on the HP touchpad Kernel and I know that all I have posted on here is a lot to do, but if you want, let me know the version of Android you want to have the kernel with root access and the CPU speed and I could try to compile that and then you test it.

Help! Kernel compile

Sorry about my English
When I compile my kernel and install it on the device (TWRP), there is a very large image error, the original is about 30 MB and my output is 47 Mb. Any tips?
You can try to compile some modules outside the kernel and change kernel compression algo too. Tune the source parameters carefully, good to start is the config file from already working kernel...easy to find on Github or device filesystem if developer added this possibility.

Categories

Resources