mkbootimg - Acer Iconia A500

ok im trying to repack a kernel and i get mkbootimg not found i already downloaded a mkbootimg zipbut dont know what to do with it can someone guide me on what to do with mkbooting thanks in advance

Check out the Kitchen
http://forum.xda-developers.com/showthread.php?t=633246
In that zip, i use scripts/boot_img_tools to unpack. Then I looked through build_boot_img to get the command syntax for mkbootfs and mkbootimg. It also shows the commands for compiling those tools. They are in the tools folder. The mkbootfs will create the ramdisk image. Then mkbootimg will combine it and the zImage into a boot.img (or recovery.img).
I can't remember the parameters off hand, but that script (build_boot_img) will tell you everything you need to know.

Thanks ill check it out
Sent from my SCH-R720 using xda premium

Related

[request] how to edit ramdisk

I am very familiar with editing the ramdisk of a standard boot.img but have no idea how to do so with the way this phone is set up (has a zImage, etc). Can someone point me in the right direction so we can make some great things happen for this device? Thanks in advance
I can tell you how to extract the initramfs image, but I don't think anybody has had success in inserting an altered image into the stock kernel, so it's only of use in building your own kernel. You need to search for a gzip header in the zImage, it is a sequence of three bytes: 1F8B08. Gunzip this and all data following it to get the Image file. Search that for another gzip header, which is the start of the initramfs, in the form of a gzipped cpio archive. You will need to unpack this if you want to modify it. Be aware that it contains absolute pathnames and that cpio will cheerfully and silently extract these to the root of your filesystem if to don't explicitly tell it not to.
Sent from my SAMSUNG-SGH-I897 using XDA App

[Q] initrd.gz repack

