Android TV Launcher Pushed to Google Play

Over the past decade, the tech universe has seen two drastic and widely contrasting changes with … more

Cyngn, OnePlus, Micromax – The Legal Battle

Recently, a battle has been waging in India over the rights to distribute the commercial … more

Lean Mean Battery Power Saving App Review

We talk a lot about battery topics here at XDA TV. We talk about everything from Power Banks to USB … more

Android 5.1 Possibly Coming February 2015

Google released Android 5.0 just over a month ago, and since then Lollipop has been trying to … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[KERNEL] Stock Kernel (no write protection)

OP flar2

16th February 2013, 03:03 AM   |  #1  
flar2's Avatar
OP Recognized Developer
Flag Ottawa
Thanks Meter: 30,103
 
6,027 posts
Join Date:Joined: Jun 2012
Donate to Me
More
This is the stock kernel without system write protection. Completely stock configuration, completely stock ramdisk. The only difference is it allows write to system

Uses Telstra 3.17.841.2 source from htcdev.com:
http://dl4.htc.com/RomCode/Source_an...10-240d4d5.zip



Devs who need a vanilla kernel are free to modify or include with ROMs

installer: http://goo.gl/64HJc

boot.img: http://goo.gl/IRZ9m
Last edited by flar2; 16th February 2013 at 03:05 AM.
The Following 13 Users Say Thank You to flar2 For This Useful Post: [ View ]
16th February 2013, 03:08 AM   |  #2  
area51avenger's Avatar
Senior Member
Toronto
Thanks Meter: 338
 
865 posts
Join Date:Joined: Sep 2012
More
Re: [KERNEL] Stock Kernel (no write protection)
Does this also uninstall any old modules?

Sent from my VENOMized HoxL
16th February 2013, 03:42 AM   |  #3  
flar2's Avatar
OP Recognized Developer
Flag Ottawa
Thanks Meter: 30,103
 
6,027 posts
Join Date:Joined: Jun 2012
Donate to Me
More
Quote:
Originally Posted by area51avenger

Does this also uninstall any old modules?

Sent from my VENOMized HoxL

The installer deletes /system/lib/modules/wp_mod.ko and /system/lib/wp_mod.ko

There is no init.d support either, so it won't load any init scripts.
16th February 2013, 03:50 AM   |  #4  
utkaar099's Avatar
Senior Member
Flag Boston
Thanks Meter: 1,894
 
1,085 posts
Join Date:Joined: Jun 2012
Donate to Me
More
Nice job, this should be useful!
16th February 2013, 01:49 PM   |  #5  
AlxMAX's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 92
 
437 posts
Join Date:Joined: Sep 2007
More
On my side, I had some problems. I have tried to compile the kernel, but I went a little bit further with the modifications:
  • disabled the /system write protection.
  • integrated the prima_wlan source tree in drivers/staging. The sources were downloaded from the codeaurora.org site and the driver version was 3.1.7.16 (I have specifically chosen this version because it was the closest to the 3.1.7.0 version that exists in the stock ROM).
  • compressed the vmlinux image with LZMA instead of gzip (this is an option in the configuration) to obtain the zImage file.
  • compressed the ramdisk image with LZMA instead of gzip (in the configuration file, I have seen 3 enabled options: gzip, LZMA and XZ and I thought recompressing the ramdisk might not hurt).
The toolchain I have used was downloaded from android.googlesource.com. Then I have unpacked the original boot.img like this: trimmed the first 128 bytes from the file (up to the ANDROID magic label), then used the unpackbootimg tool (this was a tool I have found in a Gingerbread source tree). Then, I have used the new zImg, the LZMA compressed ramdisk and mkbootimg (this was also picked from the same Gingebread source tree) to build a new boot.img. I have booted in the recovery, flashed the new modules, then booted in fastboot mode and flashed the boot.img. The result was an annoying boot loop and it wasn't very easy to put the phone in fastboot mode again.
  • I have some questions about what I have done so far. Could you, please, tell me if there was a wrong manoeuvre/setting/thingie? I suspect the unpacking process has not produced the proper data (command line, base address ...). What tool have you used to unpack the original boot.img file? I also suspect the packing process. Is a new mkbootimg required?
  • And some questions about your work. What prima_wlan driver have you used in your boot.img? Have you modified the suffix added to the 3.4.10 version when you have configured the kernel in order to make it work?
Last edited by AlxMAX; 16th February 2013 at 01:58 PM.
16th February 2013, 05:43 PM   |  #6  
Zarboz's Avatar
Known Scammer
Flag Denver
Thanks Meter: 9,264
 
3 posts
Join Date:Joined: Mar 2009
Donate to Me
More
Quote:
Originally Posted by AlxMAX

On my side, I had some problems. I have tried to compile the kernel, but I went a little bit further with the modifications:

  • disabled the /system write protection.
  • integrated the prima_wlan source tree in drivers/staging. The sources were downloaded from the codeaurora.org site and the driver version was 3.1.7.16 (I have specifically chosen this version because it was the closest to the 3.1.7.0 version that exists in the stock ROM).
  • compressed the vmlinux image with LZMA instead of gzip (this is an option in the configuration) to obtain the zImage file.
  • compressed the ramdisk image with LZMA instead of gzip (in the configuration file, I have seen 3 enabled options: gzip, LZMA and XZ and I thought recompressing the ramdisk might not hurt).
