[DEV] Kernel Compiling - Galaxy S I9000 General

Hi all! I'm not a dev but i really want to do something for this phone so i'm trying to build a custom kernel.... if anyone have tried the same report here the issue, i will do the same!

I have the pre-requisites for compiling a kernel set up. However I am more interested in getting ClockworkMod Recovery working on our phone as that will encourage developers and we can then start looking at getting CyanogenMod 7. I made a topic here asking for help but I haven't received any replies yet.

I have just compiled a kernel but it doesn't work.... this because - i think - i used the initramfs provided by leshak for the i9000.... now i'm trying to extract from phone......

Kernel
Hi Skin1980, I also compiled a (stock) Kernel two weeks ago - problem is, Samsung does not use the "normal" way of storing it in a boot.img file. That is why I wasn't able to push it to the phone or at least fastboot it. I would be glad to hear from you how exactly this is possible, if you find out.

XDA_Bam said:
Hi Skin1980, I also compiled a (stock) Kernel two weeks ago - problem is, Samsung does not use the "normal" way of storing it in a boot.img file. That is why I wasn't able to push it to the phone or at least fastboot it. I would be glad to hear from you how exactly this is possible, if you find out.
Click to expand...
Click to collapse
I used the redbend_ua you can find here to write zImage to bml7.... how do you do with initramfs that is missed when you build the kernel?

Skin1980 said:
I used the redbend_ua you can find here to write zImage to bml7.... how do you do with initramfs that is missed when you build the kernel?
Click to expand...
Click to collapse
Have you managed to extract initramfs with redbend_ua?
If you don't mind, please take a look at this post. There is a step build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img. Because Samsung doesn't use this boot.img building a recovery looks tricky. Any suggestions would help.

rb210 said:
Have you managed to extract initramfs with redbend_ua?
If you don't mind, please take a look at this post. There is a step build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img. Because Samsung doesn't use this boot.img building a recovery looks tricky. Any suggestions would help.
Click to expand...
Click to collapse
I dumped the bml7 partition, i see that inside there's a zimage... but i'm not able to extract this f u c .......initramfs!!!!!

rb210 said:
Have you managed to extract initramfs with redbend_ua?
If you don't mind, please take a look at this post. There is a step build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img. Because Samsung doesn't use this boot.img building a recovery looks tricky. Any suggestions would help.
Click to expand...
Click to collapse
and if we can find the initramfs i think that is not difficult to modify the recovery to allow unsigned zip files installation

Perhaps, we could use parts of the following method:
h**p://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images
To extract the ramdisk from the boot.img, they do the following:
Then, look for a bunch of zeroes followed by the hex 1F 8B (which is the magic number of a gzip file). Copy everything from the first line of the file, through the zeroes, and stopping at the 1F 8B. That is the kernel. Everything from the 1F 8B through the end is the ramdisk. You could save each of these files separately. In order to see the contents of the ramdisk, you need to un-gzip it and then un-cpio it.
Click to expand...
Click to collapse
I know that we don't have a boot.img, but we do have an image including kernel and ramdisk - this should be very similar. And if you can locate the named headers in the file, the extraction should work. Further info and some useful commands can be found behind the link.
Sadly, I won't have time to try this before next weekend...

XDA_Bam said:
Perhaps, we could use parts of the following method:
h**p://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images
To extract the ramdisk from the boot.img, they do the following:
I know that we don't have a boot.img, but we do have an image including kernel and ramdisk - this should be very similar. And if you can locate the named headers in the file, the extraction should work. Further info and some useful commands can be found behind the link.
Sadly, I won't have time to try this before next weekend...
Click to expand...
Click to collapse
Which file are you referring to? I have some time, I can give it a shot.
EDIT: I found "initramfs.c" and its object file "initramfs.o" under GT-I9003_Kernel/kernel/Kernel/init from the Samsung opensource tarball. Don't think that helps us though.

@rb210: I mean the dumped bml7 partition. It's an image of a partition with a kernel and ramdisk in it, or did I misunderstand something?
PS: You could try "SGS kernel flasher" from the market. It's got a backup option - look if it does produce the same image of the bml7 partition (I tried it, it did a backup image of around 8MB on my SGSL, which is about the size of bml7, as far as I remember). It would be faster and easier to carry out than using a script.

XDA_Bam said:
@rb210: I mean the dumped bml7 partition. It's an image of a partition with a kernel and ramdisk in it, or did I misunderstand something?
PS: You could try "SGS kernel flasher" from the market. It's got a backup option - look if it does produce the same image of the bml7 partition (I tried it, it did a backup image of around 8MB on my SGSL, which is about the size of bml7, as far as I remember). It would be faster and easier to carry out than using a script.
Click to expand...
Click to collapse
But ramdisk=initramfs?

