[HELP] Can anyone help me recompile this boot.img? - HTC One X

Hi all,
I've been trying to edit a stock boot.img's ramdisk so that I can get proper rw access in USB debugging.
I've successfully
1. unpacked the img.
2. edited the default.prop file to ro.secure=0 and all other variables to 1
3. repacked the ramdisk
But I still can't repack the ramdisk and kernel into the new boot.img!
I've tried using the android kitchen, repack-bootimg.pl and mkbootimg, both in cygwin and a virtual machine running Ubuntu 12.04.
everytime mkbootimg gives an error, either "permission denied" or "no such file or directory"
I'm gonna attach the kernel gz and the edited and compiled ramdisk gz, as well as the boot.img (just in case).
Could someone please repack them into a new boot.img for me?
Many thanks!HelpingEhsan.rar

Hi Ehsan,
Here is a recompiled boot.img. and an analysis of your boot.img. I hope this works for you.

OMG
Wow! I was looking through my old posts and found your epic reply and documented study! I did eventually get it to work back then, but reading this, a year later, after having earned my salt in Android tinkering, have never read something so intriguing as the report you made. I wish I carried the weight of multiple accounts because one "thanks" isn't sufficient to express how grateful I am and how glad this has made me! You are a star!
k02a said:
Hi Ehsan,
Here is a recompiled boot.img. and an analysis of your boot.img. I hope this works for you.
Click to expand...
Click to collapse

Thanks for your encouraging words, I hope it helped you a little bit.

Related

[How to] Rom cooking

