Flashing LineageOS -> stock: repartition fails - Samsung Galaxy S7 Questions and Answers

So I'm trying to restore a stock ROM on a G930F that had LineageOS on it. I got an EU version from Sammobile, and inferred the original partitions from strings in the PIT file. So I thought this heimdall commandline should do what I want, but it doesn't:
Code:
# heimdall flash --repartition --pit HEROLTE_EUR_OPEN_HIDDEN60M.pit \
--PARAM param.bin --BOOT boot.img --RECOVERY recovery.img --RADIO modem.bin \
--SYSTEM system.img --CACHE cache.img --HIDDEN hidden.img \
--CP_DEBUG modem_debug.bin
Heimdall v1.4.2
[blah, all fine so far]
Session begun.
Uploading PIT
ERROR: Failed to receive PIT file part response!
ERROR: PIT upload failed!
Ending session...
Rebooting device...
I've even skimmed heimdall's source around where that error message turns up, but to no avail. Somehow a packet isn't being sent by the phone and I have no clue why. Any ideas?

mbethke said:
So I'm trying to restore a stock ROM on a G930F that had LineageOS on it. I got an EU version from Sammobile, and inferred the original partitions from strings in the PIT file. So I thought this heimdall commandline should do what I want, but it doesn't:
Code:
# heimdall flash --repartition --pit HEROLTE_EUR_OPEN_HIDDEN60M.pit \
--PARAM param.bin --BOOT boot.img --RECOVERY recovery.img --RADIO modem.bin \
--SYSTEM system.img --CACHE cache.img --HIDDEN hidden.img \
--CP_DEBUG modem_debug.bin
Heimdall v1.4.2
[blah, all fine so far]
Session begun.
Uploading PIT
ERROR: Failed to receive PIT file part response!
ERROR: PIT upload failed!
Ending session...
Rebooting device...
I've even skimmed heimdall's source around where that error message turns up, but to no avail. Somehow a packet isn't being sent by the phone and I have no clue why. Any ideas?
Click to expand...
Click to collapse
Use a Windows PC and ODIN? (ODIN 3.12.7 for Nougat, 3.13.1 for Oreo)

*Detection* said:
Use a Windows PC and ODIN? (ODIN 3.12.7 for Nougat, 3.13.1 for Oreo)
Click to expand...
Click to collapse
Thanks, that did it indeed! I had actually tried Odin before but it turned out I had an old version, 3.12.7 works fine.

mbethke said:
Thanks, that did it indeed! I had actually tried Odin before but it turned out I had an old version, 3.12.7 works fine.
Click to expand...
Click to collapse
:good:

Related

[help]flashing on linux!

m on linux right now n i want to use odin for flashing firmware on my phone
any idea how can i flash my fone? any other workaround?
p.s. i tried installing wine but no benefit as i doesn't detect my fone , i also installed usb drivers still no luck
sachin sharma said:
m on linux right now n i want to use odin for flashing firmware on my phone
any idea how can i flash my fone? any other workaround?
p.s. i tried installing wine but no benefit as i doesn't detect my fone , i also installed usb drivers still no luck
Click to expand...
Click to collapse
Don't use wine for this kind of things.
Use heimdall.
Here a tutorial: http://forum.xda-developers.com/showthread.php?t=1496705
However I prefer to do this:
Code:
heimdall flash --pit latona_20110114.pit --primary-boot boot.bin --secondary-boot Sbl.bin --normal-boot normalboot.img --cache cache.rfs --modem modem.bin --param param.lfs --system system.rfs
(your /data partition is not touched)
loSconosciuto said:
Don't use wine for this kind of things.
Use heimdall.
Here a tutorial: http://forum.xda-developers.com/showthread.php?t=1496705
However I prefer to do this:
Code:
heimdall flash --pit latona_20110114.pit --primary-boot boot.bin --secondary-boot Sbl.bin --normal-boot normalboot.img --cache cache.rfs --modem modem.bin --param param.lfs --system system.rfs
(your /data partition is not touched)
Click to expand...
Click to collapse
thnx for poitning me to correct thread
earlier i was using heimindall from some other thread which was not working properly thnk u so much!!!

i9505 How-to install stock ROM using Heimdall under linux

