[Q] Extract boot and recovery to create flashable zip with kernel - Galaxy Tab 10.1 Q&A, Help & Troubleshooting

Hey all!
I've been following the CyanogenMod guide on compiling the kernel and I've successfully compiled a kernel for the 7510. The next step is now to create a flashable zip with there is a guide for here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
According to that guide you are supposed to extract the boot and recovery to be able to unpack, edit and re-pack the images. However, when I type "cat /proc/mtd" in a root shell I only get the headers of the output "dev: size erasesize name" and no listing.
Anyone go an idea on how to extract these images to create something that can be flashed? Is there perhaps an easier and better way to do this?
Note that the kernel I'm compiling is pershoots ICS kernel and I'm doing this just for fun and learning... no glamour or ruined creds . Unforunately this means that it is probably not possible to repackage one of pershoots already created update.zip's (the 3.2 versions) with a different zImage?

I have not tried to compile a kernel yet, I'm trying to remember what I did last time to just get pershoots' kernel on the last build.
I think what I did was make a complete build from cyanogen source and then I used a windows OS guide to unpack and repack the boot.img with the new kernel. I'm sure that won't help you since you don't even have a kernel yet.
What OS are you building in?
It was real late at night last time I read about compiling a kernel, but I thing it requires extracting a working kernel from the device???

kmmxracer said:
I have not tried to compile a kernel yet, I'm trying to remember what I did last time to just get pershoots' kernel on the last build.
I think what I did was make a complete build from cyanogen source and then I used a windows OS guide to unpack and repack the boot.img with the new kernel. I'm sure that won't help you since you don't even have a kernel yet.
What OS are you building in?
It was real late at night last time I read about compiling a kernel, but I thing it requires extracting a working kernel from the device???
Click to expand...
Click to collapse
Thanks for your reply. I do have a kernel build already, it's baked and finished
I'm on Ubuntu, Mac and Win 7 if it's really needed (would hate to reboot my machine ). Perhaps the guide you followed is the one I linked to above? That is not working for me unfortunately since I can't get to the boot and recovery images.

Hmm, this has me confused now. Perhaps my flashing efforts have been working all along.
In the kernels I've compiled and flashed before, they have always showed my information in the "Kernel version" field in "About tablet". Thus I have been checking that field after my flashes and it hasn't changed once.
I've tried several different updater scripts and none has worked, or so I have believed. I became a bit suspicious about this and checked the build.prop for the ICS KANG ROM, and it has some properties that I think may be causing the confusion.
Under "# autogenerated by buildinfo.sh" ... there are these props among others:
ro.build.user=eric
ro.build.host=Venom
Wouldn't that be shown under "Kernel version" as [email protected] although I've flashed the kernel build on my system?
All the flashes I've done, most of them packaged from versions of Koush's AnyKernel script have gone through without warnings so perhaps my flashes have been working all along?
Running uname -a from the shell on the device gives this though:
Linux localhost 2.6.36.4-cyanogenmod+ #1 SMP PREEMPT Sun Dec 25 18:14:16 EST 2011 armv7l GNU/Linux
That would indicate that it was build on the 25th of december wouldn't it? Well, that's not today so in that case I have still failed .
Would someone be able to have a look at my zip to see if it's validly structured if I pm a link to it?
Thanks!

Perhaps that guide is a bit dated?
This is the one I used: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows

kmmxracer said:
Perhaps that guide is a bit dated?
This is the one I used: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
Click to expand...
Click to collapse
Awesome, thanks. Will look into that.

Related

[Q] How do I build and deploy my own kernel?

I'm sure this has been covered before, but I can't get any answers. (When I search, I keep finding threads asking the same question and being told to search...)
I know I've seen a thread somewhere with some info. If anybody knows where this is and can post a link...
I've downloaded the kernel source for 2.1 from samsung and have been able to compile it. I took a voodoo kernel zip and unzipped it - replaced zImage with mine, and zipped it back up. When I use clockwork to flash the zip file, it goes into a reboot cycle. I figure this should work since the kernel versions are the same and my kernel should just use the existing modules, (in the same way it appears the voodoo kernel does).
I'm guessing I'm packaging it wrong, but I'd like to see a whole build procedure to make sure I didn't miss anything.
EDIT: Also, I'm running Ubuntu and its getting annoying to boot back and forth between Linux/Windows to use ODIN. Are there better ways to test kernels?
Thanks in advance.
Did you add the ramdisk? I use odin in virtualbox under ubuntu. There's a thread in the i9000 development forum that explains how to do it.
The ramdisk is finicky as hell. It's much simpler to start from a known good one. The voodoo project has one posted. You can also extract one from a working kernel.
Damn that ramdisk. It seems that only one way of adding it to the kernel works. I could never get the gzipped cpio file to go into the kernel. Have to ungzip/cpio and create the stupid list. But thats probably your issue.
http://forum.xda-developers.com/showthread.php?t=697938
This should have all the info you need to get started, need further help or clarification, can ask a dev. or do a google search
Thanks guys for the quick responses. I'm going to try and pack intramfs with my kernel and try again. I'll let you know how it goes.
A friend of mine found this link as well - I'll be trying to use that as well.
forum.xda-developers.[com]/showthread.php?t=777380
Why Samsung chose to write a Linux ROM flasher in Windows boggles my mind. It won't even run under WINE. What were they thinking?
dattaway said:
Why Samsung chose to write a Linux ROM flasher in Windows boggles my mind. It won't even run under WINE. What were they thinking?
Click to expand...
Click to collapse
They were probably thinking that most people run Windows...which would be a safe assumption.