Original post:
Hello,
I am new to android but not to linux. I used to tweak my winmo phone rom.
I have backed up my device with nandroid. I just need some explanations:
- why isn't the radio extracted?
- how can I "extract" does .img files to modify and then rebuild them?
I found some informations of what the .img files contain here: ROM Partitions it should be the same for Hero
I have found some informations on how to push updates to the rom by looking at modaco updates. It seems quite simple to delete/copy files on the hero rom using an update-sript file. I am however curious about the RSA cert and if some files need to be signed.
Any information welcomed.
Regards
Click to expand...
Click to collapse
How to
Extract NAND image files
To extract .img files, I have found unyaffs from http://code.google.com/p/unyaffs/ I have compiled it under ubuntu 64 (attached). Unyaffs works on system.img but on no other .img file
To extract boot.img use attached extract-kernel.pl and extract-ramdisk.pl
# extract-kernel.pl boot.img
# extract-ramdisk.pl boot.img
Should work for recovery.img but haven't tried as custom recovery images on the forum are great.
Rebuild system.img
Seems you just need "to loopback mount an image on your linux box and format it with YAFFS".
But it is useless as because Hero's SPL does not allow flashing system.img directly. You should use an update.zip package for that. (read below)
Rebuild boot.img
After extracting your boot.img using attached extract-*.pl and tweaking it, in same folder run:
# mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Creating an update.zip package
Creating an update.zip package is quite easy in fact. For example, to add a (valid) test.apk package to your rom:
- create an empty folder <workdir>
- create folder structure for test.apk (<workdir>/system/app) and copy the test.apk
- create folder structure for update-script (<workdir>/META-INF/com/google/android)
- edit <workdir>/META-INF/com/google/android/update-script
- put in it:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10
- compress the <workdir> content to zip (not the <workdir> folder itself)
Now you are going to sign the zip file. Download attached testsign.zip and copy it in your <SDK>/tools folder. Extract it here. It should create a sign subfolder with a testsign.jar file in it.
Then, from <workdir> folder, do:
java -classpath <SDK>/tools/sign/testsign.jar" testsign file.zip file-signed.zip
Ok, now your zip file is ready to be deployed using cyanogen recovery image.
To find more command to use in update-script, look at other's.
Modify .apk package
Seems it is easy to uncompress an .apk package (zip) an to modify files in it and then compress it. But after all: you must sign it like update.zip packages.
ODEX files
- What are those Odex files? Answer.
- How to get rid of them?
Odex files depend on framework they are made for. To deodex an odex file use that how to
Then you may create a classes.dex file by executing the smali program on the "out" folder. You then rename it to classes.dex and add it to the .apk.
- How to create them?
Use dexopt-wrapper on device.
Porting an other device's rom
Well, that part is easy
- extract the system.img
- extract boot.img
- replace boot.img-kernel with the one from your stock Hero rom one.
- rebuild boot.img
- build update.zip package (look someone's hero custom rom to see how to do it)
- sign and flash
It should run place and make calls but probably won't have Wifi, BT, trackball support. If you make those work: tell me, but I think we should wait to be able to compile a 2.6.29 kernel to have those.
Tools
Androsign script (linux)
I wrote that androsign script to quick sign zip files. Just put it in your <SDK>/tools folder, then chmod +x. If you have put the tools folder in your PATH, you can call it directly like this:
androsign /dev/folder1/folder2/update.zip (or any zip/apk file)
It will output an update-signed.zip (or app-signed.apk etc) in the same folder than original file was in.
Notes
Note1: thanks
Thanks to every guy that helped me found all that.
Note1: sharing
I searched for hours, so I am more than happy to share it to save someone's time. I am just disappointed than some people here do not have that spirit: I could have use those hours for development instead of research...
Note3: corrections
So, if you found anything incorrect, would like to supply more informations or want to correct my bad english: just PM me.
To find
- how to dump radio from device
- how to build a custom hero kernel (waiting for HTC sources)
To come
How to prepare your own kitchen and useful scripts (linux)
gecka said:
I am new to android but not to linux.
Click to expand...
Click to collapse
Same here. I do lots of tweeking on my linux machine, so i know quite a lot of linux. If there would be anyone to answer those questions by gecka, I might start tweeking the rom (maybe someday cook one up)
Best regards
Hello,
First post edited, but still some ignorances... Please share if you know anything.
Best regards
unpack and pack boot.img and recovery.img
First you need utilities such as mkbootfs and mkbootimg. maybe you can find them online (i can upload them later compiled for linux x86-64) but i suggest you download android source (http://source.android.com) and do a generic make. In this way you have these and other utilities(tools to pack system.img too, but if you haven't an engineering bootloader you can't flash it directly) in /out/host/... (it's better if you add this in your PATH)
To unpack and pack boot and recovery, read here:
http://forum.xda-developers.com/showthread.php?t=443994
or here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
...or...
(I have attached extract-kernel and extract-ramdisk scripts from JF build environment) :
to unpack (boot.img or recovery.img, i'm writing the commands with boot.img):
Code:
extract-kernel boot.img
extract-ramdisk boot.img
at this point you have
boot.img-kernel
boot.img-ramdisk
to repack (boot.img or recovery.img):
For hero you need to specify the base address because it's different (0x19200000). For more information: http://forum.xda-developers.com/showthread.php?t=541522.
Code:
mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Useful resources for android modding are the dream forums (most of the concepts/hacks works for hero too):
http://forum.xda-developers.com/forumdisplay.php?f=448
(informative thread here: http://forum.xda-developers.com/showthread.php?t=519523)
note: mkbootimg with --base support is in donut and master (or find the patch on gerrit and apply it to cupcake)
First of all, the reason you cant unyaffs anything other than system.img is because they aren't YAFFS images. boot/recovery is kernel+initrd like in any normal linux bootimage scenario (see more below).
Tofind
- how to dump radio from device
Click to expand...
Click to collapse
Haven't gotten into that myself yet, but I know modaco posted an update.zip with radio image included on this very forum. Look for it.
- how to extract NAND images other than system.img
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=443994
- rebuild NAND images such as system.img
Click to expand...
Click to collapse
This isn't hard, just loopback mount an image on your linux box and format it with YAFFS.
Building a custom kernel and recovery binary
HTC hasn't yet released the changes they have made to the hero/dream/magic kernels, 32A board, so you can't just compile a kernel from the AOSP. I haven't tried it yet but this patch might work on hero too:
http://forum.xda-developers.com/showthread.php?t=548061
EDIT: HTC Sources for dream and magic at http://developer.htc.com
For building a custom recovery, it's better if you use cyanogen's recovery code, found in his git : github.com/cyanogen, because it already has menus for nandroid and other tools, but you can use the recovery code from AOSP too (cyanogen's one is a patched version with a lot more features, http://forum.xda-developers.com/showthread.php?t=523558). To make a custom recovery you need to change the recovery binary (because the press event of the hero trackball has a different keycode, 191), the kernel and the init scripts. Actually i don't remember what else I've changed to make cm's recovery working with hero (the recovery that we are actually using here), I'm at work now, but i'll check later and post more details, or you can just unpack the recovery and see the changes .
First post updated.
Nandroid only backs up the partitions in the main storage nand, but radio and spl are flashed to the radio's own nand flash. Whether it's possible to dump it or not I don't know, but honestly, I don't see why you'd want to. Radio images are available through RUU's and I don't think editing would be an easy task
jubeh said:
Nandroid only backs up the partitions in the main storage nand, but radio and spl are flashed to the radio's own nand flash. Whether it's possible to dump it or not I don't know, but honestly, I don't see why you'd want to. Radio images are available through RUU's and I don't think editing would be an easy task
Click to expand...
Click to collapse
Sometimes, new radio images appear on new phones. That is why I am looking on a way to extract it.
very useful thread.
Very nice tutorial, thank you!
could you please specify a bit more on how to clone from android's git and then build the mkbootimg and mkbootfs (just make, right)? I tried and I keep getting a "fatal:server dumped connection" error
Are we able to modify an official ROM (also for hero). Which shows up in RUU as INFOsignature checking... failed. Am I able to change the kernel and make it work?
jubeh said:
could you please specify a bit more on how to clone from android's git and then build the mkbootimg and mkbootfs (just make, right)? I tried and I keep getting a "fatal:server dumped connection" error
Click to expand...
Click to collapse
What command do you use?
In fact i won't be able to explain you better than that page: http://source.android.com/download
Following that how to, you'll be able to sync an android branch You can learn more about git, branches and more here (Repo and Git resources)
The sync is long (2.9Go). Then, to build mkbootimg and mkbootfs, you should do a generic build of android going to source folder and issuing the 'make' command.
All that will be part of my upcoming "How to prepare your own kitchen and useful scripts".
awsy44 said:
Are we able to modify an official ROM (also for hero). Which shows up in RUU as INFOsignature checking... failed. Am I able to change the kernel and make it work?
Click to expand...
Click to collapse
Well, to grep the system from a windows RUU exe file you should launch it and then look in your user temporary folder for a rom.zip file in a {uid} subfolder. It contains the system and boot img files.
You then need to make an update.zip package from them. Have a look to someone's hero custom rom and to it's update-script to see how it is achieved. My 'How to' gives you all you need to understand update.zip packages and to extract system.img.
If you are porting a Hero rom, no need to change the kernel.
Regards
Well, to grep the system from a windows RUU exe file you should launch it and then look in your user temporary folder for a rom.zip file in a {uid} subfolder. It contains the system and boot img files.
You then need to make an update.zip package from them. Have a look to someone's hero custom rom and to it's update-script to see how it is achieved. My 'How to' gives you all you need to understand update.zip packages and to extract system.img.
If you are porting a Hero rom, no need to change the kernel.
Regards
Click to expand...
Click to collapse
Thanks so much for this amazing information, however how do i stop getting hit with the infosignature failed error? is that the kernel or the hboot? it says 12 signature verify error.
Oh, I do have the source and I am running my own donut build on my dream with some of my spice, but the problem I was having was cloning that exact project (mkbootimg) from android.git.kernel.org using git, but when I read what you said, I remembered that when you make the build, it also compiles several tools and i overlooked checking the out folder for it, kind of dumb on my part since I had already pulled the fastboot tool from that build and added it to my own bin, i guess mkbootimg and mkbootfs should be there too, right?
i tried running androsign and got this error
Code:
[email protected]:~/android/dev/sdk/tools$ ./androsign META-INF.zip
Exception in thread "main" java.lang.NoClassDefFoundError: testsign
Failed!
[email protected]:~/android/dev/sdk/tools$
if i use a ROM of one device on an other different device, I think I must build a kernel on my own, is that correct?
but what config should I use? a config from my current running ROM? then I think I must make it suitable for new ROM, what options should I care about?
for example, if I want to run a AOSP 2.01 ROM ( system.img) on a Magic 32A device with SPL 1.76, and now I am running a SenseUI ROM which kernel is 2.6.27, I think I should build a 2.6.29 kernel from the git tree, and ensure it will work with camera/bt/wifi/trackball of my device properly first .
how can I make this step successful?
other hand, the dynamic lib files(.so) with the system.img can be incorrect. so, I may need to build them too for pairing with the kernel I built in previous step. I think applications will work properly because they only care about if the interfaces of kernel and lib is correct. for that, also there some config job (like build.prop, etc) to do, is there a list of all of these jobs? and what values can I refer to? the original ROM (Magic 32A SPL 1.76 working ROM here) ?
am I right? what should i do and what are in those steps? are there some doucments I can read from?
Thanks for the good summary. Just one question, where did testsign.jar come from? I'd like to get the source. Thanks!
JackZero said:
Thanks for the good summary. Just one question, where did testsign.jar come from? I'd like to get the source. Thanks!
Click to expand...
Click to collapse
Read this !
http://www.androiddevelopment.org/tag/apk/
;-)

How to unpack evo boot image?

I'm trying to figure out how to unpack and repack the evo's boot image. I found the "HOWTO: Unpack, Edit, and Repack Boot Images" thread in another forum using the search function but when I tried to use the scripts to unpack the boot.img file I received an error as follows:
Found a secondary file after the ramdisk image. According to the spec (mkbootimg.h) this file can exist, but this script is not designed to deal with this scenario.
The HOWTO thread I found mentioned that this was likely a second stage loader but indicated that it has not been seen on any system to date. This second stage loader had apparently only been defined in the mkbootimg.h file but not implemented as of the time this how to was written.
Can anyone provide a link to instructions on how to extract and repack the boot.img for the EVO? I'd like to make a few changes to the default.prop in the ramdisk of the default boot.img file and instructions would be greatly appreciated.
I use dsixda's kitchen
http://forum.xda-developers.com/showthread.php?t=633246
that allowed me to unpack it. I remember the error you speak of but I forget what script I was using
elegantai said:
I use dsixda's kitchen
http://forum.xda-developers.com/showthread.php?t=633246
that allowed me to unpack it. I remember the error you speak of but I forget what script I was using
Click to expand...
Click to collapse
This worked for me perfectly.
Thanks very much for the pointer!

[Q] Help with building stock kernel

I would like to learn how to build stuff for my tmobile s2. I figured I should try to build the stock kernel first to get my hands dirty. I have been following this guide here: http://forum.xda-developers.com/showthread.php?t=1442870
Unfortunately it is for the Epic Touch 4G, but I think a lot is similar. I have several questions regarding building a kernel for the T989:
1) How can I extract the initramfs from a stock boot.img?
2) The guide from the link above tars a zimage file. Does this need to be boot.img for the T989?
Thanks.
Below I have posted what I have done so far in trying to compile a kernel for the T989, in case anyone else is also learning like me.
I am using Ubuntu 10.10 32-bit
1) Download T989 source code from here: https://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=SGH-T989 (download the T989 version for TMobile)
2) unzip SGH-T989_GB_Opensource.zip
3) extract SGH-T989_Kernel.tar.gz
4) next you need to get a version of the initramfs. I got it off of my phone using clockworkmod backup (boot.img file) and following this guide to extract the initramfs: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
5) Download arm toolchain here (I use version 2010.09): https://sourcery.mentor.com/sgpp/li...09-51-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
6) extract toolchain
7) Setup cross compile script (run before doing compiles) (change CROSS_PATH for your setup):
cross-compile.sh:
BINVERSION=arm-2010.09
export ARCH=arm
export CROSS_PATH=~/android/toolchains/${BINVERSION}/bin/
export CROSS_NAME=arm-none-eabi-
export CROSS_COMPILE=${CROSS_PATH}${CROSS_NAME}
export CC=${CROSS_NAME}gcc
export CXX=${CROSS_NAME}g++
export LD=${CROSS_NAME}ld
export STRIP=${CROSS_NAME}strip
PATH=${CROSS_PATH}:$PATH
8) Compile script (modify CONFIG_INITRAMFS_SOURCE to point to your initramfs) :
source ../scripts/cross-compile.sh
cd kernel
make clean
make mrproper
make msm8660_celox_usa_tmo_defconfig
make modules
make -j5 CONFIG_INITRAMFS_SOURCE=../initramfs
9) The kernel image is in "arch/arm/boot/zimage"
10) *** Question: How do I make the zimage "odin" compatible
This is still not complete (Steps 10 is unsolved). I need to make the build image odin compatible.
If anyone knows of a kernel building guide that exists for the T989 please post here.
Thanks.
You should pm the devs that posted their kernels in the dev section. Im sure they would love to help. Even exchage google talk or google + with each other to get quicker answers.
sent from the Dark §¡3€
I noticed you hit up the e4gt thread so I came here to see If I can help. If you have Irc I can walk you thru It all the way. I lost all my data today so my machine is down for building. im on freenode #evervolv ...
interloper, thanks for the kind offer. Please let me know when your machine is up and running. Hope to hear from you. Thanks again.
This is the script you want to use to extract the initramfs http://forum.xda-developers.com/wiki/Extract_initramfs_from_zImage
It works for the E4GT without modification so it should work for you guys without modification.
dtm_stretch,
Thanks for the extract script. The script does not work when I try to extract the initramfs from a boot.img I got from doing a backup with clockworkmod. It only manage to extract two empty folders: "dev" and "root"
However, the script does work when I tried it on a zImage I built myself. With the kernel I built I used the initramfs provided at: https://github.com/bubby323/anomaly_kernel_platform_SGH-T989/tree/master/initramfs
I know I can use the initramfs at the github but I really would like to learn how to get it myself so I can apply to other phones later. The knowledge is more important to me.
Thanks.
I was able to extract the initramfs from the boot.img (cwm backup of my phone) using the tools at this site: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
Now my only problem is making a odin compatible (flashable) kernel from the compiled zImage. Is it as simple as renaming zImage to boot.img and then put it in a tar to flash with odin? The only reason why I am not certain is my zImage is only about 5megs while the boot.img is 10megs. It seems like the boot.img is a disk copy of the flash partition for the boot on the phone. Do I need to use dd to copy my zImage into boot.img?
I know I make no sense. Hopefully with this last step I have it all down (at least for creating a kernel, rom is next). Please help a noob. Thanks.
datzstr8 said:
I was able to extract the initramfs from the boot.img (cwm backup of my phone) using the tools at this site: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
Now my only problem is making a odin compatible (flashable) kernel from the compiled zImage. Is it as simple as renaming zImage to boot.img and then put it in a tar to flash with odin? The only reason why I am not certain is my zImage is only about 5megs while the boot.img is 10megs. It seems like the boot.img is a disk copy of the flash partition for the boot on the phone. Do I need to use dd to copy my zImage into boot.img?
I know I make no sense. Hopefully with this last step I have it all down (at least for creating a kernel, rom is next). Please help a noob. Thanks.
Click to expand...
Click to collapse
Sorry for not replying sooner, but if you want to create a flashable tar in terminal
Code:
# cd /where/your/zimage/is/located
# tar cvf whateveryouwanttocallyourkernel.tar zImage
or you can just use a zip that already flashes a kernel and swap out the zimages.
I was able to successfully build my kernel and flash it to my phone. I needed to use mkbootfs and mkbootimg to combine my zImage and ramdisk to make boot.img. I will post a tutorial up in the development section and will link it here when I am done. Hopefully it will help all the noobs like me get their feet wet. Stay tuned.
update:
here is the link to the guide: http://forum.xda-developers.com/showthread.php?p=22941057#post22941057
ODIN .tar
I advise all of you to learn bash scripting. With bash scripting or pearl you can automate this entire process. Also create a cheat sheet text document with long but common commands, git command reminders and things like that. These commands should create your ODIN .tar file. First cd to the directory the junk is in then:
Code:
tar -H ustar -c factoryfs.rfs cache.rfs modem.bin zImage boot.bin recovery.bin param.lfs sbl.bin > myOdin.tar
That makes the tarball
Then:
Code:
md5sum -t myOdin.tar >> myOdin.tar
That does the MD5 sum
Then:
Code:
mv myOdin.tar myOdin.tar.md5
That sign the tarball with the MD5 sum
You should be able to ODIN that .tar. Now, for the first command you can replace whatever files you want tarred with what I put. If you only want the modem.bin specify that only, etc.
Another word of advice is to find helpful helpful Nautilus scripts to ad to the right click context menu for time saving simple operation. Google it and you find several good resources. Also, if you look, there are Nautilus scripts that can be added to zip and sign .zip and .apk files to make that faster and easier.
Be careful out there and good luck.