XDA_Bam said:
@rb210: I mean the dumped bml7 partition. It's an image of a partition with a kernel and ramdisk in it, or did I misunderstand something?
PS: You could try "SGS kernel flasher" from the market. It's got a backup option - look if it does produce the same image of the bml7 partition (I tried it, it did a backup image of around 8MB on my SGSL, which is about the size of bml7, as far as I remember). It would be faster and easier to carry out than using a script.
Click to expand...
Click to collapse
Ah I see what you mean. I was trying to figure out how to extract the initramfs from the opensource package from the Samsung website. I figure if they're providing the kernel and platform, there's got to be an initramfs somewhere. You'll are talking about trying to extract it from inside the phone itself.
I'm still not sure how this is going to fit in with porting Clockworkmod as per that method in the blog post because it's still an initramfs and not a boot.img. Getting custom recovery is vital to attracting development for this phone, we should not make the mistake of overlooking this.

Tools for extract initramfs from a zImage : https://github.com/project-voodoo/kernel_repack_utils

Related

[Q] Making those NAND System.img files

Howdy all,
Just wondering, how are the system.img files made? I have read that if it's a YAFFS image file, that the maximum filesize cannot exceed 128MB. However, I've seen on some NAND HD2 Android builds, the system.img filesize is >128MB.
My question is, what method are you guys using for making the NAND system.img files to flash within MAGLDR? (ie. is it like a ZIP archive with a .img extension on it)
I'm currently working on a remix of a ROM that I use (a hint is in my Sig), and I know that the update.zip method that was used on "true-Android" devices to change ROMs doesn't apply to our MAGLDR method now.
Cheers and I'm sure you'll see another ROM for the HD2 in the coming weeks!
IcedCube.
IcedCube said:
Howdy all,
Just wondering, how are the system.img files made? I have read that if it's a YAFFS image file, that the maximum filesize cannot exceed 128MB. However, I've seen on some NAND HD2 Android builds, the system.img filesize is >128MB.
My question is, what method are you guys using for making the NAND system.img files to flash within MAGLDR? (ie. is it like a ZIP archive with a .img extension on it)
I'm currently working on a remix of a ROM that I use (a hint is in my Sig), and I know that the update.zip method that was used on "true-Android" devices to change ROMs doesn't apply to our MAGLDR method now.
Cheers and I'm sure you'll see another ROM for the HD2 in the coming weeks!
IcedCube.
Click to expand...
Click to collapse
The system.img is a yaffs2image. Google 'compiled windows unyaffs' use that program to take a peak inside the .img. When you're completely ready to make your own .img your gonna need a linux distro or cygwin w/mkyaff2image compiled. However I recomend compiling the mkfs.yaffs2 command if you are using linux. Alternatively you can place the /system/ directory you are trying to make an image on your SD and run that command in the terminal emulator in Android. It should look like this #mkyaffs2image /sdcard/system/ System.img
Hope that helps.
KillaHurtz said:
The system.img is a yaffs2image. Google 'compiled windows unyaffs' use that program to take a peak inside the .img.
Click to expand...
Click to collapse
Does this give you write abilities so that files can be changed out pre-flash?
dharvey4651 said:
Does this give you write abilities so that files can be changed out pre-flash?
Click to expand...
Click to collapse
I think you have to dump them to a folder, then you can change what you want. Then do the yaffs2 cmd and it will package it back up to .img for flashing...
Chris
noellenchris said:
I think you have to dump them to a folder, then you can change what you want. Then do the yaffs2 cmd and it will package it back up to .img for flashing...
Chris
Click to expand...
Click to collapse
I think that a tutorial is in order. Someone who knows how to extract and replace files in a system.img needs to write a short tutorial on how to do it. - A simple step by step on how to decompile a system.img and re-compile it.
I for one would be extremely grateful because I finally worked out a perfect MMS patch and I'd like to be able to easily modify the builds pre-flash.
dharvey4651 said:
I think that a tutorial is in order. Someone who knows how to extract and replace files in a system.img needs to write a short tutorial on how to do it.
I for one would be extremely grateful because I finally worked out a perfect MMS patch and I'd like to be able to easily modify the builds pre-flash.
Click to expand...
Click to collapse
I have been trying to do that all night. I can unpack them but haven't got around to repacking them. For now all I do is install the build and push the patched file that I have and do a AD hardrest in MAGLDR. MMS 300-1024k and all TMO US app works.
dharvey4651 said:
I think that a tutorial is in order. Someone who knows how to extract and replace files in a system.img needs to write a short tutorial on how to do it. - A simple step by step on how to decompile a system.img and re-compile it.
I for one would be extremely grateful because I finally worked out a perfect MMS patch and I'd like to be able to easily modify the builds pre-flash.
Click to expand...
Click to collapse
yeah, it would be very nice if smb can write some tutorial on modifying system.img files
i have been trying to figure this out too!
IcedCube said:
This is IcedCube, the Developer of GingerHD2, a Android 2.3 ROM for your HD2.
Click to expand...
Click to collapse
Thought I should point out that you could really confuse things by using that name...
http://forum.xda-developers.com/showthread.php?t=871387
That's not actually a Gingerbread build - it's just themed to look like one, but still got the same name
hnamanh said:
I have been trying to do that all night. I can unpack them but haven't got around to repacking them. For now all I do is install the build and push the patched file that I have and do a AD hardrest in MAGLDR. MMS 300-1024k and all TMO US app works.
Click to expand...
Click to collapse
Another option is to connect to ADB or Android Commander before going through the initial setup(when it asks you to choose your language) and change the files then - use the PC to reboot the phone, not the phone's built-in reboot. This should take you right back to the setup screen where this time, should show United States localization.
Still a bit too much work. I'd like to be able to patch the build, flash it, and be good to go.
found this but too educated for me
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
sorry i think this one is normal data img.not sure.
well i did say it was too educated for me
Turorial
KillaHurtz said:
The system.img is a yaffs2image. Google 'compiled windows unyaffs' use that program to take a peak inside the .img. When you're completely ready to make your own .img your gonna need a linux distro or cygwin w/mkyaff2image compiled. However I recomend compiling the mkfs.yaffs2 command if you are using linux. Alternatively you can place the /system/ directory you are trying to make an image on your SD and run that command in the terminal emulator in Android. It should look like this #mkyaffs2image /sdcard/system/ System.img
Hope that helps.
Click to expand...
Click to collapse
Windows
-----------------------------------------------------------------------------
Ok, let's start again. If you are using windows, google the said phrase above and you will find the precompiled utility 'unyaffs'.
Place the System.img you want to extract in a new directory with unyaffs.exe & drag the .img onto unyaffs. A command window will open and start extracting the files in the image to that same folder. You can now explore & edit/pull whatever you need to get things going. Once you have it the way you want copt it to your SD/root/ & make a folder for it with an obvious name like "Project" or "Test". Now to get it back into a bootable .img open Terminal Emulator in Android & enter the following
#mkyaffs2image /sdcard/NAMEofFOLDERuCHOSE/ System.img
**alternatively you can do this in windows itself if u have the utility compiled under cygwin or simular.
Linux
-----------------------------------------------------------------------------
Ok, you will need the unyaffs & mkfs.yaffs2 utilities compiled and working 1st off.
mkyaffs2image works to make the image however it fails upon flash with DFT Android Flasher. So I recomend mkfs.yaffs2 & have included it, you will need to place it in /usr/sbin/. If you have trouble copying it open a terminal and run "gksudo nautilus" then copy to the above mentioned directory.
**Now that those utilities are working let's get to work.
open a terminal and run 'unyaffs /home/yourusername/Desktop/targetdirectory/targetimage.img
copy/edit/pull the files you want. When your ready to build the image you are happy with open a terminal and run 'mkfs.yaffs2 /home/yourusername/Desktop/targetdirectory/ System.img'
Now your ready to flash !
System.img & Boot.img Contents
============================================================
System.img contains the entire root/system/ directory in Android
System/
app
bin
etc
fonts
framework
lib
lost+found
media
usr
xbin
build.prop
dmesg.txt
Boot.img contains
Boot/
initrd.gz
zImage
lost+found
============================================================
Hope that helps guys, It's my first tut on XDA
**EDIT: I included an archive for windows users that has unyaffs2.exe & cygwin1.dll
The Linux archive contains mkfs.yaffs2.x86, once moved to /usr/sbin/ rename to mkfs.yaffs2
The process works exactly the same for Boot.img
you need linux and run command by terminal
put them in /bin
http://www23.zippyshare.com/v/13814384/file.html
then you can yaffs or unyaffs
example
unyaffs /home/rafpigna/folder_with_img_you_wann_unpack/system.img
or
mkyaffs2image /home/rafpigna/folder_with_stuff_you_wanna_pack/ system.img
strange thing...when I open with unyaffs and then close with mkfs.yaffs2 or mkyaffs2image I get init: untracked pid 250 exited (where 250 varies) in a loop :S
some light for me?
michyprima said:
strange thing...when I open with unyaffs and then close with mkfs.yaffs2 or mkyaffs2image I get init: untracked pid 250 exited (where 250 varies) in a loop :S
some light for me?
Click to expand...
Click to collapse
What platform are you using? Have u tried copying your target directory to your sdcard and running the command in android's terminal?
Reguards
KillaHurtz said:
What platform are you using? Have u tried copying your target directory to your sdcard and running the command in android's terminal?
Reguards
Click to expand...
Click to collapse
linux x64.
btw no I didn't, because I want to make a rom (I'm not new to android development but that makes me think that I'm probably stupid )
Everything I do doesn't work.
Already tried something like:
- opened a premade working rom, exchanged just app and framework: no way
- exchanged everything but not bin/xbin/lib: no way
- exchanged just what was different between a stock and a premade leo rom: still no way
mmmh...
yaffs2
There is actually a way to modify files in a yaffs2 image but I've not done it my self yet. I'm 100% sure it's possible cuz everything is possible.... under Linux of course.
You need:
Linux, compiling skills, mounting skills, etc.
Basically for any other filesystems you can mount them as loop devices but not yaffs2. For yaffs2 you actually need a virtual mtd block device. once you have the mtd device you can mount the yaffs image on it.
For details google for: mounting yaffs image
and focus on virtual mtd block device.
michyprima said:
linux x64.
btw no I didn't, because I want to make a rom (I'm not new to android development but that makes me think that I'm probably stupid )
Everything I do doesn't work.
Already tried something like:
- opened a premade working rom, exchanged just app and framework: no way
- exchanged everything but not bin/xbin/lib: no way
- exchanged just what was different between a stock and a premade leo rom: still no way
mmmh...
Click to expand...
Click to collapse
http://www.miui-dev.com/forums/showthread.php?481-Howto-Make-your-own-Android-Build-for-the-HD2
This has a list of files to be pulled. Hope this helps. BTW michy I need help with a kernel, know anyone?
I'm Having a problem using on Linix, when i use the unyaffs trough the terminal it extracts the rom but not the squashed contents, which in the main apps and frame work are at on thoughs roms. I do get a file that says squashed but empty. I tried on cyanogens 6.1 rom and everything extracted fine.but that rom does not have a squashed folder, am i doing something wrong?
1. If i unyaffs System.img and manually remove some programs/aplications then create System.img with yaffs, does it programs will appear in apps and does my rom will be caused a more memory for other programs for installation?
2. Is it possible to unyaffs Boot.img then replace zimage with newest kernel like MDJ or hastarin then yaffs to new Boot.img, After that i suppose then this Android OS will be on new kernel???
3. And... If i remove zimage and initrd.gz from Boot.img, create new Boot.img without these two files and these two files copy to SD card and define that two files in flash.cfg for find on SD. Does it works?
Sorry for bad English.

