[Q] How to unpack/repack boot.img in terminal emulator (android?)? - Android Q&A, Help & Troubleshooting

Is there any code or way to unpack n repack boot.img in android's terminal emulator?
I know about repacking n unpacking scripts about windows.
I want to know is that possible in android.
Can anyone help me please!!

shrikant716 said:
Is there any code or way to unpack n repack boot.img in android's terminal emulator?
I know about repacking n unpacking scripts about windows.
I want to know is that possible in android.
Can anyone help me please!!
Click to expand...
Click to collapse
Yes, it is possible. I am currently able to unpack the boot.img and ramdisk, but when compiling the ramdisk with the kernel to make the new insecure boot.img something isn't right. Everytime I flash it I go in to a boot loop. Thinking maybe I am not applying the ramdisk address. As of now, not sure what the cause is.

Modding.MyMind said:
Yes, it is possible. I am currently able to unpack the boot.img and ramdisk, but when compiling the ramdisk with the kernel to make the new insecure boot.img something isn't right. Everytime I flash it I go in to a boot loop. Thinking maybe I am not applying the ramdisk address. As of now, not sure what the cause is.
Click to expand...
Click to collapse
Can u share the code please...
Try replacing only stock kernel or zimage n dont touch ramdisk

shrikant716 said:
Can u share the code please...
Try replacing only stock kernel or zimage n dont touch ramdisk
Click to expand...
Click to collapse
https://www.dropbox.com/s/fy68dxljsxek1kr/boot_manipulation.zip
Sent from my K2_CL using Tapatalk
---------- Post added at 11:10 PM ---------- Previous post was at 11:08 PM ----------
Place unpackbootimg in /system/bin/ with executable permissions. Open up terminal emulator and type unpackbootimg. It will show what to do. My problem right now is packing it. I get boot loops. Not sure why. Anyways, good luck.
Sent from my K2_CL using Tapatalk
---------- Post added at 11:13 PM ---------- Previous post was at 11:10 PM ----------
Ignore the ramdisk.sh (its jacked up). Just unpack the ramdisk manually using terminal emulator. You will need gzip and cpio support on your device though.
Sent from my K2_CL using Tapatalk
---------- Post added at 11:17 PM ---------- Previous post was at 11:13 PM ----------
ramdisk.sh originally looks like this...
Code:
#!/system/bin/sh
Dir=$1
FileName=*ramdisk
cd $Dir
busybox cp -f *ramdisk.gz ./ramdisk/
cd $Dir/./ramdisk
busybox gzip -d *ramdisk.gz
busybox cpio -i -F *ramdisk
busybox rm -f *ramdisk *-ramdisk *.img-ramdisk
busybox touch ok
Sent from my K2_CL using Tapatalk
---------- Post added at 11:31 PM ---------- Previous post was at 11:17 PM ----------
Fixed ramdisk.sh.
Anyways, just place unpackbootimg, ramdisk.sh, and mkbootimg in /system/bin/ then go from there.
Sent from my K2_CL using Tapatalk

@shrikant716
Let me know if you got a boot.img to flash successfully on your device. You might get an arguement or complaint from the cpio command found in the ramdisk.sh. If so, then don't use your eternal or external sdcard. FAT is not welcome by cpio lol. Have to create a new folder in /system then take it from there.
Sent from my K2_CL using Tapatalk

An example from my device
Sent from my K2_CL using Tapatalk

Modding.MyMind said:
An example from my device
Sent from my K2_CL using Tapatalk
Click to expand...
Click to collapse
no success.....can u please elaborate in detail steps.

shrikant716 said:
no success.....can u please elaborate in detail steps.
Click to expand...
Click to collapse
What failed?
Sent from my K2_CL using Tapatalk

http://forum.xda-developers.com/showthread.php?t=2587462
Sent from my K2_CL using Tapatalk

@shrikant716
Check out that link again. New files, better instructions, and works flawlessly. The last one I provided to you was corrupted when being compiled. But I fixed it. It will work now. Just wanted to update you on this since you are looking for such tools.
Sent from my K2_CL using Tapatalk
---------- Post added at 01:27 PM ---------- Previous post was at 01:24 PM ----------
Let me know what you think of it or if there are any ideas you would like to add to make the tools better. The two tools are unmkbootimg and mkbootimg. Unmkbootimg will make the process much easier. Enjoy bro.
Feedback is always encouraged. I also provided the source.
Sent from my K2_CL using Tapatalk

