how to dump boot.bin? - P3400 ROM Development

how to dump boot.bin and xip.bin.

Related

Help: Rebuild img for change language

Add language
I test samsung s2 i9100
Extract I9100XXLPQ.tar.md5 --> factoryfs.img (sgs2toext4.jar) --> factoryfs.ext4.img
Ubuntu
...
mkdir /mnt/system
mount factoryfs.ext4.img /mnt/system
cp framework/*.apk /mnt/system/framework/ <---Language change here
cp app/*.apk /mnt/system/app/ <---Language change here
tar cvf factoryfs.img /mnt/system <---suspect here (!)
e2fsck factoryfs.img <--- can abort
umount /mnt/system
step1:
tar cvpf factoryfs.tar factoryfs.img
md5sum -t factoryfs.tar >> factoryfs.tar
mv factoryfs.tar factoryfs.tar.md5
factoryfs.tar.md5 flash with odin failed
step2:
tar -H ustar -c boot.bin cache.img factoryfs.img hidden.img modem.bin param.lfs Sbl.bin zImage > your_odin_package.tar
md5sum -t your_odin_package.tar >> your_odin_package.tar
mv your_odin_package.tar your_odin_package.tar.md5
your_odin_package.tar.md5 flash with odin
boot.bin ok
cache.img ok
factoryfs.img <--- failed here
....stop here.....
please, help me!
Thanks!
thanhlapvn said:
Add language
I test samsung s2 i9100
Extract I9100XXLPQ.tar.md5 --> factoryfs.img (sgs2toext4.jar) --> factoryfs.ext4.img
Ubuntu
...
mkdir /mnt/system
mount factoryfs.ext4.img /mnt/system
cp framework/*.apk /mnt/system/framework/ <---Language change here
cp app/*.apk /mnt/system/app/ <---Language change here
tar cvf factoryfs.img /mnt/system <---suspect here (!)
e2fsck factoryfs.img <--- can abort
umount /mnt/system
step1:
tar cvpf factoryfs.tar factoryfs.img
md5sum -t factoryfs.tar >> factoryfs.tar
mv factoryfs.tar factoryfs.tar.md5
factoryfs.tar.md5 flash with odin failed
step2:
tar -H ustar -c boot.bin cache.img factoryfs.img hidden.img modem.bin param.lfs Sbl.bin zImage > your_odin_package.tar
md5sum -t your_odin_package.tar >> your_odin_package.tar
mv your_odin_package.tar your_odin_package.tar.md5
your_odin_package.tar.md5 flash with odin
boot.bin ok
cache.img ok
factoryfs.img <--- failed here
....stop here.....
please, help me!
Thanks!
Click to expand...
Click to collapse
I think tar cvf factoryfs.image is basically just a tar file not a repacked ext4.image file so i think you should use the command or a tool to repack the image file and that you should continue step 1 or 2 with the repacked file, so what I am suggesting is you dont need these two lines
tar cvf factoryfs.img /mnt/system <---suspect here (!)
e2fsck factoryfs.img <--- can abort
after unmount, repack it in whatever way you like ,then proceed with step 1 or 2 with the repacked file.
Edit:And by repacking I dont mean compressing into a tar again, there maybe tools available for repacking.
Hmm I been meaning to ask you but did you try pushing both apk via a signed zip file through the stock recovery?
Sent from my GT-I9100 using xda app-developers app
king_below_my_lord said:
Hmm I been meaning to ask you but did you try pushing both apk via a signed zip file through the stock recovery?
Sent from my GT-I9100 using xda app-developers app
Click to expand...
Click to collapse
I create update zip (cwm) change language ok but i like build md5 flash via odin (no need recovery, no need root, no need update ver same ver pack update...)
thanhlapvn said:
I create update zip (cwm) change language ok but i like build md5 flash via odin (no need recovery, no need root, no need update ver same ver pack update...)
Click to expand...
Click to collapse
Lol, yeah to each his own preferences. But I always prefer the shortest way, where minimal action is needed, and with root I can make most changes from inside the OS, but I am intrigued which language did you insert?
Edit :Since the matter is over add Solved in title.
Sent from my GT-I9100 using xda app-developers app

How to flash samsung note 3 with zImage

Greetings
I have been trying to modify a stock image, and here is what I have done so far:
I found this link, and followed it in this manner: @ubuntu:~/expermental_stock$ umkbootimg boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 8262680
Kernel address 0x8000
Ramdisk size 1064985
Ramdisk address 0x2000000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x1e00000
Flash page size 2048
Board name is ""
Command line "console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0xFE208100
OFF_RAMDISK_ADDR is 0x00200100
OFF_SECOND_ADDR is 0xFF100100
Please modify mkbootimg.c using the above values to build your image.
****************
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x1dfff00 --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' -o new_boot.img
---------------
I copied the original zImage to a backup file:
I copied the original zImage to a backup file: @ubuntu:~/expermental_stock$ cp zImage backup_zImage
I moved my new zImage over: @ubuntu:~/expermental_stock$ cp ~/androidkernel3/arch/arm/boot/zImage .
@ubuntu:~/expermental_stock$ ls
aboot.mbn cache.img.ext4 modem.bin NON-HLOS.bin sbl1.mbn system.img.ext4
backup_zImage info N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar.md5 recovery.img sdi.mbn tz.mbn
boot.img initramfs.cpio.gz N900PVPUCNC5_N900PSPTCNC5_SPR.zip rpm.mbn SS_DL.dll zImage
ran the command again to "recompile" I assume this uses the new zImage @ubuntu:~/expermental_stock$ mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x1dfff00 --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' -o new_boot.img
[email protected]:~/expermental_stock$ ls
aboot.mbn cache.img.ext4 modem.bin new_boot.img rpm.mbn SS_DL.dll zImage
backup_zImage info N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar.md5 NON-HLOS.bin sbl1.mbn system.img.ext4
boot.img initramfs.cpio.gz N900PVPUCNC5_N900PSPTCNC5_SPR.zip recovery.img sdi.mbn tz.mbn @ubuntu:~/expermental_stock$ rm N900PVPUCNC5_N900PSPTCNC5_SPR.zip @ubuntu:~/expermental_stock$ mv backup_zImage /tmp/ @ubuntu:~/expermental_stock$ ls
aboot.mbn info N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar.md5 recovery.img sdi.mbn tz.mbn
boot.img initramfs.cpio.gz new_boot.img rpm.mbn SS_DL.dll zImage
cache.img.ext4 modem.bin NON-HLOS.bin sbl1.mbn system.img.ext4 @ubuntu:~/expermental_stock$ mv boot.img /tmp/
Renamed the new_boot.img to original name @ubuntu:~/expermental_stock$ mv new_boot.img boot.img @ubuntu:~/expermental_stock$
Oh I also moved the original files to /tmp @ubuntu:~/expermental_stock$ mv backup_zImage /tmp/ @ubuntu:~/expermental_stock$ mv boot.img /tmp/
[email protected]:~/expermental_stock$ ls
aboot.mbn info N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar.md5 rpm.mbn SS_DL.dll zImage
boot.img initramfs.cpio.gz NON-HLOS.bin sbl1.mbn system.img.ext4
cache.img.ext4 modem.bin recovery.img sdi.mbn tz.mbn
moved the original tar file to another directory
[email protected]:~/expermental_stock$ mv N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar.md5 /tmp/ @ubuntu:~/expermental_stock$
Then I used this link to create a tar.md5 file, and I ziped the whole thing again : @ubuntu:~/expermental_stock$ tar -H ustar -c * > N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar @ubuntu:~/expermental_stock$ md5sum -t N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar >> N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar @ubuntu:~/expermental_stock$ mv N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar N900PVPUCNC5_N900PSPTCNC5_N900PVPUCNC5_HOME.tar.md5 @ubuntu:~/expermental_stock$zip -r N900PVPUCNC5_N900PSPTCNC5_SPR *
I moved the zip file to a location I have used to to flash other images before. I get the unable to mount error, which I got before and was able to flash before. I have twrp on my phone. I also get the error "unable to open zip file".
Do you see anything wrong with what I have done?

Help with building and flashing a pre-rooted stock rom.

I've tried multiple methods, but I can't seem to get the pre-rooted ROM to flash properly, however, the completely stock ROM flashes just fine, so I'm wondering what in the heck I'm doing wrong.
Here's what I've done after I add the su binaries and deodexed:
-- make_ext4fs WITH -s
-- make_ext4fs WITHOUT -s
-- make_ext4fs WITHOUT -s THEN img2simg
-- This method
After those, I tried these:
-- tar -H ustar -c sboot.bin cm.bin boot.img recovery.img system.img cache.img modem.bin >> Flash.tar
-- tar cfx Flash.tar sboot.bin cm.bin boot.img recovery.img system.img cache.img modem.bin
-- Using 7zip to add the file to a pre-existing tar
-- Renaming system.img to system.img.ext4 (Didn't fail, but it just hanged at recovery at the top and system.img.ext4 as the last log entry)
However, every time it gets to the system.img, it fails, saying "Complete(Write) operation failed."
Is there any fix to this? Or is my phone not accepting a custom system.img?
I've used both Odin3 v3.10.7 and v1.85
Thanks in advance!

Stuck on Splash Screen Logo GT-I9300

I cant Flash or using odin, any help?
The log odin
<ID:0/004> Added!!
<ID:0/004> Odin v.3 engine (ID:4)..
<ID:0/004> File analysis..
<ID:0/004> SetupConnection..
<ID:0/004> Initialzation..
<ID:0/004> Get PIT for mapping..
<ID:0/004> Firmware update start..
<ID:0/004> sboot.bin
<ID:0/004> NAND Write Start!!
<ID:0/004> FAIL!
<OSM> All threads completed. (succeed 0 / failed 1)
<ID:0/004> Removed!!
I want try this but dont work, i can't make work then adb....
Go to recovery, (If PhilZ, turn the screen off by swiping to the left - to prevent burn-ins.. )
Open adb shell,
umount /data
umount /cache
umount /system
umount /preload
dd if=/dev/zero of=/dev/block/mmcblk0p8 bs=16M
dd if=/dev/zero of=/dev/block/mmcblk0p9 bs=16M
dd if=/dev/zero of=/dev/block/mmcblk0p10 bs=16M
dd if=/dev/zero of=/dev/block/mmcblk0p12 bs=16M
sync
And reboot to download mode from the reboot menu, use ODIN to flash stock firmware.
After flashing stock firmware, it'll automatically enter recovery to apply CSC.
After recovery exits, be quick and enter recovery manually yourself.
It'll complain it can't mount /cache and /data. Ignore and do a factory reset, and reboot.
Don't flash anything custom until you get stock firmware running perfectly.
0p8 = cache
0p9 = system
0p10 = preload
0p12 = data (will take tens of minutes)
At the end of each dd command, it will complain that no more space is available. That's normal, however if you got some another error, that means your nand is hardwarelically corrupted..
Are you trying to flash the latest stock ROM from sammobile.com, updato.com, or samsung-firmware.org?
Tried using the original Samsung USB cable?
The phone is in stock recovery mode so you can only sideload, which is useless.
You need to be in download mode to flash but you get pit errors so can't flash anything, you need to have twrp to have full adb.
I'm afraid your phone is F00ked.
As a last resort, try flashing the stock recovery on its own via odin & download mode. If it doesn't take then the phone is good for keeping your shelf dust free..

Question Trying to modify stock super.img

Hello,
I am trying to modify the stock system image by repacking the super.img. I was able to get everything repacked (thanks to this post https://forum.xda-developers.com/t/...r-img-and-flashing-our-modifications.4196625/) and was able to flash it seemingly without issues, but the changes just seemingly are not saved on device. I tried adding a dummy file in the root of the system image, I tried to modify build.props, but they seem to just take no effect. When running as root I can't see the file I made or the build.props changes I made. I even went as far as updating the AP image and reflashing BL,AP,CP, and CSC with Nand Erase and Re-Partition and still it seems like none of the changes are taking effect.
Here is the log from one of my attempts of flashing just the super.img:
<ID:0/020> Added!!
<ID:0/020> Odin engine v(ID:3.1401)..
<ID:0/020> File analysis..
<ID:0/020> Total Binary size: 5080 M
<ID:0/020> SetupConnection..
<ID:0/020> Initialzation..
<ID:0/020> Get PIT for mapping..
<ID:0/020> Firmware update start..
<ID:0/020> NAND Write Start!!
<ID:0/020> SingleDownload.
<ID:0/020> super.img
<ID:0/020> RQT_CLOSE !!
<ID:0/020> RES OK !!
<ID:0/020> Removed!!
<ID:0/020> Remain Port .... 0
<OSM> All threads completed. (succeed 1 / failed 0)
Am I doing something stupid? Am I missing something?
Thanks!
P.S. Here is the script I ended up making to repack the super.img:
#!/bin/bash -x
e2fsck -yf system.img
SYSTEM_SIZE=`stat -c '%s' system.img`
e2fsck -yf odm.img
ODM_SIZE=`stat -c '%s' odm.img`
e2fsck -yf vendor.img
VENDOR_SIZE=`stat -c '%s' vendor.img`
e2fsck -yf product.img
PRODUCT_SIZE=`stat -c '%s' product.img`
lpmake --metadata-size 65536 --super-name super --metadata-slots 1 --device super:6094323712 --group main:$(($SYSTEM_SIZE + $ODM_SIZE + $VENDOR_SIZE + $PRODUCT_SIZE)) \
--partition system:none:$SYSTEM_SIZE --image system=./system.img \
--partition vendor:none:$VENDOR_SIZE --image vendor=./vendor.img \
--partition product:none:$PRODUCT_SIZE --image product=./product.img \
--partition odm:none:$ODM_SIZE --image odm=./odm.img \
--output ./super.new.img
dd if=supermagic.bin bs=1 count=4096 of=super.new.img conv=notrunc
rm -f super.img
img2simg super.new.img super.img
rm -f super.img.lz4
lz4 -B6 --content-size super.img
rm -f super.img.lz4.tar
tar -cf super.img.lz4.tar super.img.lz4
Where `super.img.lz4.tar` is the file I flash using Odin.
Oh, and supermagic.bin is the first 4KB of the stock image. It would not flash without adding that.

Categories

Resources