5,605,373 Members 42,207 Now Online
XDA Developers Android and Mobile Development Forum

[KERNEL] Stock Kernel (no write protection)

Tip us?
 
flar2
Old
(Last edited by flar2; 16th February 2013 at 02:05 AM.)
#1  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 19383
Posts: 4,331
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Default [KERNEL] Stock Kernel (no write protection)

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
The Following 13 Users Say Thank You to flar2 For This Useful Post: [ Click to Expand ]
 
area51avenger
Old
#2  
area51avenger's Avatar
Senior Member
Thanks Meter 338
Posts: 863
Join Date: Sep 2012
Location: Toronto
Default Re: [KERNEL] Stock Kernel (no write protection)

Does this also uninstall any old modules?

Sent from my VENOMized HoxL
Phone: Nexus 5
 
flar2
Old
#3  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 19383
Posts: 4,331
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Quote:
Originally Posted by area51avenger View Post
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.
 
utkaar099
Old
#4  
utkaar099's Avatar
Senior Member
Thanks Meter 1893
Posts: 1,085
Join Date: Jun 2012
Location: Boston

 
DONATE TO ME
Nice job, this should be useful!
Device History
Quote:
-HTC One Dev Edition [CURRENT]
-AT&T HTC One X [RETIRED]
-Sony Ericsson XPERIA X10 [SOLD]
-Crappy Nokia [DEAD]


Did I help you out? If so, no need to say thanks. Just hit that "thanks" button!

My Work
-Android File Host
-goo.im
-MEGA
 
AlxMAX
Old
(Last edited by AlxMAX; 16th February 2013 at 12:58 PM.)
#5  
AlxMAX's Avatar
Senior Member
Thanks Meter 89
Posts: 427
Join Date: Sep 2007
Location: Bucharest
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?
HTC One XL X325u, O2 DE firmware 5.06.207.1.
Samsung Galaxy Tab 2 10.1 P5100, CyanogenMod 11
 
Zarboz
Old
#6  
Zarboz's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 9255
Posts: 6,247
Join Date: Mar 2009
Location: Denver

 
DONATE TO ME
Quote:
Originally Posted by AlxMAX View Post
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
 
Building a better droid is the purpose of today Android History
G1->mytouch 3g -> Mytouch slide -> Mytouch 4g -> HD2 magldr -> Thunderbolt -> Evo 3D -> Sensation -> Evo 4g -> Evo 3D -> HTC vivid -> One X -> One S -> ( Evo LTE (thanks xda) -> Droid DNA
I stay HTC.
Checkout my new project at EasyDevStudio
[showp1984] Times of day and sleep are something for weak people - I am a cybernetic organism, and have a sleep mode.
ლ(ಠ益ಠლ)
Come hangout
irc.freenode.net
#teamblackout
I BUY BRICKED PHONES!

The Following User Says Thank You to Zarboz For This Useful Post: [ Click to Expand ]
 
AlxMAX
Old
(Last edited by AlxMAX; 18th February 2013 at 05:50 PM.) Reason: Details about mkbootimg and unpackbootimg...
#7  
AlxMAX's Avatar
Senior Member
Thanks Meter 89
Posts: 427
Join Date: Sep 2007
Location: Bucharest
Where have you got that ramdisk address from? unpackbootimg doesn't report it.
Quote:
Originally Posted by Zarboz View Post
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.
HTC One XL X325u, O2 DE firmware 5.06.207.1.
Samsung Galaxy Tab 2 10.1 P5100, CyanogenMod 11
The Following User Says Thank You to AlxMAX For This Useful Post: [ Click to Expand ]
 
Zarboz
Old
#8  
Zarboz's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 9255
Posts: 6,247
Join Date: Mar 2009
Location: Denver

 
DONATE TO ME
Quote:
Originally Posted by AlxMAX View Post
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
 
Building a better droid is the purpose of today Android History
G1->mytouch 3g -> Mytouch slide -> Mytouch 4g -> HD2 magldr -> Thunderbolt -> Evo 3D -> Sensation -> Evo 4g -> Evo 3D -> HTC vivid -> One X -> One S -> ( Evo LTE (thanks xda) -> Droid DNA
I stay HTC.
Checkout my new project at EasyDevStudio
[showp1984] Times of day and sleep are something for weak people - I am a cybernetic organism, and have a sleep mode.
ლ(ಠ益ಠლ)
Come hangout
irc.freenode.net
#teamblackout
I BUY BRICKED PHONES!

 
AlxMAX
Old
#9  
AlxMAX's Avatar
Senior Member
Thanks Meter 89
Posts: 427
Join Date: Sep 2007
Location: Bucharest
Quote:
Originally Posted by Zarboz View Post
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?
HTC One XL X325u, O2 DE firmware 5.06.207.1.
Samsung Galaxy Tab 2 10.1 P5100, CyanogenMod 11
 
Zarboz
Old
#10  
Zarboz's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 9255
Posts: 6,247
Join Date: Mar 2009
Location: Denver

 
DONATE TO ME
Default Re: [KERNEL] Stock Kernel (no write protection)

Quote:
Originally Posted by AlxMAX View Post
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
 
Building a better droid is the purpose of today Android History
G1->mytouch 3g -> Mytouch slide -> Mytouch 4g -> HD2 magldr -> Thunderbolt -> Evo 3D -> Sensation -> Evo 4g -> Evo 3D -> HTC vivid -> One X -> One S -> ( Evo LTE (thanks xda) -> Droid DNA
I stay HTC.
Checkout my new project at EasyDevStudio
[showp1984] Times of day and sleep are something for weak people - I am a cybernetic organism, and have a sleep mode.
ლ(ಠ益ಠლ)
Come hangout
irc.freenode.net
#teamblackout
I BUY BRICKED PHONES!


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

Advanced Search
Display Modes


TRENDING IN THEMER...