[q] weird problem with adb pull command

i have been trying to pull my back ups from phone via adb pull. but i keep on running in a weird probelm.. i cant pull any system file as well as the data/media/clockword mod. if i type that command , it just runs the directory of various commands.. but i can still pull any file from my /sdcard command
i hope you guys can help me as i have searched everywhere but i cant seem to find an answer .
khuzema9 said:
i have been trying to pull my back ups from phone via adb pull. but i keep on running in a weird probelm.. i cant pull any system file as well as the data/media/clockword mod. if i type that command , it just runs the directory of various commands.. but i can still pull any file from my /sdcard command
i hope you guys can help me as i have searched everywhere but i cant seem to find an answer .
Click to expand...
Click to collapse
You need an insecure kernel to pull system files (/system, /data). I'm not sure if there are other ways, but I do know that you can adb pull anything if you have ro.secure=0 in default.prop of the kernel's ramdisk. You can easily do this to your own kernel by using dsixda's kitchen to extract boot.img and edit it. If you need help, just post there (or you can post boot.img and I can do it quickly for you).
mwalt2 said:
You need an insecure kernel to pull system files (/system, /data). I'm not sure if there are other ways, but I do know that you can adb pull anything if you have ro.secure=0 in default.prop of the kernel's ramdisk. You can easily do this to your own kernel by using dsixda's kitchen to extract boot.img and edit it. If you need help, just post there (or you can post boot.img and I can do it quickly for you).
Click to expand...
Click to collapse
THANK YOU SO MUCH FOR REPLYING , i am right now using franco app and just flashed its kernel and its working now... but i am confused about the push command so how to send it back to its location from my pc to phone.
could you be generous enough to tell me how to edit boot.img and what else can i do by editing as well.. if you can direct me to some links or whatever you could tell me . i would love to learn it ..
khuzema9 said:
THANK YOU SO MUCH FOR REPLYING , i am right now using franco app and just flashed its kernel and its working now... but i am confused about the push command so how to send it back to its location from my pc to phone.
could you be generous enough to tell me how to edit boot.img and what else can i do by editing as well.. if you can direct me to some links or whatever you could tell me . i would love to learn it ..
Click to expand...
Click to collapse
You don't simply edit boot.img. Its a kernel and must be compiled from source.
khuzema9 said:
THANK YOU SO MUCH FOR REPLYING , i am right now using franco app and just flashed its kernel and its working now... but i am confused about the push command so how to send it back to its location from my pc to phone.
could you be generous enough to tell me how to edit boot.img and what else can i do by editing as well.. if you can direct me to some links or whatever you could tell me . i would love to learn it ..
Click to expand...
Click to collapse
I just use dsixda's kitchen and it's a command under the 'advanced options' menu in unpack boot.img. You can get the latest dsixda kitchen here. Download the .zip to your computer. To get it setup, you either run it in linux (I just use a virtual machine of ubuntu) or use cygwin. You can get instructions in post 3 of this thread. I used to use cygwin and it wasn't too hard to get setup. The instructions are pretty easy to follow. When you are pushing things to your phone, I usually do it in recovery (though it doesn't always have to be) and don't forget the 'adb shell mount /system' or whatever partition you are pushing to before you use adb push.
scottx . said:
You don't simply edit boot.img. Its a kernel and must be compiled from source.
Click to expand...
Click to collapse
That's not really true. It's easy to unpack boot.img into the ramdisk and zimage. zimage must be compiled (maybe that's what you're thinking), but there are many things you can edit with a text editor in the ramdisk (like the value to make the kernel insecure that I posted previously).
ok i will defiantely work on that , and i sure hope to end up with questions which i will definately ask
khuzema9 said:
ok i will defiantely work on that , and i sure hope to end up with questions which i will definately ask
Click to expand...
Click to collapse
is there any way to push backups from usb drive to the clockworkmod folder , if i just keep them handy