Porting ClockworkMod - Kernel is 1.8GB!

Hey guys,
I am trying to port the ClockworkMod recovery to the incredible S, and everything goes fine until the last step, getting the files neccessary from the recovery image using mkvendor.sh works, but it produces a kernel that is 1.8GB (!), so when I go to build, the recovery is far too large and it aborts.
Anyone know why this might be happening? Surely the kernel can't be that big, the recovery partition is only ~8.5MB and the dd of the recovery come out the same, so how is the kernel so huge?
Any help will be greatly appreciated
EDIT I have uploaded the dump if anyone needs / wants to take a look: http://www.multiupload.com/JSY1HUI6Y7
What guide are you following, if any?
For example
marcnvidic said:
What guide are you following, if any?
For example
Click to expand...
Click to collapse
Yes, that's the guide I initially used
l0st.prophet said:
produces a kernel that is 1.8GB (!)
Click to expand...
Click to collapse
Try this,
Get a working ROM for the Incredible S, and extract boot.img
Extract the the kernel from the .img and place it in your
Code:
<android-source-root>/out/target/product/<phone>/
-- overwriting the 1.8GB kernel (ie recovery-kernel)
Then run
Code:
make recoveryimage
to pack it into an img
I got a file called boot.img-kernel.gz which wouldn't open as an archive so I just renamed it 'kernel' and that got the image built... now to see if it flashes! thanks for the pointer