OK! So, finally got this working. Thought I share how i did this...
I had previously installed CM 10.1, but wanted to try out the stock firmware (I9505XXUBMEA_I9505OXABMEA). As I do not have windows, I had to use Heimdall under Ubuntu 13.04 64-bits. As far as I know, there is no post on this for our device.
I will keep this simple. I did not succeed with Heimdall 1.3, but Heimdall 1.4 R1 worked fine (R2 untested).
In brief, I ran the following commands as root (given that heimdall executable is in the untarred folder of the firmware):
Code:
heimdall flash --APNHLOS NON-HLOS.bin
heimdall flash --ABOOT aboot.mbn
heimdall flash --BOOT boot.img
heimdall flash --HIDDEN hidden.img.ext4
heimdall flash --MDM modem.bin
heimdall flash --RECOVERY recovery.img
heimdall flash --RPM rpm.mbn
heimdall flash --SBL2 sbl2.mbn
heimdall flash --SBL3 sbl3.mbn
heimdall flash --SYSTEM system.img.ext4
heimdall flash --TZ tz.mbn
heimdall flash --CACHE cache.img.ext4
This will reboot the device multiple times, and can of course be done more elegantly in one simple command. However, this is how I did it.
The last command (CACHE) reboots the device into recovery (So recovery must be flashed first).
Flashing is fast, only minutes. No troubles or reflashes. Everything appears to work, including wifi and 4G.
Hope you will find this useful. Now...lets try Omega ROM 5.0....:laugh: (Ubuntu Touch coming up???)
A million thanks to Benjamin Dobell (http://www.glassechidna.com.au/) who wrote Heimdall!
Best regards,
I have tested this flashing stock ROM, CM, Omega 5/6, modems.
No reflashes, no problems.
Those having difficulties with wifi/LTE and having to reflash modem multiple times may want to check it out....
Only tested under Ubuntu 13.04 64. You need Heimdall 1.4R1 or later...
Problems with WiFi after upgrade???
For upgrading from Omega 5 to Omega 6 do this:
1. Flash Omega 6 from Recovery (I use Phil's, effortless, no wiping).
2. Put heimdall 1.4R1 (or later) into a seperate folder together with NON-HLOS.bin and modem.bin from the I9505XXUBMF4_modems.tar
3. Than boot i9505 into download mode and issue...
sudo heimdall flash --APNHLOS NON-HLOS.bin
Click to expand...
Click to collapse
4. This will automatically poweroff your device. Reboot into download mode and from terminal issue...
sudo ./heimdall flash --MDM modem.bin
Click to expand...
Click to collapse
5. This will poweroff your i9505. Fire it up and you are good to go!
Modems are flashed and Wifi works. Easy piecy...nice and clean...works at first shot!
How do you install Heimdall?
I tried downloading and using the .deb file, but it hangs when trying to flash firmware.
Ending session...
Re-attaching kernel driver...
Click to expand...
Click to collapse
After that, I uninstalled Heimdall and tried compiling from source. It gave an error when I tried flashing.
ERROR: Failed to access device. libusb error: 0
Click to expand...
Click to collapse
Ubuntu 13.04 64bit
I'm using 32-bits ubuntu.
Got msg.
Code:
flash --SYSTEM system.img.ext4
ERROR: Failed to open file "system.img.ext4"
How to fix this?
Did you also flash bootloader?
Sent from my GT-N7100 using Tapatalk 4 Beta
echo_rc said:
Did you also flash bootloader?
Sent from my GT-N7100 using Tapatalk 4 Beta
Click to expand...
Click to collapse
Yes. All others stock files have flashed.
Also I recompile heimdall with -D_FILE_OFFSET_BITS=64
Code:
Session begun.
Downloading device's PIT file...
PIT file download successful.
Uploading SYSTEM
100%
ERROR: Failed to confirm end of file transfer sequence!
ERROR: SYSTEM upload failed!
Ending session...
Rebooting device...
Releasing device interface...
Re-attaching kernel driver...
Thanks a lot for this info, managed to reflash my i9505 correctly in OSX with the latest release (4.3) XXUEMJ5 after trying odin under vmware and failing.
You could use this one line:
--APNHLOS NON-HLOS.bin --ABOOT aboot.mbn --BOOT boot.img --HIDDEN hidden.img.ext4 --MDM modem.bin --RECOVERY recovery.img --RPM rpm.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --SYSTEM system.img.ext4 --TZ tz.mbn --CACHE cache.img.ext4
svs57 said:
I'm using 32-bits ubuntu.
Got msg.
Code:
flash --SYSTEM system.img.ext4
ERROR: Failed to open file "system.img.ext4"
How to fix this?
Click to expand...
Click to collapse
I get the same error. I think I'm also running 32-bit. But I forgot.
lzk123 said:
How do you install Heimdall?
I tried downloading and using the .deb file, but it hangs when trying to flash firmware.
After that, I uninstalled Heimdall and tried compiling from source. It gave an error when I tried flashing.
Ubuntu 13.04 64bit
Click to expand...
Click to collapse
Hi I use mint 15 (13.04)
I went to the heimdall website and grabbed the latest amd64 deb files. I also installed the 32bit libraries from the ubuntu and mint depo's
Then installed the deb files.
I use sudo heimdall to do my flashes.
Does the hanging occur on your PC or just download mode?
lzk123 said:
How do you install Heimdall?
I tried downloading and using the .deb file, but it hangs when trying to flash firmware.
After that, I uninstalled Heimdall and tried compiling from source. It gave an error when I tried flashing.
Ubuntu 13.04 64bit
Click to expand...
Click to collapse
U need to have the "sudo" command in front because libusb requires root privilege.
so do this instead:
sudo heimdall flash --MDM blah blah blah
you are require to enter your username password
Just tried with Heimdall 1.4.0 on OS X (on i9505, stock 4.3) and it seems to have worked!
the one command for this is: heimdall flash --APNHLOS NON-HLOS.bin --ABOOT aboot.mbn --BOOT boot.img --HIDDEN hidden.img.ext4 --MDM modem.bin --RECOVERY recovery.img --RPM rpm.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --SYSTEM system.img.ext4 --TZ tz.mbn --CACHE cache.img.ext4
hope this helps someone
When I untar the stock firmware I don't see any bin files
9195XXUBML4_I9195O2UBMJ1_I9195XXUBML4_HOME.tar.md5
rpm.mbn system.img.ext4
aboot.mbn sbl1.mbn tz.mbn
boot.img sbl2.mbn
recovery.img sbl3.mbn
Only boot and recovery.img and some .mbn files
What am I missing?
9195XXUBML4_I9195O2UBMJ1_I9195XXUBML4_HOME.tar.md5
paamet said:
OK! So, finally got this working. Thought I share how i did this...
I had previously installed CM 10.1, but wanted to try out the stock firmware (I9505XXUBMEA_I9505OXABMEA). As I do not have windows, I had to use Heimdall under Ubuntu 13.04 64-bits. As far as I know, there is no post on this for our device.
I will keep this simple. I did not succeed with Heimdall 1.3, but Heimdall 1.4 R1 worked fine (R2 untested).
In brief, I ran the following commands as root (given that heimdall executable is in the untarred folder of the firmware):
Code:
heimdall flash --APNHLOS NON-HLOS.bin
heimdall flash --ABOOT aboot.mbn
heimdall flash --BOOT boot.img
heimdall flash --HIDDEN hidden.img.ext4
heimdall flash --MDM modem.bin
heimdall flash --RECOVERY recovery.img
heimdall flash --RPM rpm.mbn
heimdall flash --SBL2 sbl2.mbn
heimdall flash --SBL3 sbl3.mbn
heimdall flash --SYSTEM system.img.ext4
heimdall flash --TZ tz.mbn
heimdall flash --CACHE cache.img.ext4
This will reboot the device multiple times, and can of course be done more elegantly in one simple command. However, this is how I did it.
The last command (CACHE) reboots the device into recovery (So recovery must be flashed first).
Flashing is fast, only minutes. No troubles or reflashes. Everything appears to work, including wifi and 4G.
Hope you will find this useful. Now...lets try Omega ROM 5.0....:laugh: (Ubuntu Touch coming up???)
A million thanks to Benjamin Dobell (http://www.glassechidna.com.au/) who wrote Heimdall!
Best regards,
Click to expand...
Click to collapse
complience said:
When I untar the stock firmware I don't see any bin files
9195XXUBML4_I9195O2UBMJ1_I9195XXUBML4_HOME.tar.md5
rpm.mbn system.img.ext4
aboot.mbn sbl1.mbn tz.mbn
boot.img sbl2.mbn
recovery.img sbl3.mbn
Only boot and recovery.img and some .mbn files
What am I missing?
9195XXUBML4_I9195O2UBMJ1_I9195XXUBML4_HOME.tar.md5
Click to expand...
Click to collapse
Hello!
You don't have to worry. Flash it. In some packages it is like that. When I tried to flash Ace stock ROM, it was like that.
Code:
heimdall flash --ABOOT aboot.mbn --RECOVERY recovery.img --RPM rpm.mbn --SBL1 sbl1.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --SYSTEM system.img.ext4 --TZ tz.mbn
Use the above code to flash. For your own safety, re-check the code and also check whether every files are included in it.
Kindly,
MZ
Code:
$ sudo heimdall flash --pit s4pit.pit --APNHLOS NON-HLOS.bin --MDM modem.bin --SBL1 sbl1.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --SYSTEM system.img.ext4 --CACHE cache.img.ext4 --BOOT boot.img --RECOVERY recovery.img --HIDDEN hidden.img.ext4
ERROR: Failed to open file "system.img.ext4"
Guys what's wrong? I've just installed heimdall & heimdall-frontend from source (1.4.1), I'm trying to instal stock ROM on my i9505. I'm using Ubuntu 14, 32 bit. I cannot find any solution so far ..
kujawek said:
Code:
$ sudo heimdall flash --pit s4pit.pit --APNHLOS NON-HLOS.bin --MDM modem.bin --SBL1 sbl1.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --SYSTEM system.img.ext4 --CACHE cache.img.ext4 --BOOT boot.img --RECOVERY recovery.img --HIDDEN hidden.img.ext4
ERROR: Failed to open file "system.img.ext4"
Guys what's wrong? I've just installed heimdall & heimdall-frontend from source (1.4.1), I'm trying to instal stock ROM on my i9505. I'm using Ubuntu 14, 32 bit. I cannot find any solution so far ..
Click to expand...
Click to collapse
Hi kujawek! It is some problem with your system image of the stock ROM you downloaded. Try to re-download the stock ROM and do it again. Hope it works!
~~MZ~~
Muhammed Zakhir said:
Hi kujawek! It is some problem with your system image of the stock ROM you downloaded. Try to re-download the stock ROM and do it again. Hope it works!
~~MZ~~
Click to expand...
Click to collapse
I did it more than few times.
I've read somewhere that in latest Heimdall version it uses some different thing named "libusb" and that it's only possible to do it on Windows with heimdall 1.4.1.rc2 version. But it was easier for me to just use Odin on friend's computer
To install libusd on Linux Ubuntu :
Code:
Code:
sudo apt-get install libusb-dev
Upgrade:
Code:
sudo bash -c "apt-get update && apt-get upgrade"
~~MZ~~
Can I use Heimdall (the Mac OSX GUI) to flash a nandroid backup to my 9505?
In the nandroid there are all these files: boot.img, data.ext4.tar, recovery.img, system.ext4.tar - will this be the same as if I would restore the nandroid backup with CWM?
My phone doesnt start anymore and I tried a lot already, but CWM doesn't work anymore, so I look for a way to revive it.

[Q] why don't ROMs come with the correct pit?

For instance I'm trying to flash stock from sammobile
G920FXXU1AOE3_G920FXEU1AODQ_XEU.tar
which contains
boot.img
cache.img
cm.bin
hidden.img
modem.bin
recovery.img
sboot.bin
system.img
odin fails as soon as it gets to a bin file
That's ok I can just remove the bin files and it installs fine.
my understanding is that it's failing because the partitions are not all the same size. So what? If the pit was there it wouldn't matter, it could repartition and everything would be hunky dory?
Why is the pit not there, and where do I get the correct one? 32Gb
ZEROFLTE_EUR_OPEN-sb256-128.zip
ZEROFLTE_EUR_OPEN-sb200.zip
ZEROFLTE_EUR_OPEN-sb.zip
ZEROFLTE_EUR_OPEN-HIDDEN100M.pit
also I can't grab/backup my current pit with
dd if=/dev/block/mmcblk0 of=/sdcard/out.pit bs=8 count=580 skip=2176
because there is no mmcblk0
The TAR file is basically an archive. Just open it with WinRAR and delete cache.img and hidden.img from the archive.
You will be able to flash any firmware without the PIT file.
neflictus said:
The TAR file is basically an archive. Just open it with WinRAR and delete cache.img and hidden.img from the archive.
You will be able to flash any firmware without the PIT file.
Click to expand...
Click to collapse
'
How do remove these files? This doesn't seem possible? Regards

a750g deleted bootloader exynos

can anyone help with creating files for unbrick using MultiDownloader
1 BL1
2 Bl2.bin;
3 dram_el3mon.bin
4 dram_train.bin
5 epbl.bin
6 s-boot.bin
I uploaded sboot from firmware that was in the device
I also found boot1 and boot2 on YouTube for model a750f, should be the same since its a exynos 7885
eldon301 said:
can anyone help with creating files for unbrick using MultiDownloader
1 BL1
2 Bl2.bin;
3 dram_el3mon.bin
4 dram_train.bin
5 epbl.bin
6 s-boot.bin
I uploaded sboot from firmware that was in the device
I also found boot1 and boot2 on YouTube for model a750f, should be the same since its a exynos 7885
Click to expand...
Click to collapse
why you don't use heimdall and samloder for download original firmware tested on my SM-A750FN and I was angry theta this two programs saved my phone evrytime (one rule never flash **** on boot partitions use original fw. then you will be never Brik a phone.
use samloader like instructions
then flash in order one after another files in download mode on phone using himedall (download mode press both volume buttons and put cable in connected to pc) then use command to veryfite if device in developer mode is connected "add devices" then you use "adb reboot bootloader" then you downloads the pit file from phone to veryfite all partitions name on phone and files on computer for flash width heimadall, then flash original firmware
like me to extract original firmware on Mac OS (maybe on linux you must use other arguments for commands)
firmware to download on galaxyfirmware
for download mode press both volume buttons and put cable connected to pc
after download firmware you get it reddy for flash release firmware.zip width path of your zip
unzip -x *.zip ; rm -rf HOME_CSC* *.txt ; for f in *.md5; do tar xf $f; done && rm -rf *.md5 && unlz4 -dm *.lz4 && rm -rf *.lz4
Click to expand...
Click to collapse
then you flash it width heimdall
14 partitions in line order for flash
heimdall flash --BOOTLOADER sboot.bin --CM cm.bin --BOOT boot.img --RECOVERY recovery.img --SYSTEM system.img --VENDOR vendor.img --CACHE cache.img --ODM odm.img --OMR omr.img --HIDDEN hidden.img --RADIO modem.bin --PARAM param.bin --CP_DEBUG modem_debug.bin --USERDATA userdata.img
Click to expand...
Click to collapse

Can't unlock bootloader on Samsung Galaxy A5

Hi,
I just bought an old Samsung Galaxy A5 (SM-A500FU) phone for experimenting purposes. I'd like to install LineageOS on this phone.
Apparently the phone has already been fiddled with. When booting into Download mode, it says "Current binary: Custom". So I downloaded the official firmware from sammobile.com and flashed it using Heimdall (I'm running Linux on my laptop):
Code:
heimdall flash \
--APNHLOS NON-HLOS.bin \
--MODEM modem.bin \
--SBL1 sbl1.mbn \
--ABOOT aboot.mbn \
--RPM rpm.mbn \
--QSEE tz.mbn \
--QHEE hyp.mbn \
--sec sec.dat \
--BOOT boot.img \
--RECOVERY recovery.img \
--SYSTEM system.img.ext4 \
--CACHE cache.img.ext4 \
--HIDDEN hidden.img.ext4
The official LineageOS documentation for my phone states to unlock the bootloader via the "OEM unlock" option in the developer options. Unfortunately this option is not showing on my phone, and judging from the number of blog posts on the web, I'm not the only one who's having this problem. Unfortunately the "solutions" offered on the web are not working, and most of them seem to be clickbait trash anyway.
Which leaves me clueless on how to unlock my bootloader. Any suggestions ?
PS : if you want to help, please post a method that works in your reply. Not some weird invitation to Discord, Telegram or some other obscure communication channel. This forum will do perfectly.
Hello kikinovak,
i have the same problem, but with a win10-pc. Because there is Stock-Android 6 on the mobile phone, there is no "OEM Unlock" in the developer options... Odin finds the device in fastboot mode, but i've to unlock the bootloader first...
Not really an advice, but who knows... ;o)
greetings from austria
on https://www.getdroidtips.com/oem-unlocking/ there is a new (but not helpful for me) info:
Now for devices launched in 2015 or later, type the following command: fastboot flashing unlock.
For devices launched prior to 2015, type the following command: fastboot oem unlock.
kikinovak said:
Hi,
I just bought an old Samsung Galaxy A5 (SM-A500FU) phone for experimenting purposes. I'd like to install LineageOS on this phone.
Apparently the phone has already been fiddled with. When booting into Download mode, it says "Current binary: Custom". So I downloaded the official firmware from sammobile.com and flashed it using Heimdall (I'm running Linux on my laptop):
Code:
heimdall flash \
--APNHLOS NON-HLOS.bin \
--MODEM modem.bin \
--SBL1 sbl1.mbn \
--ABOOT aboot.mbn \
--RPM rpm.mbn \
--QSEE tz.mbn \
--QHEE hyp.mbn \
--sec sec.dat \
--BOOT boot.img \
--RECOVERY recovery.img \
--SYSTEM system.img.ext4 \
--CACHE cache.img.ext4 \
--HIDDEN hidden.img.ext4
The official LineageOS documentation for my phone states to unlock the bootloader via the "OEM unlock" option in the developer options. Unfortunately this option is not showing on my phone, and judging from the number of blog posts on the web, I'm not the only one who's having this problem. Unfortunately the "solutions" offered on the web are not working, and most of them seem to be clickbait trash anyway.
Which leaves me clueless on how to unlock my bootloader. Any suggestions ?
PS : if you want to help, please post a method that works in your reply. Not some weird invitation to Discord, Telegram or some other obscure communication channel. This forum will do perfectly.
Click to expand...
Click to collapse
Hello,
Create a Windows VM and pass through all USB-input. It makes a lot easier!
You have to download the Samsung Drivers & Odin3 to your PC - install them.
Boot your phone ->ADB enabled (you don´t need the OEM-Unlock function, since it unlocks itself while flashing TWRP)<- into download mode (Vol. down + home + power).
Now flash your device specific TWRP with the AP-button using Odin3.
Make sure to uncheck auto reboot in Odin!
Unplug your phone, and hold Vol. up + home + power to boot into TWRP.
If you want to flash Lineage 18, make sure the TWRP version is at least 3.2, otherwise you´ll end up with error 7.
Feel free to ask me for help, in case you should need any!
Useful Links:
Samsung Android USB Driver | Samsung Developers
You need the driver only if you are developing on Windows and want to connect a Samsung Android device to your development environment over USB.
developer.samsung.com
[RECOVERY][ROOT][TWRP 3.0.2-1]Samsung Galaxy A5(2015) SM-A500F/FU/G/H/M
Unofficial release -TWRP recovery for the Galaxy A5 - SM-A500F/FU/G/H/M, Qualcomm MSM8916 https://twrp.me/site/update/2016/04/05/twrp-3.0.2-0-released.html SEANDROID warning fix Recovery reboot fix Modem, APNHLOS, EFS and Recovery partition...
forum.xda-developers.com
Releases · DeadSquirrel01/lineage-17_a5_releases
lineageos 17 releases for Galaxy A5. Contribute to DeadSquirrel01/lineage-17_a5_releases development by creating an account on GitHub.
github.com
Download Odin 3.13.1 - Samsung Odin download with ROM Flashing Tool
Odin download. Download Samsung odin 3.13.1, latest Samsung ROM Flashing Tool for android - Samsung odin download
odindownload.com
This is what i´ve tested on my SM-A500FU.

Categories

Resources