Update: binaries included...
mkbootimg, unmkbootimg, and mkbootfs.
Works with ARM devices.
Have tested this on LOTS of boot.img's and all were successful.
this project was a headache and I almost gave up on it. But at last, it is complete lol.
Sent from my K2_CL using Tapatalk

Related

2nd-init

There is an app called 2nd init recovery in the Market. It's like safestrap or boot menu manager (I think.) Can anyone risk to try it? Or should I risk it? Will it work?
Maybe we can get a chance to flash a custom recovery or something...?
I don't even know it's the right section to start thread.
Sent from my Sony Tablet S using xda app-developers app
Sorry for bad English.
Might have to check it out
Sent from my LT28i using xda app-developers app
---------- Post added at 04:21 PM ---------- Previous post was at 04:16 PM ----------
Looks really crappy. And only supports 2 devices I've never heard of highly doubt it works it is a bootstrap
Sent from my LT28i using xda app-developers app
I should find a well working 2nd init method. Continue to research. lol
Sent from my Sony Tablet S using xda app-developers app
Never mind. I'm sleepy. Will search tomorrow.
Sent from my Sony Tablet S using xda app-developers app
I tried it and it does not flash anything at all.
Basically it does nothing on our device.
Tested on the Sony Tablet S.
Sent from my Nexus 4 using xda app-developers app
---------- Post added at 06:48 AM ---------- Previous post was at 06:26 AM ----------
Try lte2recovery here: http://androidforums.com/spirit-4g-...2971-2nd-init-recovery-985hpakick-spirit.html
If that works then only use the reboot option in the app since your device will be factory reset by rebooting in an other way, only use the 2nd Init Reboot Recovery (not like the option will work anyway so you have to go into it manually) (read the thread fully).
Sent from my Nexus 4 using xda app-developers app
andyabc said:
I tried it and it does not flash anything at all.
Basically it does nothing on our device.
Tested on the Sony Tablet S.
Sent from my Nexus 4 using xda app-developers app
---------- Post added at 06:48 AM ---------- Previous post was at 06:26 AM ----------
Try lte2recovery here: http://androidforums.com/spirit-4g-...2971-2nd-init-recovery-985hpakick-spirit.html
If that works then only use the reboot option in the app since your device will be factory reset by rebooting in an other way, only use the 2nd Init Reboot Recovery (not like the option will work anyway so you have to go into it manually) (read the thread fully).
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Tried yet. Nothing.
Sent from my Sony Tablet S using xda app-developers app
I'm working on porting safestrap to XTS, but STS should be doable to with some help from someone that owns the device. Will post more info when I get home from work
Sent from my XT910 using Tapatalk 4 Beta
pajn said:
I'm working on porting safestrap to XTS, but STS should be doable to with some help from someone that owns the device. Will post more info when I get home from work
Sent from my XT910 using Tapatalk 4 Beta
Click to expand...
Click to collapse
And I'm working for STS but I have no idea for that. I'm decompiled the apk file and reading scripts. Does it work? Can you help me?
Thanks...:laugh:
Sorry for bad English.
smgdev said:
And I'm working for STS but I have no idea for that. I'm decompiled the apk file and reading scripts. Does it work? Can you help me?
Thanks...:laugh:
Sorry for bad English.
Click to expand...
Click to collapse
Send me this files:
/proc/partitions
/proc/mounts
/proc/mtd
/init.rc (and all subfiles like init.something.rc)
/fstab (can be named something.fstab or fstab.something), also in /etc
/kernel or /zImage if you have it
And the output of
ls -al /dev/block
do also search in this folder for a folder named "by-name" (may be in a subfolder so do some lookaround)
and do a ls -al on that folder to.
I think that is a good start.
pajn said:
Send me this files:
/proc/partitions
/proc/mounts
/proc/mtd
/init.rc (and all subfiles like init.something.rc)
/fstab (can be named something.fstab or fstab.something), also in /etc
/kernel or /zImage if you have it
And the output of
ls -al /dev/block
do also search in this folder for a folder named "by-name" (may be in a subfolder so do some lookaround)
and do a ls -al on that folder to.
I think that is a good start.
Click to expand...
Click to collapse
OK. I will send them in 10 minutes.
And I think I ported the recovery-check, recovery-install and recovery-uninstall script files. I will attach them too. I will be happy if you send your feedbacks.
One more question, how can i find the kernel image file?
Thanks...
smgdev said:
OK. I will send them in 10 minutes.
And I think I ported the recovery-check, recovery-install and recovery-uninstall script files. I will attach them too. I will be happy if you send your feedbacks.
One more question, how can i find the kernel image file?
Thanks...
Click to expand...
Click to collapse
Here we go...Attached.:laugh:
But there's no mtd file in /proc directory ,there's no by-name or something in /dev/block directory or somewhere, and fstab file.
I will add kernel image as soon as I find it.
Sorry for bad English.
--------
EDIT
Forgot to add script files i mentioned i my previous post.
Added. --files.zip
smgdev said:
Here we go...Attached.:laugh:
But there's no mtd file in /proc directory ,there's no by-name or something in /dev/block directory or somewhere, and fstab file.
I will add kernel image as soon as I find it.
Sorry for bad English.
--------
EDIT
Forgot to add script files i mentioned i my previous post.
Added. --files.zip
Click to expand...
Click to collapse
Thanks. Looks similar to the XTS.
You'll probably not find the kernel image. I just thought if it was in the rootfs but if it isn't we can't reach it (it lies in the encrypted hidden.img).
It isn't necessary but would be a nice touch.
There are no mtd in proc on XTS either. Same there it's usually there and could help a bit but if it isn't that isn't a big of a deal.
On big difference seems to be how the sdcard is managed (XTS have it in /data/media where the STS are using vold) could you se if there is a vold.fstab (or similar) in /etc?
When I have some initial things to test I will post.
Here you are. Vold.fstab

[ROM]MIUI V5 MultiLanguage! New Camera! Smoothest!

Warning:
I have no GT-N7105,so I don't test it. You should backup your phone!
What's Working:
- Touchscreen and hardware keys
- Touch key lights
- LTE (Dial *#*#4636#*#* phone information scroll up select LTE/CDMA)
- 3G
- SMS
- MMS
- Calls
- Wifi
- Sound
- Cameras
- Internal / external storage
- GPS
- Wifi Hotspot
- Bluetooth
- Recorder
- Torch
- NFC
Installation:
- Download ROM kernel and gapps
- Place on SDCARD
- Wipe factory rest 2x
- Flash MIUI rom
- Reboot into rom
- Then Reboot into recovery
- Flash gapps
- Reboot
- Enjoy
Support language list:
English(iBotPeaches)
Polish(Acid-miuipolskapl)
Slovak(MIUICzech-Slovak)
Czech(MIUICzech-Slovak)
French(ingbrzy)
Hungaria(vagyula1)
Danish(1982Strand)
Holland(Redmaner)
German(Bitti09)
Spain(ingbrzy)
Italy(Mish)
Arabic(MIUI-Palestine)
Norway(ingbrzy)
JUden(HebMIUI)
Vietnam(HoangTuBot)
Indonesia(ingbrzy)
Turkish(ingbrzy)
Thai(rcset)
Russian(miuisu)
Ukrainian(KDGDev)
Swedish(ingbrzy)
Dutch(Redmaner)
Brazilian(ingbrzy)
Korean(nosoy1)
Romanian(ingbrzy)
Japanese(ingbrzy)
Portugal(miuiportugal)
Changelog:
Click me!
DOWNLOAD LINK:
Choose exy-*.zip in the folder
(choose n7105 in the aroma,All ROM & OTA will find in this folder)
Gapps: goo.im
Old version:
4.4.25
4.4.18
4.4.10
4.4.3
4.3.28
4.3.23
4.3.21
4.3.15
4.3.8
4.1.24
4.1.17
3.10.01
3.9.1
3.8.23
3.8.16
My Blog:
www.nianrom.com
Credits:
CyanogenMod
Psndna88
Mdiary
MIUI Official Team
All translator I list
MIUI Port Team
Thank you! Will test!
Oh wow, love MIUI! Do custom kernels work? will flash a report later
Thanks!
Doesn't flash for me.
TWRP says "Error flashing zip 'external_sdcard/download/miui.............'
Then updating partition tables...
Tried redownloading the file just to be sure.
Can i flash a language file for this Rom ?
I search for a german file.....
Status 7 error
Sent from my N7105 using xda app-developers app
Also figured id add it removes my root as TWRP reapplied root before I restarted.
Sent from my SGH-T889 using XDA Premium 4 mobile app
amazing rom working great so far
thanks for porting miui for n7105
onkeltoby said:
Can i flash a language file for this Rom ?
I search for a german file.....
Click to expand...
Click to collapse
it has to be ported as well,
the miui language packs are also device based, they have the n7100 listed on miuiandroid (note 2 t03g), but for the 7105 they haven't gotten a release, instead we are dependant off ports made by wonderfull users like jing
flashing a language pack from a different device will mess up the miui installation so unless jing decides to port the language pack your stuck with the default languages
Error 7 as well.. flashing over twrp to see if itll flash using that
---------- Post added at 09:49 PM ---------- Previous post was at 09:40 PM ----------
Stll no go..
Code:
format() expects 3 args, got 5
^ thats what i get ^
---------- Post added at 09:50 PM ---------- Previous post was at 09:49 PM ----------
YamazakiRobert said:
amazing rom working great so far
thanks for porting miui for n7105
Click to expand...
Click to collapse
Howd you get it to flash over?
I also have a issue with bad zip error (philz recovery)
Sent from my GT-N7105 using XDA Premium 4 mobile app
BBCHAMPs said:
Error 7 as well.. flashing over twrp to see if itll flash using that
---------- Post added at 09:49 PM ---------- Previous post was at 09:40 PM ----------
Stll no go..
Code:
format() expects 3 args, got 5
^ thats what i get ^
---------- Post added at 09:50 PM ---------- Previous post was at 09:49 PM ----------
Howd you get it to flash over?
Click to expand...
Click to collapse
i have modded the updater-script
YamazakiRobert said:
i have modded the updater-script
Click to expand...
Click to collapse
So flash the script then the ROM?
Sent from my GT-N7105 using xda app-developers app
mykalbrock said:
So flash the script then the ROM?
Sent from my GT-N7105 using xda app-developers app
Click to expand...
Click to collapse
No you actually replace the updater-script file in the zip. Its under folder: META-INF/com/google/android.
Trying it now so I will post back.
Sent from my GT-N7105 using XDA Premium 4 mobile app
---------- Post added at 05:43 PM ---------- Previous post was at 05:33 PM ----------
YamazakiRobert said:
i have modded the updater-script
Click to expand...
Click to collapse
FATKMZ said:
No you actually replace the updater-script file in the zip. Its under folder: META-INF/com/google/android.
Trying it now so I will post back.
Sent from my GT-N7105 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Didnt flash on mine. Same problem you had on page 1
Same here it just fails..it looks like it's going to install then nope it doesn't it fails
FATKMZ said:
No you actually replace the updater-script file in the zip. Its under folder: META-INF/com/google/android.
Trying it now so I will post back.
Sent from my GT-N7105 using XDA Premium 4 mobile app
---------- Post added at 05:43 PM ---------- Previous post was at 05:33 PM ----------
Didnt flash on mine. Same problem you had on page 1
Click to expand...
Click to collapse
please try again without the cert on meta-inf
YamazakiRobert said:
please try again without the cert on meta-inf
Click to expand...
Click to collapse
Testing now. Will report back
Still error 7.. :/
BBCHAMPs said:
Testing now. Will report back
Still error 7.. :/
Click to expand...
Click to collapse
Yep same error as first page still.
Thanks for trying
Any other ideas? Haha.
Sent from my GT-N7105 using XDA Premium 4 mobile app
BBCHAMPs said:
Testing now. Will report back
Still error 7.. :/
Click to expand...
Click to collapse
FATKMZ said:
Yep same error as first page still.
Thanks for trying
Any other ideas? Haha.
Sent from my GT-N7105 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
can anyone post me the recovery log
im tring to upload the full zip im using but my connection is terrible
I replaced both install and binary scripts with T Mobile Note 2 MIUI ones and I was able to flash it to Note without any issue. I also replaced the kernel with T Mobile. The only issue I see is both internal and external SD cards recognized by the PC when I connect through USB cable but I do not see any internal or external folders data.

Stock Recovery - D800 (may work with others)

Before I installed TWRP, I extracted the stock recovery in case anyone needed it for some reason. The zip file contains the recovery.img file and instructions.
Adam
Thanks this saved me!
Sent from my LG-D800 using Tapatalk
Anyone tried this on international D802?
wes3284 said:
Anyone tried this on international D802?
Click to expand...
Click to collapse
I'd like to know that too.
---------- Post added at 01:12 PM ---------- Previous post was at 01:08 PM ----------
revan17 said:
I'd like to know that too.
Click to expand...
Click to collapse
You can find the D802 recovery here. I'm just curious as to the method of installing it.
http://downloads.codefi.re/autoprime/LG/LG_G2/D802/Stock_Firmware
Anyone have the stock recovery of the Verizon variant?
Sent from my VS980 4G using XDA Premium 4 mobile app
eder5jga said:
Anyone have the stock recovery of the Verizon variant?
Sent from my VS980 4G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Well you can get it easily if you have a vzw kdz then use the kdz/tot extractor in the dev section and convert the recovery.bin to recovery.img using an app like magiciso
Sent from my LG-D800 running stock kk, rooted with philz using XDA app
---------- Post added at 10:51 PM ---------- Previous post was at 10:47 PM ----------
revan17 said:
I'd like to know that too.
---------- Post added at 01:12 PM ---------- Previous post was at 01:08 PM ----------
You can find the D802 recovery here. I'm just curious as to the method of installing it.
http://downloads.codefi.re/autoprime/LG/LG_G2/D802/Stock_Firmware
Click to expand...
Click to collapse
Well the way the op recommends it is:
1 - Copy recovery.img to root of SDCard
2 - Open Terminal Emulator (or adb shell) with root and run the following command-
dd if=/sdcard/recovery.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
3 - Reboot
But I don't know if that would work in all cases/haven't tried, the other way to flash it is by getting into fastboot mode via adb or something and using following commands:
-fastboot erase recovery
-fastboot flash recovery recovery.omg
Sent from my LG-D800 running stock kk, rooted with philz using XDA app
Is this OK for 4.4.2 20c FW? I see the original post is from last year. Just don't want to brick my newly bought phone. I just did root and install TWRP recovery. Now I see there is a 20u update and read that upgrading will result in bootloop. I wanna get back to stock recovery so I can safely upgrade
Sent from my LG-D800 using XDA Free mobile app
mmjuban said:
Is this OK for 4.4.2 20c FW? I see the original post is from last year. Just don't want to brick my newly bought phone. I just did root and install TWRP recovery. Now I see there is a 20u update and read that upgrading will result in bootloop. I wanna get back to stock recovery so I can safely upgrade
Sent from my LG-D800 using XDA Free mobile app
Click to expand...
Click to collapse
Did you manage to do it?
I needed to update too, similar thought process. Wondering whether i can flash this *.img using Flashify. I also made a backup of my stock recovery.img before I installed TWRP, could that be used either?
And most importantly, was the OTA update smooth after you got stock recovery back?
Worst case scenario, no TWRP recovery & unable to boot...
hi please help me
eraste said:
Thanks this saved me!
Sent from my LG-D800 using Tapatalk
Click to expand...
Click to collapse
hi i bought a refurbished lg g2d800 but accidentally i flashed a kdz file of d802 now my touch isnt working and imei is gone too please some body help mew

Nvidia source code

I seem to recall some binaries for the last nexus/nvidia tablet weren't released for developers? Do devs expect this to be true for the nexus9?
Sent from my SM-N900V using XDA Free mobile app
i dont think so
---------- Post added at 08:50 PM ---------- Previous post was at 08:50 PM ----------
uberjon said:
I seem to recall some binaries for the last nexus/nvidia tablet weren't released for developers? Do devs expect this to be true for the nexus9?
Sent from my SM-N900V using XDA Free mobile app
Click to expand...
Click to collapse
...
Vendor.img is the binaries. They are now in the factory image zip. It resides on it's own partition dev block 24 named VNR. This is why stock image is so big and probably why it won't flash. These binaries only change on update so should be able to remove vendor.img from zip and flash the zip without the low space error to factory restore..

Question pulling system image

If I pull the system image from my rooted lg urbane what is included in that system image? like will su and busybox stay and will it save any of my personal info or settings
Thanks Rob
Robshr said:
If I pull the system image from my rooted lg urbane what is included in that system image? like will su and busybox stay and will it save any of my personal info or settings
Thanks Rob
Click to expand...
Click to collapse
Everything will stay.
Sent from my Explorer A310e using Tapatalk
---------- Post added at 07:42 PM ---------- Previous post was at 07:42 PM ----------
But personal information and settings won't be saved
Sent from my Explorer A310e using Tapatalk

Categories

Resources