Does the initrd.gz need have permissions reset after unpacking and repacking???? I keep getting bootloops and im not sure what commands to run to set permissions. I use ubuntu any help would be greatly appreciated thanks!!!!!!!
I have the same problem, anyone can help?
You can try use Kitchen here:
http://forum.xda-developers.com/showthread.php?t=633246
blacksn said:
I have the same problem, anyone can help?
Click to expand...
Click to collapse
What commands are you using
The following command will do it for you
Code:
find .|cpio --quiet -H newc -o|gzip -9 -c - > ../initrd.gz
here is original initrd.gz from ROM and image that i want to put inside:
black.volyn.net/or.zip
here is the file i'm getting after command:
black.volyn.net/initrd.gz
(add http to links, i can't post links yet)
Image is changed, but the phone reboots when bootanimation must to start.
Can someone to pack me initrd.gz with image from archieve?
Try the link below
http://dl.dropbox.com/u/26430630/initrd.gz
Hopefully that will work for you
Thanks, works fine!
Which version of Linux did you use to make inird.gz?
blacksn said:
Thanks, works fine!
Which version of Linux did you use to make inird.gz?
Click to expand...
Click to collapse
I use sabayon, debian or ubuntu
The same command should work all linux machines

How to unpack, edit and repack boot.img

*** I TAKE NO CREDIT. I JUST MADE A GUIDE TO HELP YOU***
A STEP BY STEP TUTORIAL :
I find many people struggling with unpacking a boot image and expecially repacking it. So here is a simple guide to unpack and repack the boot image.
>You need some tools so make sure you download all these.
List : (links available at bottom of page
split_bootimg.pl
repack_bootimg.pl
dsixda kitchen (you need some files from here)
Not to mention, a linux based system
> First you need to make some correction to repack_bootimg file(if downloaded from other source) . open it using gedit or some editor.
> check third line from bottom which is starting with system...If it is ending with $ARGV[2] then make this change
Add --base 0x19200000 and then close with " .
This now should look like
$ARGV[2] --base 0x19200000");
> Save it and exit. Now place boot.img and the two files in a folder(create new one. Don't mess it up)
> Now go to dsixda kitchen folder >tools >mkboot and copy all the files to your working directory
> Now you have mkbootfs.c and mkbootimg.c files along with needed header files. You have to make them executable. For that, run this command
gcc -o mkbootfs mkbootfs.c
change the permissions
chmod a+x ....(path)/mkbootfs
Now do the same for mkbootimg.c
gcc -o mkbootimg mkbootimg.c
change the permissions
chmod a+x ....(path)/mkbootimg
Now you are ready to go. Just navigate to directory in command prompt and type
./split_bootimg.pl boot.img
(or)
perl split_bootimg.pl boot.img
you will get some files. one is kernel and other is ramdisk. extract ramdisk.gz. Now again extract ramdisk(cpio file) . Make necessary changes.
To repack, use this command
perl repack-bootimg.pl <kernel_name> ramdisk_directory_name boot.img
( you need mkbootimg for this to work)
Bingo you have a boot.img which is ready to test.
LINKS :
Split_bootimg.pl : http://www.mediafire.com/?i4omee9loaxawtk
Repack_bootimg.pl : http://www.mediafire.com/?sthhkkkkctdvb3d
dsixda kitchen : http://forum.xda-developers.com/showthread.php?t=633246
IS YOUR dsixda kitchen FIX FOR MOTO ?
duansindo said:
IS YOUR dsixda kitchen FIX FOR MOTO ?
Click to expand...
Click to collapse
If you are talking about using the kitchen for motorola, it supports only few devices.
Motorola Atrix (unconfirmed)
Motorola CLIQ / CLIQ XT
Motorola Droid (unconfirmed)
Motorola Milestone (unconfirmed) - you may need to remove the boot.img before building
here is moto list...If you are talking about repacking n stuff, it supports any vendor.
godson32
can sum1 plz help me.... i have evo root 2.2 i was trying to nandriod backup in restore . once i got done doing both i rebooted sys. all i get is the while htc evo screen oh ima noob, plz sum one help, oh im running clockworkmod recovery v2.6.0.1
godson32 said:
godson32
can sum1 plz help me.... i have evo root 2.2 i was trying to nandriod backup in restore . once i got done doing both i rebooted sys. all i get is the while htc evo screen oh ima noob, plz sum one help, oh im running clockworkmod recovery v2.6.0.1
Click to expand...
Click to collapse
Try the evo forum.

[Tutorial] Kernel building instructions for Xperia SP

kernel sources for Xperia SP (C5302, C5303, C5306, M35h) {FW: 12.0.A.1.257} are available...
link to download sources:
http://dl-developer.sonymobile.com/code/copylefts/12.0.A.1.257.tar.bz2
i will keep pushing stock kernel sources to my git tree at the following branch:
https://github.com/DooMLoRD/android_kernel_sony_msm8960t/tree/sony_sources
following are the build instructions for developers who plan to work on this device....
toolchain recommended: Google GCC 4.7
Building kernel (zImage):
for Xperia SP:
import defconfig
Code:
ARCH=arm CROSS_COMPILE=~/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- make viskan_huashan_defconfig
build zImage
Code:
ARCH=arm CROSS_COMPILE=~/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- make -j8
incase u get errors like:
Code:
error : /scripts/gcc-wrapper.py
just correct the permissions of that file
Code:
chmod 755 ./scripts/gcc-wrapper.py
here is patch for compatibility with GCC 4.7 compilation
regards,
DooMLoRD
Instructions for building kernel.elf
first get the kernel built... once kernel is built u will get zImage and copy that zImage to the folder containing the build tools...
i have posted the build tools i use here:
https://github.com/DooMLoRD/build_tools/tree/master/msm8960t_viskan
Sony using the ELF format (similar to the 2012 devices)...
build kernel.elf
u can directly use the files posted at my git repo for build tools
or
use the following command:
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
the correct RPM.bin & bootcmd are posted at my git tree for build tools...
regards,
DooMLoRD
@DooMLoRD
I have to answer a lot of questions when compiling like board selection etc (have been clicking y and and enter for about 30 minutes now) is this normal?
View attachment 2411564
Hi Doomlord.
Being a fresh Xperia User, never heard about u on HTC forums. But glad to know you are helping a lot of people around here. I was wondering whether you could help me in understanding a bit about xperia phones before i dive into kernel kanging n stuff.
What i know from HTC devices
Partitions are like this:
Boot (separate partition on NAND)
Recovery (separate partition on NAND)
System like above
Data, same
Cache, same
etc
There, we used to flash boot.img to boot. boot.img contained kernel zImage+ramdisk
For recovery, we have recovery.img which contained zImage+recoveryramdisk
Then system and data etc as every other phone.
Here in Xperia, i cant understand where the recovery is. Is it inside kernel.elf?
Is it placed on a dedicated partition?
I want to know what i am messing with, before continuing.
What i plan to do is.
Build a clean TWRP from source (for myself, usage and learning.)
Build a stock based kernel from source. Add few govs/scheds and maybe Doubletap2wake etc. (but thats a little way ahead.)
Can you help me with this?
neXus PRIME said:
Hi Doomlord.
Being a fresh Xperia User, never heard about u on HTC forums. But glad to know you are helping a lot of people around here. I was wondering whether you could help me in understanding a bit about xperia phones before i dive into kernel kanging n stuff.
What i know from HTC devices
Partitions are like this:
Boot (separate partition on NAND)
Recovery (separate partition on NAND)
System like above
Data, same
Cache, same
etc
There, we used to flash boot.img to boot. boot.img contained kernel zImage+ramdisk
For recovery, we have recovery.img which contained zImage+recoveryramdisk
Then system and data etc as every other phone.
Here in Xperia, i cant understand where the recovery is. Is it inside kernel.elf?
Is it placed on a dedicated partition?
I want to know what i am messing with, before continuing.
What i plan to do is.
Build a clean TWRP from source (for myself, usage and learning.)
Build a stock based kernel from source. Add few govs/scheds and maybe Doubletap2wake etc. (but thats a little way ahead.)
Can you help me with this?
Click to expand...
Click to collapse
The recovery is inside the kernel but that's all I know
Sent from my C5303 using xda app-developers app
Yep. I found all I needed to know.... Fotakernel partition, elf ramdisk kernel and other stuff.
Sent from my C5303 using Tapatalk
No NAND is used
EMMC is there in all new xperia devices
Sent from my C6902 using xda app-developers app
DooMLoRD said:
No NAND is used
EMMC is there in all new xperia devices
Sent from my C6902 using xda app-developers app
Click to expand...
Click to collapse
ok thanks...
one more thing, if i build a custom kernel (lets say, stock-based), without any major changes..... can i flash that kernel file without unlocking bootloader???
as i understand, only kernel ftf files can be flashed via flashtool in locked bootlaoder.... correct me if im wrong.
neXus PRIME said:
ok thanks...
one more thing, if i build a custom kernel (lets say, stock-based), without any major changes..... can i flash that kernel file without unlocking bootloader???
as i understand, only kernel ftf files can be flashed via flashtool in locked bootlaoder.... correct me if im wrong.
Click to expand...
Click to collapse
No u can't
Sent from my C5302 using Tapatalk
Siddhesh said:
No u can't
Sent from my C5302 using Tapatalk
Click to expand...
Click to collapse
I compiled my kernel with a different splash screen and it flashed but I got a flashing black screen and it doesn't boot (i have UBL)
hi @DooMLoRD,
when i am making the elf of the zImage i am getting this error
[email protected]:~/android/huashan files/build tools/jk_output$ sudo bash '/home/jk-cha0s/android/huashan files/build tools/jk_output/build_it.sh'
[sudo] password for jk-cha0s:
Traceback (most recent call last):
File "mkelf.py", line 182, in <module>
main(sys.argv[1:])
File "mkelf.py", line 159, in main
size = os.path.getsize(seg.file)
File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 'ramdisk.cpio.gz'
where to get the ramdisk.cpio.gz ?
edit:its inside a working kernel extract from there
neXus PRIME said:
Yep. I found all I needed to know.... Fotakernel partition, elf ramdisk kernel and other stuff.
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
hey hi,
i need to know how to integrate recovery into a kernel i made. please help me to do it. :silly:
About Xperia SP(m35t)
Hello DooMLoRD
I want to ask you about how to build a kernel of m35t. I had tried to use the build_tools-master to unzip the kernel of m35t, and then repacked it without any modification. I flash the new kernel.elf but the phone doesn't work, how should I do ?
I want let the m35t run on Android 4.3 cause Sony hasn't update it, hope you can help me. Thanks a lot!
NewBay_STanLey said:
Hello DooMLoRD
I want to ask you about how to build a kernel of m35t. I had tried to use the build_tools-master to unzip the kernel of m35t, and then repacked it without any modification. I flash the new kernel.elf but the phone doesn't work, how should I do ?
I want let the m35t run on Android 4.3 cause Sony hasn't update it, hope you can help me. Thanks a lot!
Click to expand...
Click to collapse
Hi,
For android 4.3 the command to pack has changed from
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
To
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
pec0ra said:
Hi,
For android 4.3 the command to pack has changed from
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
To
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
Click to expand...
Click to collapse
Thanks, Pec0ra.
Yes, I know the command is changed, I repacked original kernel with build_it_JB-4.1.sh, the system is 12.0.C.2.58, everything is original, but the phone doesn't work.
I guess there is a little difference between c5303 and m35t, that I need to make a little modification to this tool.
I found the difference between m35t and other SPs
Finally, I found a difference between m35t and other SPs. The build_tools-master shouldn't be wrong, there is only one explanation is the RPM.bin not working for m35t. So,the rebuilt kernel can't boot up the m35t. @DooMLoRD, could you give me the right RPM.bin for m35t? Thanks a lot!
NewBay_STanLey said:
Finally, I found a difference between m35t and other SPs. The build_tools-master shouldn't be wrong, there is only one explanation is the RPM.bin not working for m35t. So,the rebuilt kernel can't boot up the m35t. @DooMLoRD, could you give me the right RPM.bin for m35t? Thanks a lot!
Click to expand...
Click to collapse
I think you can simply unpack it from stock kernel with the build tools. You will just have to find out which one of the extracted file it is since it might have another name.
Good news!
Good news! I found the way to extract rpm.bin witch use the flashtool. I use the version 207 C5303's zimage and ramdisk.cpio.gz and m35t's rpm.bin to repack the kernel. When I flash the kernel and version 207's rom in my m35t, it works! But only press the power button can let the back light gets on and off, the screen still can't display anything, and it can't play any sound, but it still take a big step!

Spreadtrum .pac file extractor

After so much searching, I found a method to extract .pac files easily even in Android device....
https://github.com/divinebird/pacextractor
From above link we can compile a binary file that can extract the .pac file that is found in Spreadtrum Firmware devices....
Place *.pac file and pacextractor compiled from above in a directory of storage and type the following commands in Terminal
Usage:-
Bash:
cd <path of directory of .pac file>
~/pacextractor <name of .pac file>
After finishing you can see the extracted files in the directory of your .pac file....
Linux Users:-
Bash:
git clone https://github.com/divinebird/pacextractor
cd pacextractor
make
By using SuperR-Kitchen also we can extract .pac firmware https://forum.xda-developers.com/ap...-kitchen-v1-1-50-v2-1-6-t3597434/post79213974
Android users:-
Eg:- I placed a .pac called Lava.pac in /sdcard/Music
and compiled the pacextractor.c with CPP-N-IDE app in android... and placed pacextractor binary in Home folder... and typed following commands in Terminal Emulator app
Bash:
cd /sdcard/Music
~/pacextractor Lava.pac
I made a post here because may be some dev see this and improve this pac extractor...
Enjoy..!
Similar Guides:-
https://forum.xda-developers.com/general/general/how-to-extract-pacspd-file-micromax-t3039709
https://forum.hovatek.com/thread-6236.html
https://androidmtk.com/extract-spreadtrum-pac-file
For all users who are using Spreadtrum devices and want to extract .pac file, I made a JAVA version of above post pacextractor for portability.
Usage:
PC Users
Code:
java -jar PacExtractor.jar pacfile outdir
Android Users:
Code:
dalvikvm -cp PacExtractor.jar com.sprd.pacextractor.PacExtractor pacfile outdir
Source:
https://github.com/HemanthJabalpuri/pacextractor
Hey bro if i want to re-pack the extracted .pac file after editing, then what to do ?
good job
Sir how to extract pac firmware using extractor.jar I have bit confused I have never tried using jar files
---------- Post added at 10:24 AM ---------- Previous post was at 10:21 AM ----------
HemanthJabalpuri said:
For all users who are using Spreadtrum devices and want to extract .pac file, I made a JAVA version of above post pacextractor for portability.
Usage:
PC Users
Code:
java -jar PacExtractor.jar pacfile outdir
Android Users:
Code:
dalvikvm -cp PacExtractor.jar com.sprd.pacextractor.PacExtractor pacfile outdir
Click to expand...
Click to collapse
Sir how to extract pac firmware using extractor.jar I have bit confused I have never tried using jar files
Dip_007 said:
Hey bro if i want to re-pack the extracted .pac file after editing, then what to do ?
Click to expand...
Click to collapse
We can also extract the .pac firmware using this guide.
https://forum.hovatek.com/thread-6236.html
If we want flash only some partitions like TWRP, magisk_patched_boot.img then you can use this guide, if you have stock rom .pac file.
https://forum.hovatek.com/thread-28774.html
If we want to redistribute the edited or modified partition within a .pac file, then you can build or re-pack that using below guide
https://forum.hovatek.com/thread-1232.html
A full detailed videos done by Hovatek for Spreatrum are at: https://www.youtube.com/playlist?list=PLr_0hlHNXjuXu16Q6857dnt61zMKCBIEk
Please help, i'm using android phone and tried to unpack a .pac rom of my phone and doing with your tut, but you said you put your pacextractor binary after you complied it to the home folder, but where is the home folder? And when i complied the pacextractor.c file, it runned on the complied program, it doesn't give me any output file? Can you explain?
son.minz said:
Please help, i'm using android phone and tried to unpack a .pac rom of my phone and doing with your tut, but you said you put your pacextractor binary after you complied it to the home folder, but where is the home folder? And when i complied the pacextractor.c file, it runned on the complied program, it doesn't give me any output file? Can you explain?
Click to expand...
Click to collapse
See these instead
- https://forum.xda-developers.com/t/spreadtrum-pac-file-extractor.3900323/post-83794395
- https://forum.xda-developers.com/t/spreadtrum-pac-file-extractor.3900323/post-81593301

Categories

Resources