The toolchain I have used was downloaded from android.googlesource.com. Then I have unpacked the original boot.img like this: trimmed the first 128 bytes from the file (up to the ANDROID magic label), then used the unpackbootimg tool (this was a tool I have found in a Gingerbread source tree). Then, I have used the new zImg, the LZMA compressed ramdisk and mkbootimg (this was also picked from the same Gingebread source tree) to build a new boot.img. I have booted in the recovery, flashed the new modules, then booted in fastboot mode and flashed the boot.img. The result was an annoying boot loop and it wasn't very easy to put the phone in fastboot mode again.
  • I have some questions about what I have done so far. Could you, please, tell me if there was a wrong manoeuvre/setting/thingie? I suspect the unpacking process has not produced the proper data (command line, base address ...). What tool have you used to unpack the original boot.img file? I also suspect the packing process. Is a new mkbootimg required?
  • And some questions about your work. What prima_wlan driver have you used in your boot.img? Have you modified the suffix added to the 3.4.10 version when you have configured the kernel in order to make it work?

use dsi xda kitchen to pack the boot.img for easy use

or

use this

unpackbootimg -i boot.img -o /directoryfordump
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --kernel zImage --ramdisk ramdisknew.gz --base 80400000 --ramdiskaddr 81900000 -o newboot.img
The Following User Says Thank You to Zarboz For This Useful Post: [ View ]
18th February 2013, 07:56 AM   |  #7  
AlxMAX's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 92
 
437 posts
Join Date:Joined: Sep 2007
More
Where have you got that ramdisk address from? unpackbootimg doesn't report it.
Quote:
Originally Posted by Zarboz

mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --kernel zImage --ramdisk ramdisknew.gz --base 80400000 --ramdiskaddr 81900000 -o newboot.img

Edit: I have done some research on mkbootimg and unpackbootimg and their usage is a little bit confusing. The boot image header contains a kernel address, a ramdisk address and some other data (including the command line provided to the kernel by the bootloader). The mkbootimg tool like it is in the Android repository uses more measures: a base address, a kernel offset, a ramdisk offset etc. The kernel address is base + kernel offset and so on. When unpacking the boot image with unpackbootimg, one must suppose one of the parameters fixed, usually the kernel offset (0x00008000). Consequently, the base address is computed as the kernel address - the kernel offset. To conclude, the command line to use should be:
Code:
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --base 80400000 --ramdisk_offset 1408000 --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot-2.img
This produces the same boot.img as the one posted by flar2, except for the command line.

Edit 2: I have recompiled the kernel, disabled the /system protection, used the mkbootimg command line right above and now my phone boots and runs well. The prima_wlan.ko that I have compiled together with the kernel (3.1.7.16 from codeaurora source repository) doesn't work. It might be a matter of wi-fi firmware. Fortunately, the stock prima_wlan.ko (proprietary 3.1.7.0) module works well.
Last edited by AlxMAX; 18th February 2013 at 06:50 PM. Reason: Details about mkbootimg and unpackbootimg...
The Following User Says Thank You to AlxMAX For This Useful Post: [ View ]
18th February 2013, 10:48 PM   |  #8  
Zarboz's Avatar
Known Scammer
Flag Denver
Thanks Meter: 9,264
 
3 posts
Join Date:Joined: Mar 2009
Donate to Me
More
Quote:
Originally Posted by AlxMAX

Where have you got that ramdisk address from? unpackbootimg doesn't report it.

Edit: I have done some research on mkbootimg and unpackbootimg and their usage is a little bit confusing. The boot image header contains a kernel address, a ramdisk address and some other data (including the command line provided to the kernel by the bootloader). The mkbootimg tool like it is in the Android repository uses more measures: a base address, a kernel offset, a ramdisk offset etc. The kernel address is base + kernel offset and so on. When unpacking the boot image with unpackbootimg, one must suppose one of the parameters fixed, usually the kernel offset (0x00008000). Consequently, the base address is computed as the kernel address - the kernel offset. To conclude, the command line to use should be:

Code:
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --base 80400000 --ramdisk_offset 1408000 --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot-2.img
This produces the same boot.img as the one posted by flar2, except for the command line.

Edit 2: I have recompiled the kernel, disabled the /system protection, used the mkbootimg command line right above and now my phone boots and runs well. The prima_wlan.ko that I have compiled together with the kernel (3.1.7.16 from codeaurora source repository) doesn't work. It might be a matter of wi-fi firmware. Fortunately, the stock prima_wlan.ko (proprietary 3.1.7.0) module works well.

you have to do some haxxing to get the CAF prima to load up
20th February 2013, 04:49 PM   |  #9  
AlxMAX's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 92
 
437 posts
Join Date:Joined: Sep 2007
More
Quote:
Originally Posted by Zarboz

you have to do some haxxing to get the CAF prima to load up

I am interested of that hack. Could you, please, send me a link to some documentation about it?
22nd February 2013, 04:50 AM   |  #10  
Zarboz's Avatar
Known Scammer
Flag Denver
Thanks Meter: 9,264
 
3 posts
Join Date:Joined: Mar 2009
Donate to Me
More
Re: [KERNEL] Stock Kernel (no write protection)
Quote:
Originally Posted by AlxMAX

I am interested of that hack. Could you, please, send me a link to some documentation about it?

There isn't any I have found just trial and error

Sent from my HTC One X using xda app-developers app

Post Reply Subscribe to Thread

Tags
stock kernel
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes