[Solved] How to edit /dev/mtd3 (System Image) - G1 Q&A, Help & Troubleshooting

Hi,
I would like to edit an official system rom.
I can have it in 2 format a NBH file, but i did not found a way to extract it or the file directly extracted from the phone with the command line:
cat /dev/mtd/mtd3 > /sdcard/mtd3.img.
It seems there is a way to extract it with a command line like:
gunzip -c mtd3.img | cpio -i
but i always have errors when laucnh it, like not in gzip format etc...
Does anybody has any clue about this?
Bye
Herc. 8)

hercule18 said:
Hi,
I would like to edit an official system rom.
I can have it in 2 format a NBH file, but i did not found a way to extract it or the file directly extracted from the phone with the command line:
cat /dev/mtd/mtd3 > /sdcard/mtd3.img.
It seems there is a way to extract it with a command line like:
gunzip -c mtd3.img | cpio -i
but i always have errors when laucnh it, like not in gzip format etc...
Does anybody has any clue about this?
Bye
Herc. 8)
Click to expand...
Click to collapse
unyaffs it?

Just tried and it gave:
Segmentation Fault
bye
Herc.

Try using nandroid to back it up, copy system.img to your nix box (cygwin might work), and unyaffs it. The contents will be extracted to the current directory, so set yourself up a working directory. Just a guess, but I think your image is becoming corrupted.

It Worked.
Thank you.
Herc.

Related

[TUTORIAL] Self-assembly of Android Firmwares

I just saw a tutorial in 4PDA by R0iz and wanted to share it here!
The link to the original post translated:
http://tinyurl.com/self-assembly-androidOS
Extract the files *. img
To extract system.img, used unyaffs (http://code.google.com/p/unyaffs/)
I have compiled under Ubuntu 64. With Unyaffs can only be extracted system.img.
To extract boot.img use extract-kernel.pl and extract-ramdisk.pl
# extract-kernel.pl boot.img
# extract-ramdisk.pl boot.img
Click to expand...
Click to collapse
Rebuilding boot.img
After extracting boot.img with the enclosed extract-*. pl
In order to collect boot.img with Custom kernel in the same folder run:
# mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Click to expand...
Click to collapse
Rebuilding system.img
At first glance it seems that you can simply mount the image and format it with YAFFS, but it's not because, as SPL Hero does not allow flash system.img directly.
You must use the format update.zip packages for this. (читайте ниже) (See below)
Write update.zip quite simple really. For example, to add the package test.apk in your rum:
- Create an empty folder <workdir>
- Create a folder structure for test.apk (<workdir> / system / app) and copy test.apk
- Create a folder structure for the update-script (<workdir> / META-INF/com/google/android)
- Edit <workdir> / META-INF/com/google/android/update-script
- Insert the following:
show_progress 0.1 0 show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM: copy_dir PACKAGE: system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app set_perm_recursive 0 0 0755 0644 SYSTEM: app
show_progress 0.1 10 show_progress 0.1 10
- Pack the contents <workdir> in zip (not the folder itself <workdir>, only its contents)
Now you have to sign a zip file. Testsign.zip download and copy it to your <SDK> / tools.
Unzip it there, thus creating a sub-folder sign with a file testsign. in it.
Then in the folder <workdir>, run this command:
java-classpath "<SDK> / tools / sign / testsign.jar" testsign file.zip file-signed.zip
Everything is now ready for your update.zip pouring into the apparatus by a modified recovery.
Click to expand...
Click to collapse
Change. Apk package
apk can just unpack an archive, change what you need and pack it back. But in the end you have to sign it as well as update.zip packages.
ODEX files
- What is it? Answer
- How to get rid of them?
For deodex ODEX files, use this howto
Then you can create classes.dex file by running smali from your "out". Then rename it to classes.dex and add it to apk.
- How to create them?
Use dexopt-wrapper on the device.
Click to expand...
Click to collapse
Porting ROM with other devices.
Well, this part is simple smile_good.gif
- Extract system.img
- Extract boot.img
- Replace boot.img-kernel of the original Roma HTC Hero.
- Rebuild boot.img
- Collect update.zip (see how it's done in any Custom rum for Hero)
- Sign and flash.
Device should start, and even be able to call, but probably will not work WiFi, BT, trackball.
Androsign script (Linux)
Androsign allows you to quickly sign the zip and apk. Just put it in <SDK> / tools, then CHMOD + X. If the path to the folder \ tools registered in the PATH, then you can run this script by typing:
androsign /dev/folder1/folder2/update.zip
He will Update-signed.zip (or App-signed.apk, etc.) in the same folder where the original file.
THANKS ARE WELCOMED!
Can we actually use this to port Sense or MIUI ?
this explains part of the process, the steps to do fo that purpose extracting and rebuilding but of course not about the code. i've heard MIUI is complex than sense
Most of us know this allready but nice to see it being said instead of learning the hard way
Sent from my GT540 using XDA Premium App

[9001]fix md5 mismatch

this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Good idea to post that (used it too with some backups). If you can't get into your device (bootloop etc) you should be able to do it on your pc. I tried doing it with md5sum (see attached) but it then adds an extra x0D (carriage return)... so if someone knows how to do this, please add to this topic
Regards,
Nika.
Thnx. can be very usefull
I have ca. 3 archives where I get md5 mismatch only one is restorable. Only for understanding do I only create an empty folder and make this or must I use the backup folder from my backup ?
Thx in advance
Dontron
DonTron said:
I have ca. 3 archives where I get md5 mismatch only one is restorable. Only for understanding do I only create an empty folder and make this or must I use the backup folder from my backup ?
Thx in advance
Dontron
Click to expand...
Click to collapse
Please explain what you mean. You have 3 backups that give you this error? Then you should go to each of those backup-folders and run "md5sum *img > nandroid.md5" (without the quotes off course). This will regenerate the md5 file and then the restore should work if the backup files are intact (I've had some backups with 0 kb files too)
..I tried and get "bad substitution"
Dontron
Edit: I renamed the folders and now I can use the command..give a try.
Gesendet von meinem GT-I9001 mit Tapatalk
..thx now it works like a charm and I can restore my old working rom.
Dontron
Gesendet von meinem GT-I9001 mit Tapatalk
You want to do it automatically through ADB? Here's a script:
Code:
@echo off
set FixMD5backup=[COLOR=Red][B]/mnt/sdcard/clockworkmod/backup/011-12-16.12.56.43[/B][/COLOR]
echo cd %FixMD5backup% >FixMD5.adb
echo pwd >>FixMD5.adb
echo ls -l -a * >>FixMD5.adb
echo chmod 666 nandroid.md5 >>FixMD5.adb
echo rm nandroid.md5 >>FixMD5.adb
echo md5sum *img *tar ^>nandroid.md5 >>FixMD5.adb
echo ls -l -a * >>FixMD5.adb
echo cat nandroid.md5 >>FixMD5.adb
echo exit >>FixMD5.adb
adb -d shell <FixMD5.adb
del FixMD5.adb
pause
Make sure the path is correct
Regards,
Nika.
rideriang said:
this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Click to expand...
Click to collapse
If you are using a back from your sdcard, you will need to mount r/w.
Here is what I did, and it worked perfect.
BETAlatform-tools akelly$ ./adb shell
# mount -o remount rw /sdcard
# cd sdcard/clockworkmod/backup/
# ls
2011-11-09.MIUI-1.11.4-base 2011-12-12-CM7-GlitchV13
2011-11-09.MIUI-GLITCH-1.11.4-loaded 2011-12-12-CM7-GlitchV13-basic
# cd 2011-12-12-CM7-GlitchV13
# ls
boot.img datadata.yaffs2.img system.yaffs2.img
cache.yaffs2.img nandroid.md5
data.ext4.tar recovery.img
# rm nandroid.md5
# md5sum *img > nandroid.md5
Click to expand...
Click to collapse
rideriang said:
this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Click to expand...
Click to collapse
Worked out perfectly. You are a scholar and a gentleman.
nikagl said:
Good idea to post that (used it too with some backups). If you can't get into your device (bootloop etc) you should be able to do it on your pc. I tried doing it with md5sum (see attached) but it then adds an extra x0D (carriage return)... so if someone knows how to do this, please add to this topic
Regards,
Nika.
Click to expand...
Click to collapse
For reference, attached is md5.exe and dos2unix.exe.
Here's the script to execute md5.exe (see attached) and make the nandroid.md5 on your pc:
Code:
@echo off
del nandroid.md5
for %%i in (boot.img,cache.ext4.tar,data.ext4.tar,recovery.img,system.ext4.tar,.android_secure.vfat.tar) do md5 %%i>>nandroid.md5 && echo %%i>>nandroid.md5
dos2unix nandroid.md5
pause
Btw, for everyone good to know, you can always run the md5sum from adb in clockworkmod recovery too (just before doing the backup, even when you're in the backup screen!):
Code:
adb shell
# cd /sdcard/clockworkmod/backup/[B]BACKUPDATE[/B]
# rm nandroid.md5
# md5sum *img >nandroid.md5
# exit
Regards,
Nika.
nikagl said:
... reference, attached is md5.exe and dos2unix.exe.
Here's the script to execute md5.exe (see attached) and make the nandroid.md5 on your pc:.
Click to expand...
Click to collapse
Hi,
Could you guide how to use the file? I'm totally newbie here. Using ClockWorkMod Touch Recovery Lilg for Galaxy Mini
Tq
exz8 said:
Hi,
Could you guide how to use the file? I'm totally newbie here. Using ClockWorkMod Touch Recovery Lilg for Galaxy Mini
Tq
Click to expand...
Click to collapse
Can you first check the filesize of each file that the backup created? If there's 0kb files you will not be able to restore them, do it with Advanced Restore one by one and you may be able to get back stuff...
If you don't know how to use the files I uploaded, I doubt a guide will help you
nikagl said:
Can you first check the filesize of each file that the backup created? If there's 0kb files you will not be able to restore them, do it with Advanced Restore one by one and you may be able to get back stuff...
If you don't know how to use the files I uploaded, I doubt a guide will help you
Click to expand...
Click to collapse
Inside backup folder have 2 files.
both files are same size. Under CWM Folder I found 2 files as attach.
Anything wrong?
exz8 said:
Inside backup folder have 2 files.
both files are same size. Under CWM Folder I found 2 files as attach.
Anything wrong?
Click to expand...
Click to collapse
That does not seem like a complete backup. Normally you also have a system.ext4.tar, data.ext4.tar and cache.ext4.tar. I guess this backup failed.
The only things you have is a kernel (boot.img) and the recovery.
wintel_mac said:
That does not seem like a complete backup. Normally you also have a system.ext4.tar, data.ext4.tar and cache.ext4.tar. I guess this backup failed.
The only things you have is a kernel (boot.img) and the recovery.
Click to expand...
Click to collapse
Right, I'd talk to the one that supports your cwm (touch recovery Lilg for Galaxy Mini)
I think I know already. Today, I had try backup and it's fine. Probably last time, I'm not use the proper method. Anyway, thanks for intention to help.
Tq
i am newbie
sorry for my question :
i have 03 clockworkmod backup in my ext_sd card named :
1 - 2012-05-08.16.48.10
2 - 2012-05-08.16.17.27
3 - 2012-05-02.02.25.41
i renamed them to :
1 - nitrox
2 - moon
3 - kqb
but when i try to restor i have md5 mismatch for all them
how to do for fix them all
please
EDIT : i finally understund the way :
i have moved clockworkmod from external_sd to sdcard
put the phone in usb debug
and than call adb shell with this :
adb shell
$ su
#
# cd /sdcard/clockworkmod/backup/nitrox
# rm nandroid.md5
# md5sum *img >nandroid.md5
# cd /sdcard/clockworkmod/backup/moon
# rm nandroid.md5
# md5sum *img >nandroid.md5
# cd /sdcard/clockworkmod/backup/kqb
# rm nandroid.md5
# md5sum *img >nandroid.md5
# exit
and then move back the clockworkmod to extrenal_sd and now all my backups work fine
thank you very much
rideriang said:
this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Click to expand...
Click to collapse
worked like a charm!!
THANK YOU!!!!
HTC EVO 4G CM7
very helpful
thanks ..

[MOD] Custom Boot Splash

Typically users beat me to the punch on things such as this. But no one has yet to do so, so here it is.
How to extract your param partition:
Code:
It's located in /dev/block/sda4. On device terminal or in adb terminal as root run,
dd if=/dev/block/sda4 of=/sdcard/param.bin bs=4096
Now that your param partition has been dumped you can copy it off the device as I do to work with it. Untar it with this command on linux:
Code:
mkdir /param
cd param
tar xf /path/to/param.bin
Once its untared to the param directory, you will see the contents. logo.jpg being the file you wish to change.
Once you have found/made a proper logo/splash in the proper resolution of 1440x2560 copy it to the param folder overwriting the old logo.jpg, and run this command in the param folder to pack it back up:
Code:
tar cf - `ls | sort -t.` > /path/to/where/you/want/to/save/param.bin
NOTE: The param partition has limited space, so keep this in mind. I have successfully used a 400kb jpeg with out issues. I wouldn't go much more then that.
Place the param.bin back on your sdcard and run the following to flash it:
Code:
dd if=/sdcard/param.bin of=/dev/block/sda4 bs=4096
Reboot and enjoy.
Users wishing to deploy all these commands on device (if you don't run linux) here is a script I made, tested and working to do so. Place files on device accordingly.
Code:
#!/sbin/busybox sh
# Extracting param partition
dd if=/dev/block/sda4 of=/sdcard/param.bin bs=4096
mkdir /sdcard/param
cd /sdcard/param
tar xf /sdcard/param.bin
# Replaceing logo.jpg, repacking and writing back to device
cp -f /sdcard/logo.jpg /sdcard/param/logo.jpg
rm -f /sdcard/param.bin
tar cf - `ls | sort -t.` > /sdcard/param.bin
dd if=/sdcard/param.bin of=/dev/block/sda4 bs=4096
Attached you will find a flashable zip of a custom boot screen i made. You're all welcome to use. As well as the Stock param.bin in case users wish to go back. And the image I made for the custom boot splash I'm attaching.
-Mr. X- said:
Typically users beat me to the punch on things such as this. But no one has yet to do so, so here it is.
How to extract your param partition:
Code:
It's located in /dev/block/sda4. On device terminal or in adb terminal as root run,
dd if=/dev/block/sda4 of=/sdcard/param.bin bs=4096
Now that your param partition has been dumped you can copy it off the device as I do to work with it. Untar it with this command on linux:
Code:
mkdir /param
cd param
tar xf /path/to/param.bin
Once its untared to the param directory, you will see the contents. logo.jpg being the file you wish to change.
Once you have found/made a proper logo/splash in the proper resolution of 1440x2560 copy it to the param folder overwriting the old logo.jpg, and run this command in the param folder to pack it back up:
Code:
tar cf - `ls | sort -t.` > /path/to/where/you/want/to/save/param.bin
NOTE: The param partition has limited space, so keep this in mind. I have successfully used a 400kb jpeg with out issues. I wouldn't go much more then that.
Place the param.bin back on your sdcard and run the following to flash it:
Code:
dd if=/sdcard/param.bin of=/dev/block/sda4 bs=4096
Reboot and enjoy.
Users wishing to deploy all these commands on device (if you don't run linux) here is a script I made, tested and working to do so. Place files on device accordingly.
Code:
#!/sbin/busybox sh
# Extracting param partition
dd if=/dev/block/sda4 of=/sdcard/param.bin bs=4096
mkdir /sdcard/param
cd /sdcard/param
tar xf /sdcard/param.bin
# Replaceing logo.jpg, repacking and writing back to device
cp -f /sdcard/logo.jpg /sdcard/param/logo.jpg
rm -f /sdcard/param.bin
tar cf - `ls | sort -t.` > /sdcard/param.bin
dd if=/sdcard/param.bin of=/dev/block/sda4 bs=4096
Attached you will find a flashable zip of a custom boot screen i made. You're all welcome to use. As well as the Stock param.bin in case users wish to go back. And the image I made for the custom boot splash I'm attaching.
Click to expand...
Click to collapse
Very nice! Thanks
If your phone is showing the "Custom (unlocked)" icon, will this override that?
Does this overwrite the carrier boot screen.
cambunch said:
If your phone is showing the "Custom (unlocked)" icon, will this override that?
Click to expand...
Click to collapse
In download mode? no it will not.
Thoth33 said:
Does this overwrite the carrier boot screen.
Click to expand...
Click to collapse
If the carrier put their logo in the param yes. if its a kernel boot animation no.
-Mr. X- said:
In download mode? no it will not.
Click to expand...
Click to collapse
During a regular boot. This is the first image that you see when powering on a phone, correct?
cambunch said:
During a regular boot. This is the first image that you see when powering on a phone, correct?
Click to expand...
Click to collapse
correct
This looks awesome! I'll have to prep an image to try out!
Edit:
After giving this a try, I appear to have managed to brick my phone. It seems that the only thing I can boot into is Download mode, and reflashing the firmware has not fixed this. Any ideas on how to resolve this? Much appreciated!!
Edit 2:
I saved myself with the Smart Sync (or whatever it's called) program on my PC. I was only able to do it though because I had written down the "Serial Number" for "just in case" purposes some time ago. I'm actually going to do a separate post to make this point for anyone who has similar issues but not from modifying boot splash.
The attached zip files work perfect on my S6 Edge. I unzipped the file, copied param.bin to my sdcard and used dd from the shell. Still trying to get a custom image to work. Getting a grey screen when I replace logo.jpg with my own. Any ideas?
Thanks again for sharing this -Mr. X-.
@-Mr. X-
Could you tell me which software you used to make your custom logo.jpg? I'm using photoshop on mac, however, everything made on this leads to the gray screen.
Thank you.
Can you please add 'powered by android' with new bugdroid icon on the bootsplash
Sent from my SM-G920I using Tapatalk
Will this work on the 925T edge?
I used Gimp, then i opened the picture in Microsoft Paint and re-saved it. I also ran into this but didn't know if Gimp was the cause but., this method worked for me.
It should also work on the edge but ensure your param partition is sda4 just to be safe.
-Mr. X- said:
I used Gimp, then i opened the picture in Microsoft Paint and re-saved it. I also ran into this but didn't know if Gimp was the cause but., this method worked for me.
It should also work on the edge but ensure your param partition is sda4 just to be safe.
Click to expand...
Click to collapse
Will do
The grey screen seems to be an issue while packing the files back with tar on Mac. I used photoshop on mac to make logo.jpg and packed it using tar on ubuntu. Works on 925I. And sda4 is the partition on edge as well for the bootsplash. Thanks for the help.
How to you get this to work little confused. Do you unzip the file or do you flash the zip
UAAO
Enviado desde mi SM-N910C mediante Tapatalk
Confuse bro .
Splaind tutorial
Can seone explaim how to change the splash screen thanls
ob1silvia said:
Can seone explaim how to change the splash screen thanls
Click to expand...
Click to collapse
Hi,
You can flash the zip file in post 1, with custom recovery..
Work perfect here, thx @-Mr. X-

How to backup a partition

How to backup - let's say boot - partition to a fastboot flashable file (*.img) format?
For example:
Code:
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/sdcard/boot.img
and so on.
Kostyan_nsk said:
For example:
Code:
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/sdcard/boot.img
and so on.
Click to expand...
Click to collapse
Thanks. So fastboot is using dd images. Please do confirm.
Regards.
You can use only boot and recovery images extracted by dd for flashing via fastboot.
Kostyan_nsk said:
You can use only boot and recovery images extracted by dd for flashing via fastboot.
Click to expand...
Click to collapse
Thanks
Kostyan_nsk said:
For example:
Code:
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/sdcard/boot.img
and so on.
Click to expand...
Click to collapse
I have done the backup to the image file as you have suggested.
I have copied image file to the linux computer, but when I try to mount the image file I get:
mount -o loop boot_orig_B830.img /mnt/boot/
mount: /dev/loop0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
What is the file system for this image?
Length of the image file is:
ls -l boot_orig_B830.img
-rw-rw-r-- 1 test test 16777216 Lis 13 22:04 boot_orig_B830.img
For Linux: google "unpackbootimg", "gunzip" and "cpio".
For Windows: google "AndImgTool".

Where does the original boot.img for magisk restore needs to be put

I put the boot.img to the MagiskManager folder but this does not work. What do I need to do? I read something about gzipping but I'd be grateful for instructions
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data
You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
ckpv5 said:
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data
You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
Click to expand...
Click to collapse
Oh I forgot to say I used your images and fastboot but fastboot doesn't work currently for me so i tried to use the normal method.
Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.
No idea how to fix your fastboot issue.
Benjamin_L said:
Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Click to expand...
Click to collapse
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
ckpv5 said:
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.
No idea how to fix your fastboot issue.
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
Click to expand...
Click to collapse
Fixed it with another laptop. Thank you for the time
How did you fix it ?
usernome said:
How did you fix it ?
Click to expand...
Click to collapse
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
JDKerados said:
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
Click to expand...
Click to collapse
I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.
Other than that it worked like a charm, thanks!
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
JDKerados said:
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
Click to expand...
Click to collapse
lap0 said:
I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.
Other than that it worked like a charm, thanks!
Click to expand...
Click to collapse
rophiroth said:
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
Click to expand...
Click to collapse
I'm in the same boat - I read that Magisk was supposed to autocreate a backup, if it did; it doesn't know where it went and I've tried a number of places (boot.img and gz zipped) and still nothing.
Android 12, Magisk 25.1
Thanks for any help!
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
This wanted me today on the Nothing Phone 1. Thanks so much!
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.
how to get past this?
v.konvict said:
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
Click to expand...
Click to collapse
That set of instructions didn't work for me - the one below that did (I'll quote it here):
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
JustinChase said:
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.
how to get past this?
Click to expand...
Click to collapse
Honestly, I'm not sure. It sounds like ADB Debugging may not be enabled on the phone's Developer Settings(?)
b_fizzle said:
That set of instructions didn't work for me - the one below that did (I'll quote it here):
Click to expand...
Click to collapse
I fixed the problem with just making sure i root my phone by letting magisk patch the boot image as it backs up the stock one while making the patched one.
I dug a bit deeper and discovered that shell was disallowed from within Magisk for some reason. I have no recolleciton of it asking me, but once i enabled it in magisk, I was able to su in a prompt and get my problem solved.

Categories

Resources