[Q] i9100 S II / Linux / Heimdall-1.3.1 / CF-Root

Hi,
Trying to find guidance on rooting my i9100 S II, but I use GNU/Linux (Gentoo) so Odin isn't an option.
I'd like to go with CF-Root and having read the first page my kernel version is..
2.6.35.7-I9100XWKF3-CL276555
[email protected] #2
...so I'm pretty sure the only CF-Root available to me is CF-Root-SGS2_XW_CLK_KF3-v4.0-CWM4.zip (posted by Chainfire at 30th May 2011, 08:59).
I've discovered the free open-source alternative to Odin that is Heimdall and have successfully installed version 1.3.1 on my computer.
When I load the CF-Root-SGS2_XW_CLK_KF3-v4.0-CWM4.tar under the heimdall-frontend I'm told...
'firmware.xml is missing from the package'
...and from what I've read on the Heimdall Linux REAME.txt the firmware.xml file is expected as it defines what is included in a Heimdall package. Yet the CF-Root I'm trying to use isn't such a package, hence the message.
So I'm thinking I should use the command-line version of Heimdall, because if I untar the above CF-Root there is one thing within it, a zImage file, which will presumably be a stock kernel with superuser (2.3.6.1) and "Secure mode" (from Chainfire's first post).
Reading the help for heimdall (heimdall --help) I think in order to do this I will (after putting the phone into Update mode and connecting to the computer) have to use the following...
Code:
heimdall flash --kernel zImage
...in order to flash the phone with CF-Root.
My questions are...
Is there a newer version of CF-Root for the kernel version I have?
I've tried various searches on the original CF-Root thread, but haven't found anything yet in the 300+ pages.
Do I need a newer version of CF-Root?
Version 4.2 has a newer version of "Superuser" and Version 5.0 includes busybox (a set of utilities for embedded systems, common to lots of Linux distros), and ClockworkMod. What am I missing by not having these, and can they be installed independently if I forge ahead with 4.1?
Is the above the correct way to use Heimdall to flash with CF-Root (as CF-Root is just a kernel)?
I'm wary of bricking my phone, and have been trying to find others who have done similar but not had much joy hence the dumb questions.
Any insights/advice greatly appreciated,
Cheers,
enilkcals
EDIT : Ok, found an archived thread with a post from penedo @ 1st July 2011, 12:36 PM who seems to have been trying similar (flashing CF-Root using heimdall) and it confirms that my interpretation/intended use of the command-line Heimdall is correct (or on the right tracks!). If anyone knows of a newer version of CF-Root or could explain what I'm missing out on by not having ClockworkMod and other things in newer CF-Root versions that would be great.
Right, sussed out how to use the GUI Frontend thanks to this post.
Pretty sure using the above command would have achieved the same thing.
Having gone with v4.2 I can now say that it includes ClockworkMod (presumably custom as detailed in Chainfire's original thread) and a Superuse app.
Hope others find this useful.
enilkcals
a great one enilkcals
thanks for forwarding

[Q] Looking for CWM porting help

I have been working tirelessly on getting a working CWM recovery built from source to work on this device. The device is the BLU Studio 5.5, also known as the 'd610'. I am attempting to compile from the cm-10.1 branch
My current device tree for the device can be found here.
What I have tried so far:
-modifying BoardConfig.mk and recovery.fstab to match what I am able to pull from the device and adding the init.rc and its dependencies into the recovery build (did not boot)
-building the recovery of another very similar MTK6589 device and using the kernel pulled from the d610 instead. (did not boot)
-forked the device tree of this very similar device, and made slight modifications to BoardConfig for my device, as well as swapping the kernel (again, did not boot)
I have absolutely no idea what is going wrong in my process. All of the builds of CWM compile fine, and are being flashed via mtk-tools just fine. Though something is not allowing these builds to boot into recovery. I think I may be missing some important information on the MTK6589 or Mediatek in general.
Thank you for any input you guys can offer.
Also, if I am in the wrong section, if a moderator could kindly place it in the correct section, that would be great!
From a quick glance I can tell you are missing ramdisk address offset, these are are usually hardcoded in the BL, you can check the address from boot image header
Sent from my LG-D605 using Tapatalk
Okay I will be adding that in here shortly. I haven't seen that flag used very often in BoardConfig when I look at other device trees. Is it possible that anyone could explain why some devices may need the flag while others don't?
And again thank you for your response!
EDIT: added ramdisk offset arguments, and still no luck on getting the recovery to boot.
Sent from my Nexus 5 using XDA Free mobile app
Update: I am trying to unpack my recovery.img files after compilation using these scripts, which have always worked for me in the past. Now that I am trying to unpack after these are built, I am finding that they are unable to detect the ramdisk in the recovery.img. I think this may be because the ramdisk may be in the wrong place. Though I have built the recovery with and without the offset flags, and still it cannot detect the ramdisk.
Also, I pushed more of the proper files that were pulled from the stock recovery.
I have also decided that I am willing to offer a small bounty to anyone that wants to help me find the solution along with some explanation of where it went wrong.

[Q] How do I troubleshoot an image I developed from Samsung Source for Note 3

I have successfully compiled source I downloaded from Samsung on Ubuntu build environment I set up myself and used toolchain to compile it. Everything went without a problem. When I flash the phone, it goes into download mode. My question is how can I troubleshoot the problem? I flashed the phone with a working stock image, and pulled the logs with logcat and searched it for various keywords ( tar, boot, image ) that might give me an indication of what is wrong. But I did not see anything that stands out. I basically used one of the scripts in beasttools kit to replace my zImage with the zImage of a working rom I downloaded from SamMobile. I'll be glad to provide more details, if this is the appropriate group to discuss it and someone is willing to have a look at what I have done.

[DEV] Compiled Stock Kernel + Sources

Compiled Stock Kernel + Sources
*insert usual disclaimer here*
I AM NOT RESPONSIBLE FOR ANY DAMAGE TO YOUR DEVICE. USE AT YOUR OWN RISK. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Testing? What will work?
Bugs:
- You tell me
INSTRUCTIONS
0. MAKE BACKUP
1. Download zip file
2. Download Magisk
3. Download Magisk fix
4. Flash Magisk
5. Flash Magisk fix
6. Flash Kernel zip
Resources:
SOURCE CODE
DOWNLOAD {Mod edit}
Credits:
karthick111
@datty
Hi mKenfenheuer, thanks for the credit.
I'm at the same point, I can get the kernel to build but no boot. I get dropped back to fastboot immediately after trying to boot.
I've tried flashing a blank vbmeta, but it didn't seem to help. I'm not sure if it is the AVB2.0 blocking the boot or something else.
I've noticed you've changed OPPO_TARGET_DEVICE to MSM_19061. How did you decide on that value? I've since been using MSM_19781 as that is the value of getprop ro.product.prjversion from my device (Malaysian version)
datty said:
Hi mKenfenheuer, thanks for the credit.
I'm at the same point, I can get the kernel to build but no boot. I get dropped back to fastboot immediately after trying to boot.
I've tried flashing a blank vbmeta, but it didn't seem to help. I'm not sure if it is the AVB2.0 blocking the boot or something else.
I've noticed you've changed OPPO_TARGET_DEVICE to MSM_19061. How did you decide on that value? I've since been using MSM_19781 as that is the value of getprop ro.product.prjversion from my device (Malaysian version)
Click to expand...
Click to collapse
Same behaviour for me. I've started with the target device mentioned in your repo, then changed to 19781, afterwards i've been trying out the ones from drivers/input/oppo_fp_driver/Makefile. I've just been stuck at 19061 since it was the last one i've tried, there is no specific reason for that.
I've not been working with devices with AVB 2.0 - i can see that my device is displaying "Secureboot enabled" in fastboot. As far as i can say this would be a pretty good reason for the device to refuse booting the new kernel as our kernel is probably not signed.
I'll look into signing the kernel with the dev key in the repo root. Maybe this helps. If not we would problaby need another solution to get around the secure boot.
I've made some progress, I can get the kernel to try to boot but I'm stuck at the realme logo without adb to debug what is wrong.
If you're using the kernel config extracted from the device, add the following config option.
CONFIG_BUILD_ARM64_DT_OVERLAY=y
I'm not sure if this is also necessary but I generated a new dtbo.img to flash from the compiled kernel.
You'll need mkdtboimg.py and you can run the following from the out/arch/arm64/boot directory after compilation.
python mkdtboimg.py create dtbo.img dts/*/*.dtbo
You can try to compare arter97 realme X kernel to raw source if it's any helpful.
datty said:
I've made some progress, I can get the kernel to try to boot but I'm stuck at the realme logo without adb to debug what is wrong.
If you're using the kernel config extracted from the device, add the following config option.
CONFIG_BUILD_ARM64_DT_OVERLAY=y
I'm not sure if this is also necessary but I generated a new dtbo.img to flash from the compiled kernel.
You'll need mkdtboimg.py and you can run the following from the out/arch/arm64/boot directory after compilation.
python mkdtboimg.py create dtbo.img dts/*/*.dtbo
Click to expand...
Click to collapse
Unfortunately i cannot. even with the config option i am still not able to get it booting.
I have created a repo to reflect how i am building the kernel and making the boot img + dtbo img.
https://github.com/mKenfenheuer/realme-X2Pro-kernel-build
Am i missing something? Also i assume that my generated dtbo.img is bad, as soon as i flash it, i cannot even boot to recovery.
This is a long shot but as @SHiFT! pointed out, maybe comparing the source of @arter97 can help us getthing this mess to boot.
mKenfenheuer said:
Unfortunately i cannot. even with the config option i am still not able to get it booting.
I have created a repo to reflect how i am building the kernel and making the boot img + dtbo img.
https://github.com/mKenfenheuer/realme-X2Pro-kernel-build
Am i missing something? Also i assume that my generated dtbo.img is bad, as soon as i flash it, i cannot even boot to recovery.
Click to expand...
Click to collapse
Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:
make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs
For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.
I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.
I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.
Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.
datty said:
Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:
make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs
For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.
I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.
I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.
Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.
Click to expand...
Click to collapse
My kernel is booting now, but wifi and aod are causing issues.
As for now, the zip requires magisk to be flashed first.
I've had some chat with other devs working on our devices kernel in the official telegram group, they're in touch with realme, realme will release their wifi driver from qualcomm soon on their github.
Credits for getting me up to here go to karthick111 from the telegram group.
Realme kernel source code got updated. Any great news?
BlazeMaster64 said:
Realme kernel source code got updated. Any great news?
Click to expand...
Click to collapse
No. I've imported the changes by realme, things got worse. Now the kernel is not booting anymore.
I'll look into this once i've got more time
mKenfenheuer said:
No. I've imported the changes by realme, things got worse. Now the kernel is not booting anymore.
I'll look into this once i've got more time
Click to expand...
Click to collapse
Do you think this phone is worth buying over xiaomi redmi k20 pro?
BlazeMaster64 said:
Do you think this phone is worth buying over xiaomi redmi k20 pro?
Click to expand...
Click to collapse
Of course it's a better phone in almost all terms
Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).
So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).
All changes can be found in my github repo so feel free to fork!
mKenfenheuer said:
Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).
So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).
All changes can be found in my github repo so feel free to fork!
Click to expand...
Click to collapse
Good job ,that's a good news Go on
If I may ask after you finish working in the kernel would it be easy to build custom roms with the help of your kernel ,Thanks to you
Hi. Thank you for your kernel. I'm a bit noob about kernel, so it's difficult to me understand kernel's features. What's this kernel different then the stock one?
asusgarb said:
Hi. Thank you for your kernel. I'm a bit noob about kernel, so it's difficult to me understand kernel's features. What's this kernel different then the stock one?
Click to expand...
Click to collapse
It's a work in progress to have a working kernel base for our phone which will then be useful for other people to build their own customized kernel with it.
Is the FP issue an kernel related issue? Or overlay?
natedogg20050 said:
Is the FP issue an kernel related issue? Or overlay?
Click to expand...
Click to collapse
What do you mean by FP issue? In case you are refering to the issues with GSI's, check out the issues on phhussons github:
https://github.com/phhusson/treble_experimentations/issues/1103
The cause of this is Realme/Oppo not sticking to standards and of course the fact that the in display fp reader is quite new and does not have any generic stock implementation yet.
So TL;DR its not a kernel issue. Phhusson is working on this with Google.
realme x2pro cm rom
---------- Post added at 12:22 PM ---------- Previous post was at 12:17 PM ----------
John Amin said:
Good job ,that's a good news Go on
If I may ask after you finish working in the kernel would it be easy to build custom roms with the help of your kernel ,Thanks to you
Click to expand...
Click to collapse
sir videos

Categories

Resources