Unpack stock System.img?

Hello Moto
I've just downloaded Verizon Jelly Bean 4.1.1 by "Firmware Team".
Just to play with it a little, extract apks and test them on Galaxy SII Skyrocket.
The thing is i'm having a hard time opening system.img.
Now i've tried LinuxReader, Unyaffs and ext2explore/read but none of these can open it, they all say that it's an unrecognized image.
Do you guys know how to properly open a stock moto System.img?
lingowistico said:
Hello Moto
I've just downloaded Verizon Jelly Bean 4.1.1 by "Firmware Team".
Just to play with it a little, extract apks and test them on Galaxy SII Skyrocket.
The thing is i'm having a hard time opening system.img.
Now i've tried LinuxReader, Unyaffs and ext2explore/read but none of these can open it, they all say that it's an unrecognized image.
Do you guys know how to properly open a stock moto System.img?
Click to expand...
Click to collapse
Google for a tool called simg2img (I used the python script that appears in get first few results, there should be other versions as well). That will unpack the image into a plain ext4 image that you can mount with any Linux pc (I recommend using a virtual machine if you have windows or mac).
Happy hacking!
Sent from my XT907
aslomagic, did you try this with the firmware lingowistico is talking about? I also tried before to unpack system.img from this package, and system.img.ext4 from ICS package, and another ICS soft for XT897, and all of them give "Bad magic" error in simg2img. All of those softs are published by the same "Firmware Team" - maybe that's the case? I also tried dsixda kitchen (which also uses simg2img, but anyway...) and it also didn't work. Might be also some custom Motorola's approach to system.img....
Could you possibly help? Thanks.
micx_pl said:
aslomagic, did you try this with the firmware lingowistico is talking about? I also tried before to unpack system.img from this package, and system.img.ext4 from ICS package, and another ICS soft for XT897, and all of them give "Bad magic" error in simg2img. All of those softs are published by the same "Firmware Team" - maybe that's the case? I also tried dsixda kitchen (which also uses simg2img, but anyway...) and it also didn't work. Might be also some custom Motorola's approach to system.img....
Could you possibly help? Thanks.
Click to expand...
Click to collapse
Well, I know for a fact that those images are packed ext4, but I haven't tried specifically with that one.
Now that you mention, I think I remember signed images (like those ones) have some additional header, maybe that needs to be removed with an hex editor, or with dd of you like
If I get a chance, I'll try and report back...
Sent from my XT907
aslomagic said:
Well, I know for a fact that those images are packed ext4, but I haven't tried specifically with that one.
Now that you mention, I think I remember signed images (like those ones) have some additional header, maybe that needs to be removed with an hex editor, or with dd of you like
If I get a chance, I'll try and report back...
Click to expand...
Click to collapse
Ok, I tried, and yes, it complains it cannot find the magic (again, I'm using the python script). I modified the script to look for the magic value in the first 50Mb of the file, and if it finds it, it starts unpacking from there. Python scripts are very easy to play with
It seems to work for me, but I don't have a linux vm handy to see if it mounts correctly (I'm currently on a mac). micx_pl, can you give it a try and let me know?
I had to zip the file even though it's very small because the forum won't let me upload a .py file... who knows, just unzip it.
Holy cow! It works! You're the master I was looking for such solution everywhere, and was stunned to see barely few topics with similar problem, and no solution at all. Thanks!
micx_pl said:
Holy cow! It works! You're the master I was looking for such solution everywhere, and was stunned to see barely few topics with similar problem, and no solution at all. Thanks!
Click to expand...
Click to collapse
You're welcome, glad I could help!
Sent from my XT907
aslomagic said:
Ok, I tried, and yes, it complains it cannot find the magic (again, I'm using the python script). I modified the script to look for the magic value in the first 50Mb of the file, and if it finds it, it starts unpacking from there. Python scripts are very easy to play with
It seems to work for me, but I don't have a linux vm handy to see if it mounts correctly (I'm currently on a mac). micx_pl, can you give it a try and let me know?
I had to zip the file even though it's very small because the forum won't let me upload a .py file... who knows, just unzip it.
Click to expand...
Click to collapse
HOLY $#!+ THANKS!!! I've been trying to decompress the moto images for awhile and have never been able to do it until now
Would it be possible to modify make_ext4fs to re-sparse the image and copy the original signature?
Q9Nap said:
Would it be possible to modify make_ext4fs to re-sparse the image and copy the original signature?
Click to expand...
Click to collapse
You're welcome to try ... my guess is that it could be made to work if the image was an official, originally signed image that was unpacked by the script above or equivalent, but if you want to modify it, re-pack it and re-attach the signature, most likely the signature won't match the content. But I may be wrong, so if somebody is willing to try, best of luck to you
If your goal is just to create a packed image, but not necessarily signed (needs bootloader unlock), then I'd say it's definitely possible, search around here.
aslomagic said:
You're welcome to try ... my guess is that it could be made to work if the image was an official, originally signed image that was unpacked by the script above or equivalent, but if you want to modify it, re-pack it and re-attach the signature, most likely the signature won't match the content. But I may be wrong, so if somebody is willing to try, best of luck to you
If your goal is just to create a packed image, but not necessarily signed (needs bootloader unlock), then I'd say it's definitely possible, search around here.
Click to expand...
Click to collapse
i'm sure you're right about the signature not working on a modified image; it was just wishful thinking. the idea of course would be to inject superuser.apk and su, which wouldn't be necessary on a bootloader unlocked device.
for bootloader unlocked devices though, the ability to repack a modified image does give you another way to build custom roms. here's the code to unpack and repack images with simg2img.py and make_ext4fs:
Code:
mkdir system
./simg2img.py system.img.ext4 system.raw
sudo mount -t ext4 -o loop system.raw system/
#make changes, then:
wc -c system.raw #lists size in bytes of system.raw
sudo make_ext4fs -s -l 1234567890 -a system system.img system/ #where 1234567890 is output from wc -c
sudo umount system
rm -rf system
i've used this proecess with samsung system images, should work for moto images now too (bootloader unlocked, of course)
Yep, it's a good cheat sheet reference
Besides, on razr m and hd at least, you can also use this with safestrap without unlocking the bootloader.
aslomagic said:
Besides, on razr m and hd at least, you can also use this with safestrap without unlocking the bootloader.
Click to expand...
Click to collapse
Not sure what you mean by this; do you mean you could mount a modified system.img with safestrap? I guess it's possible since safestrap uses a system.img on the emmc, interesting idea
Q9Nap said:
Not sure what you mean by this; do you mean you could mount a modified system.img with safestrap? I guess it's possible since safestrap uses a system.img on the emmc, interesting idea
Click to expand...
Click to collapse
Yes, that's what I mean, more or less. You don't need safestrap to just mount it (use the terminal and "mount"), but you can use it to boot from it and try it.
I did this to try the Telstra image that pjcons dumped, which is pre-rooted and not signed (there it's no official signed image to date), and with a few tricks it worked without me having to unlock the bootloader.
Sent from my XT907
aslomagic said:
Google for a tool called simg2img (I used the python script that appears in get first few results, there should be other versions as well). That will unpack the image into a plain ext4 image that you can mount with any Linux pc (I recommend using a virtual machine if you have windows or mac).
Happy hacking!
Sent from my XT907
Click to expand...
Click to collapse
hello, i cant find anything on the basics of how this works, could you point me somewhere that explains it step by step or do one here. sorry of the noob question
TheWhiteChallenger said:
hello, i cant find anything on the basics of how this works, could you point me somewhere that explains it step by step or do one here. sorry of the noob question
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1588461
CNexus said:
http://forum.xda-developers.com/showthread.php?t=1588461
Click to expand...
Click to collapse
Thanks for the link I need to go learn Linux now. Lol I dontbgt the virtual machine thing at all. Its basically a Linux emulator right?
Sent from my XT1080 using XDA Premium 4 mobile app
TheWhiteChallenger said:
Thanks for the link I need to go learn Linux now. Lol I dontbgt the virtual machine thing at all. Its basically a Linux emulator right?
Sent from my XT1080 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
No need to
http://sourceforge.net/projects/androidicsjbext/
CNexus said:
No need to
http://sourceforge.net/projects/androidicsjbext/
Click to expand...
Click to collapse
oh damn it. ok first i do appreciate the help. but that sucked. that was the frist program i tryed and it gives me "unknown file format" have i just been screwing up from the begining?

[Utility] Android Image Kitchen &amp;amp; Flasher APK

Hi all , I'm new here and I would like to present to you this simple application which backup, edit, repack and flash kernel.img or recovery img with a single click.
This apk need root.
All credit of unpak/repack tools used in my apk are to @osm0sis
atoxyd said:
Hi all , I'm new here and I would like to present to you this simple application which backup, edit, repack and flash kernel.img or recovery img with a single click.
This apk need root.
Click to expand...
Click to collapse
can I use this on snapdragon 615 stock kernel
Sent from my 6045X using Tapatalk
Yes, you can try
tested on htc desire 816, cm13
unpacks and repacks kernel and ramdisk successfully, but didn't extract or repack the dtbs (device tables image, kernel 3.4) so the repacked image won't boot.
Well I use in my apk AIK.mobile tools proposed by osm0sis.
atoxyd said:
Well I use in my apk AIK.mobile tools proposed by osm0sis.
Click to expand...
Click to collapse
https://github.com/osm0sis/AnyKernel2/ ?
from http://forum.xda-developers.com/showthread.php?t=2670512
bigsupersquid said:
tested on htc desire 816, cm13
unpacks and repacks kernel and ramdisk successfully, but didn't extract or repack the dtbs (device tables image, kernel 3.4) so the repacked image won't boot.
Click to expand...
Click to collapse
Hi, I test it on cm13 and I unpack recovery.img for HTC desire 816, I think it work fine.
If the apk didn't work properly that's means the boot image doesn't not following Google's standard format so you'll need to find other tools to unpack and edit your image.
atoxyd said:
Hi, I test it on cm13 and I unpack recovery.img for HTC desire 816, I think it work fine.
If the apk didn't work properly that's means the boot image doesn't not following Google's standard format so you'll need to find other tools to unpack and edit your image.
Click to expand...
Click to collapse
I can unpack, edit, and repack successfully.
but, it wont boot.
I used official twrp 3.0.0-0 recovery.img and cm13 boot.img both, tried without editing.
just unpack/repack/flash.
boots straight into hboot, which is what happens if I build a boot.img or recovery.img without dtbs.
I pointed to the anykernel2 link because I know its scripting handles dtbs.
the whole kernel device table thing is new to me, and so far only on this device, so I'm not very savvy with dtb work. been lucky enough that it was preconfigured in the build system for cm.
nero curin said:
can I use this on snapdragon 615 stock kernel
Sent from my 6045X using Tapatalk
Click to expand...
Click to collapse
Hi, did my apk work for you?
atoxyd said:
Hi, did my apk work for you?
Click to expand...
Click to collapse
only unpacking and repacking,didnt help on my device but yet again nothing else helps me compile kernel for this idol 3 so i guess this app works just not for me, bad luck :/
Sent from my 6045X using Tapatalk
Well, this is a beta version of my apk, only for testing, I use @osm0sis tools ,this doesn't mean that you have bad luck my friend, this is due to the limitation of @osm0sis tools, but I will find another way to make it universal apk. Okay
atoxyd said:
Well, this is a beta version of my apk, only for testing, I use @osm0sis tools ,this doesn't mean that you have bad luck my friend, this is due to the limitation of @osm0sis tools, but I will find another way to make it universal apk. Okay
Click to expand...
Click to collapse
The scope of my tools is for Google's Android image standard as defined in the bootimg.h header from AOSP/CM. My tool forks have the widest support available for images which are standards compliant, supporting all commonly used ramdisk compression formats.
Supporting Sony's ELF, MTK's labeled and Samsung's headerless image formats along with the standard images (not to mention Samsung's and others' various deviations based on the standard header) and having the script/app differentiate between them would be a very large and difficult undertaking indeed. If that's your plan then I wish you the best of luck in your efforts.
hey, ran more tests.
no issues with the dtb or other functions either.
backup and flash functions working fine too.
here, for your devices.xml
Code:
<!-- Desire 816 a5 (710C) added by bigsupersquid -->
<device>
<model>710C</model>
<kernel>/dev/block/mmcblk0p40</kernel>
<recovery>/dev/block/mmcblk0p41</recovery>
<cache>/dev/block/mmcblk0p42</cache>
</device>
thanks for your work.
eagerly awaiting your open source as well
atoxyd said:
Hi all , I'm new here and I would like to present to you this simple application which backup, edit, repack and flash kernel.img or recovery img with a single click.
This apk need root.
All credit of unpak/repack tools used in my apk are to @osm0sis
Click to expand...
Click to collapse
Thank you for adding the appropriate credit back to your post. Patching, cross-compiling and scripting has taken significant work. :good:
The only other thing that I'd ask is that you do not use the name of Android Image Kitchen or AIK in the title of your app. I'd like to suggest maybe "Image Editor and Flasher" as a snappy alternative?
bigsupersquid said:
hey, ran more tests.
no issues with the dtb or other functions either.
backup and flash functions working fine too.
here, for your devices.xml
Code:
<!-- Desire 816 a5 (710C) added by bigsupersquid -->
<device>
<model>710C</model>
<kernel>/dev/block/mmcblk0p40</kernel>
<recovery>/dev/block/mmcblk0p41</recovery>
<cache>/dev/block/mmcblk0p42</cache>
</device>
thanks for your work.
eagerly awaiting your open source as well
Click to expand...
Click to collapse
Thank you my friend , you are the only one who supported me , and from the beginning.
atoxyd said:
Thank you my friend , you are the only one who supported me , and from the beginning.
Click to expand...
Click to collapse
it's a useful project, definitely worth a little testing and feedback.
besides, i remember what a pain it was getting my xda account eligible for posting the project i was all gung-ho about sharing (optimus v boot from sd card if i remember correctly)
sharing is cool, but a lot of the feedback tends to be annoying when there's no logs or other usable information, just "it's broken" or "can you implement for me on device XYZ."
bigsupersquid said:
I can unpack, edit, and repack successfully.
but, it wont boot.
I used official twrp 3.0.0-0 recovery.img and cm13 boot.img both, tried without editing.
just unpack/repack/flash.
boots straight into hboot, which is what happens if I build a boot.img or recovery.img without dtbs.
I pointed to the anykernel2 link because I know its scripting handles dtbs.
the whole kernel device table thing is new to me, and so far only on this device, so I'm not very savvy with dtb work. been lucky enough that it was preconfigured in the build system for cm.
Click to expand...
Click to collapse
Did you have an unlocked bootloader ?
nothing changed on the device, unlocked and still s-on, I'm not sure what went wrong the first try.
PEBKAC error probably
(problem exists between keyboard and chair)
I release AIK&Flasher v2 , I use @xiaolu unpack/repack tools.
atoxyd said:
I release AIK&Flasher v2 , I use @xiaolu unpack/repack tools.
Click to expand...
Click to collapse
Please use a different name for your app as I have requested.

[TOOLS] Necessary tools for building the Pixel 2 (XL) Kernel

THIS IS NOT A "HOW TO BUILD A KERNEL" POST
The Pixel 2, unlike other phones I've worked with, requires two extra tools: dtc (Device Tree Compiler) and mkdtimg.
Yes, dtc is available in the main repos for most linux distros, but the Pixel 2 kernel requires the AOSP modified version of dtc.
First, grab the Pixel 2 + XL Unified kernel source (wahoo) from https://android.googlesource.com/kernel/msm/+/android-msm-wahoo-4.4-oreo-dr1
Then download wahoo-kernel-tools.zip file attatched to this post and unzip it. Make sure that the 2 files in the bin folder are available in your path (possibly by moving them to ~/bin) and symlink or move the libc++.so into an included library directory, such as /lib, /usr/lib, or /usr/local/lib.
These specific binaries were compiled on Arch Linux by me, so they may not work on every system. To build binaries compatible with your system, sync any android oreo source (AOSP, Lineage, Carbon, etc.) and run "make dtc mkdtimage -jX" instead of "make bacon" or your normal command. The binaries will be located in out/host/linux-x86/.
This is tested and working with the stock google 4.9 toolchain and the initial source as of Oct 23rd, 2017.
frap129 said:
THIS IS NOT A "HOW TO BUILD A KERNEL" POST
The Pixel 2, unlike other phones I've worked with, requires two extra tools: dtc (Device Tree Compiler) and mkdtimg.
Yes, dtc is available in the main repos for most linux distros, but the Pixel 2 kernel requires the AOSP modified version of dtc.
First, grab the Pixel 2 + XL Unified kernel source (wahoo) from https://android.googlesource.com/kernel/msm/+/android-msm-wahoo-4.4-oreo-dr1
Then download wahoo-kernel-tools.zip file attatched to this post and unzip it. Make sure that the 2 files in the bin folder are available in your path (possibly by moving them to ~/bin) and symlink or move the libc++.so into an included library directory, such as /lib, /usr/lib, or /usr/local/lib.
These specific binaries were compiled on Arch Linux by me, so they may not work on every system. To build binaries compatible with your system, sync any android oreo source (AOSP, Lineage, Carbon, etc.) and run "make dtc mkdtimage -jX" instead of "make bacon" or your normal command. The binaries will be located in out/host/linux-x86/.
This is tested and working with the stock google 4.9 toolchain and the initial source as of Oct 23rd, 2017.
Click to expand...
Click to collapse
Thanks for the files dude, you saved me some serious time since I don't need to sync AOSP
DespairFactor said:
Thanks for the files dude, you saved me some serious time since I don't need to sync AOSP
Click to expand...
Click to collapse
No problemo, I figured I'd post this since my fastboot is being retarded and I can't do much else
Forgive me for being a noob, but would these new requirements for the Pixel 2 cause existing tools used to pack/unpack the boot image fail or at least partially fail? I'm wondering if this is why we can't get Magisk to work
edit: to be clear, when I unpack the boot.img file all I see are kernel and ramdisk. When I unpack the boot.img from the Pixel 1 XL, I see those same 2 files along with devicetree.dtb and kernelimage
skaforey said:
Forgive me for being a noob, but would these new requirements for the Pixel 2 cause existing tools used to pack/unpack the boot image fail or at least partially fail? I'm wondering if this is why we can't get Magisk to work
edit: to be clear, when I unpack the boot.img file all I see are kernel and ramdisk. When I unpack the boot.img from the Pixel 1 XL, I see those same 2 files along with devicetree.dtb and kernelimage
Click to expand...
Click to collapse
Maybe? It doesn't seem like how the boot image is packed has been changed, just how the actual kernel image is put together.
nathanchance said:
Maybe? It doesn't seem like how the boot image is packed has been changed, just how the actual kernel image is put together.
Click to expand...
Click to collapse
Strange. Thanks for the response though. In the Magisk thread here, someone has posted a boot image that was simply unpacked/repacked (no changes) and we can't get it to boot. I don't want to derail this thread any further though.
skaforey said:
Forgive me for being a noob, but would these new requirements for the Pixel 2 cause existing tools used to pack/unpack the boot image fail or at least partially fail? I'm wondering if this is why we can't get Magisk to work
edit: to be clear, when I unpack the boot.img file all I see are kernel and ramdisk. When I unpack the boot.img from the Pixel 1 XL, I see those same 2 files along with devicetree.dtb and kernelimage
Click to expand...
Click to collapse
skaforey said:
Strange. Thanks for the response though. In the Magisk thread here, someone has posted a boot image that was simply unpacked/repacked (no changes) and we can't get it to boot. I don't want to derail this thread any further though.
Click to expand...
Click to collapse
No they don't, these just build the dtb/dtbo. The magisk issue is with patching sepolicy likely.
frap129 said:
No problemo, I figured I'd post this since my fastboot is being retarded and I can't do much else
Click to expand...
Click to collapse
Did you try to flash a factory image and get stuck in the bootloader? If so, extract 'image-walleye-[build number].zip' and flash each image manually. fastboot -w update doesn't work for some reason. After you flash all the images, do fastboot format userdata, and you should be back to normal. Took me a couple hours to figure this out.
ryanbg said:
Did you try to flash a factory image and get stuck in the bootloader? If so, extract 'image-walleye-[build number].zip' and flash each image manually. fastboot -w update doesn't work for some reason. After you flash each image, do fastboot format userdata, and you should be back to normal. Took me a couple hours to figure this out.
Click to expand...
Click to collapse
Thanks! I don't get stuck in the bootloader, but it won't let me flash boot images. Fastboot either hangs or spits out "remote: error: max size not reported"

Categories

Resources