Unable to build kernel from source, what i'm missing?

Hello to all!
I'm an heavy oneplus user, currently with Nord, but i'm try to use my old but Gold Oneplus 3 to run Klipper+Moonraker+Fluidd.
Klipper side everything is perfect, still remains one big issue: there is no kernel compiled for OP3 which has USB_SERIAL_CH341 driver enabled.
I'm trying to build but without success. Here is what i've done under Linux Mint latest version.
First of all i've installed a lot of packages, i cant remember all because i used various guides since initially i was not able neither of finish compilation.
Then i've downloaded:
kernel source: https://github.com/lin16-microg/android_kernel_oneplus_msm8996/tree/lin-16.0-mse2
from this ROM thread, which is the rom im still using: https://forum.xda-developers.com/t/...ened-lineageos-16-0-for-oneplus-3-3t.4034869/
initially i've tried to use EVAgcc toolchain, but it was impossible to finish to build. Then i switched to AOSP toolchains:
32bit: https://android.googlesource.com/pl...inux-androideabi-4.9/+/refs/heads/pie-release
64bit: https://android.googlesource.com/pl...64-linux-android-4.9/+/refs/heads/pie-release
With Them i was able to compile from source, but before doing i modified the file called "lineageos_oneplus3_defconfig" by adding "USB_SERIAL_CH341=y" just under the "USB_SERIAL=y" in order to have the serial driver compiled and loader (if i have understood right?).
to build i've used from inside kernel source cloned directory:
>make clean
>make mrproper
>ARCH=arm64 SUBARCH=arm64 CROSS_COMPILE=googletoolpath/bin/aarch64-stuffs- CROSS_COMPILE_ARM32=googletoolpath/bin/arm-stuffs- make O=out lineageos_oneplus3_defconfig
>ARCH=arm64 SUBARCH=arm64 CROSS_COMPILE=googletoolpath/bin/aarch64-stuffs- CROSS_COMPILE_ARM32=googletoolpath/bin/arm-stuffs- make O=out Image -j2
in this way i've obtained an Image (not a zimage since with zimage returned error).
Then i unpacked the stock boot.img with Android Image Kitchen, substituted boot.img-kernel file (which is an archive..?) with the compiled image renamed.
Finally i repacked everything.
Tried to flash the repacked boot img but no boot, the phone returns to fastboot screen.
I've noticed that my newboot.img is around 25mb insted of around 12mb like the stock one present in the Rom.zip
Probably the error resides in how i've managed to unpack and repack the kernel image..
Do someone see some heavy error which can cause the problem? What can i try?
From a side, as automation engineer, i want to learn and try to do it by myself, but on the other side, if someone is able to compile it for me with serial CH341 driver enabled a beer is assured.
Thanks all to have read up to now and for any advice
not sure that's important but you forgot to gzip kernel before repacking. I recommend to compile with configuration of running kernel from device /proc/config.gz first.
alecxs said:
not sure that's important but you forgot to gzip kernel before repacking. I recommend to compile with configuration of running kernel from device /proc/config.gz first.
Click to expand...
Click to collapse
I've to try because it is not gzipped by default, the problem is that I don't found all in one scripts or config file as the one mentioned by you. I would never thought that rebuild a kernel were so tricky.

Categories

Resources