[RECOVERY][ROOT]TWRP 3.2.3-1 Galaxy Tab S4 - T830/T835

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Thanks.

I've repacked the dtb and kernel using a different method. Hopefully this one works.

https://androidfilehost.com/?fid=1322778262904008454
Cheers.

Well, we're back to good and bad news again.

The good news is that this version (r4) once again boots. The bad news is that I can't mount any file-systems, can't see the external SD card, can't connect over adb, can't save a log, etc.

Was this a repacking of r2 or r3, i.e. custom or stock kernel?

Let me know if there's anything you want me to try, or any other information I can provide.
 

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Cheers.

Well, we're back to good and bad news again.

The good news is that this version (r4) once again boots. The bad news is that I can't mount any file-systems, can't see the external SD card, can't connect over adb, can't save a log, etc.

Was this a repacking of r2 or r3, i.e. custom or stock kernel?

Let me know if there's anything you want me to try, or any other information I can provide.
Have you formatted DATA?
Also is SYSTEM not mountable?
To get ADB working try disabling MTP.

R4 is a repack of the custom kernel and dtb, or at least I thought it was.
Will have to check that. Have split, unpacked, recompiled that many now, I may have fudged up
:eek:
 
Last edited:
  • Like
Reactions: sbluescab

sbluescab

Member
Jan 10, 2011
20
2
0
Hi, I've tried to format Data many times already but it doesn't work. You may find more details in the Photo. Thanks. IMG20180918221423.jpeg

Sent from my CPH1871 using Tapatalk
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Have you formatted DATA?
I tried, but it failed. I've attached a couple of photos of the various error messages.

Also is SYSTEM not mountable? To get ADB working try disabling MTP.
System isn't mountable, no. No file-system is.

Disabling MTP doesn't make adb work. I can't even open a TWRP terminal.

Something is fundamentally borked. I suspect that when you find that one thing, everything will suddenly work.
 

Attachments

Last edited:

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
I tried, but it failed. I've attached a couple of photos of the various error messages.



System isn't mountable, no. No file-system is.

Disabling MTP doesn't make adb work. I can't even open a TWRP terminal.

Something is fundamentally borked. I suspect that when you find that one thing, everything will suddenly work.
It looks like i may have used the stock kernel. As you say all those issues are attributed to one thing.
I was real tired last night when I repacked everything.
I only get an hour a night to mess about on the PC while the missus is out walking, so wanted to get it up before she came back.
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
It looks like i may have used the stock kernel. As you say all those issues are attributed to one thing.
I was real tired last night when I repacked everything.
I only get an hour a night to mess about on the PC while the missus is out walking, so wanted to get it up before she came back.
No worries. I'm no stranger to time constraints and fatigue.

I test the builds as fast as I can at this end to reduce the turnaround time, so that I'm at least not the bottleneck. I'm just grateful you have any time and inclination at all for this project, given that you don't own the device.

Slow and steady wins the race. I'm sure we'll get there in the end, just as we did with the Tab S3.
 

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
No worries. I'm no stranger to time constraints and fatigue.

I test the builds as fast as I can at this end to reduce the turnaround time, so that I'm at least not the bottleneck. I'm just grateful you have any time and inclination at all for this project, given that you don't own the device.

Slow and steady wins the race. I'm sure we'll get there in the end, just as we did with the Tab S3.
Doh! :silly: sure enough had repacked with stock kernel and dtb. Double checked this time, so hopefully fingers crossed it boots.

https://androidfilehost.com/?fid=1322778262904008723
 
  • Like
Reactions: ianmacd

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Doh! :silly: sure enough had repacked with stock kernel and dtb. Double checked this time, so hopefully fingers crossed it boots.

https://androidfilehost.com/?fid=1322778262904008723
I had really high hopes this time, but I'm afraid it doesn't boot. The device is stuck in download mode again.

It seems each generation of device is trickier than its predecessor when it comes to TWRP and rooting.
 
  • Like
Reactions: machx1111

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
I had really high hopes this time, but I'm afraid it doesn't boot. The device is stuck in download mode again.

It seems each generation of device is trickier than its predecessor when it comes to TWRP and rooting.
Ok I'll whittle it down to which is responsible dtb or kernel.
I'm afraid the dev shop is closed for tonight, but thanks for hanging in there.
 

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
@ianmacd

Ok, have repacked 3 different ways to try and suss the problem.
Repacked with stock kernel and dtb, repacked with stock kernel and custom dtb, repacked with custom kernel and stock dtb.
Lets see which one boots, I at least expect the stock kernel and dtb to boot as this will also prove the repacking method is sound.
Super, a trio of goodies to try out!

And, I have some progress to report.

Custom kernel + stock DTB

The custom kernel with stock DTB boots and is the most successful of not just the three new builds, but of any we have tried so far.

With this build, the external SD card is mounted and I can also open a TWRP terminal. No other file system is mountable, however, and I can't wipe DATA.

Stock kernel + custom DTB

This one doesn't boot and dumps me straight back into Download Mode.

Stock kernel + stock DTB

This one boots, but doesn't see anything and can't do anything, i.e. nothing is mountable, DATA can't be wiped, no access to TWRP terminal, etc.

So, you seem to be on the right track with first one. It would appear that the DTB just needs some more surgery, although I could, of course, be barking up completely the wrong tree.
 

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Super, a trio of goodies to try out!

And, I have some progress to report.

Custom kernel + stock DTB

The custom kernel with stock DTB boots and is the most successful of not just the three new builds, but of any we have tried so far.

With this build, the external SD card is mounted and I can also open a TWRP terminal. No other file system is mountable, however, and I can't wipe DATA.

Stock kernel + custom DTB

This one doesn't boot and dumps me straight back into Download Mode.

Stock kernel + stock DTB

This one boots, but doesn't see anything and can't do anything, i.e. nothing is mountable, DATA can't be wiped, no access to TWRP terminal, etc.

So, you seem to be on the right track with first one. It would appear that the DTB just needs some more surgery, although I could, of course, be barking up completely the wrong tree.
Good to know the kernel is booting and the repack is sound.
Ian, when you say you cannot wipe data are you wiping or using the FORMAT DATA button at the bottom?
If adb is working could you post the output of:

ls -laR /dev/block > external_sd/block.txt

Or if not in twrp terminal.

I'm going to investigate the dtb further as there's no real reason for it to fail. Maybe there is a special header that gets lost when repacked.
 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Ian, when you say you cannot wipe data are you wiping or using the FORMAT DATA button at the bottom?
Sorry for the ambiguity. I'm using the FORMAT DATA button, but a plain old WIPE doesn't work, either.

If adb is working could you post the output of:

ls -laR /dev/block > external_sd/block.txt

Or if not in twrp terminal.
No functional adb, so I grabbed the output in the terminal and put the SDHC card in the laptop to get at it. It's attached to this message.
 

Attachments

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Sorry for the ambiguity. I'm using the FORMAT DATA button, but a plain old WIPE doesn't work, either.



No functional adb, so I grabbed the output in the terminal and put the SDHC card in the laptop to get at it. It's attached to this message.
Thanks, this SHOULD fix the mounting issues. Just made all the changes using my phone at work.

https://androidfilehost.com/?fid=1322778262904009033
 
  • Like
Reactions: ianmacd

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Thanks, this SHOULD fix the mounting issues. Just made all the changes using my phone at work.
Thanks. I've had a busy afternoon here, and have only just been able to sit down for this.

Well, now we're getting somewhere!

System, System Image, Data, Cache, EFS, Micro SD Card and Vendor are now all mountable. Hurrah! There's the occasional Failed to mount '/system' (Device or resource busy) message, but /system is mountable when I try it in the Mount menu. Oddly, though, I see only a /system/media directory when I look.

odm, however, still isn't mountable. That fails with Failed to mount '/odm' (Block device required). A typo in the DTB perhaps?

Anyway, this represents major progress on the mounting front, of course.

I tried Format Data, but it caused an immediate reboot. Odd. When I returned to TWRP, I tried it again, and this time it didn't reboot. Indeed, the log suggests it completed successfully, and I can mount DATA.

At this point, I decided to reinstall the stock firmware and attempt rooting the machine from scratch.

After installing the stock firmware with Odin and rebooting back to TWRP, I installed the dm-verity modified boot image. No error.

I then rebooted to TWRP and installed the force-encryption disabler. Again, no error.

I was then about to format DATA, when I noticed that it was already mountable. I confirmed with the ls command in the TWRP Terminal that the contents were, indeed, readable. Odd. I would have expected booting into the newly reinstalled stock firmware a few minutes ago to have re-encrypted DATA, but it hadn't.

Anyway, I formatted it again for good measure and then rebooted back into TWRP.

At this point, I thought I might as well have a shot at installing Magisk, so I had a go with a (known good) build I made yesterday. Alas, that was a bridge too far still. Photo attached. It seems /system can't be mounted.

One concern is that I can no longer boot into Android after performing the above steps, so either that modified boot image or the force-encryption disabler isn't quite right, I think.

Anyway, we're making excellent progress now. Still no adb, but you haven't delved into that yet, I think.

I'm at your disposal for further testing.
 

Attachments

Last edited:
  • Like
Reactions: hurray

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
Thanks. I've had a busy afternoon here, and have only just been able to sit down for this.

Well, now we're getting somewhere!

System, System Image, Data, Cache, EFS, Micro SD Card and Vendor are now all mountable. Hurrah! There's the occasional Failed to mount '/system' (Device or resource busy) message, but /system is mountable when I try it in the Mount menu. Oddly, though, I see only a /system/media directory when I look.

odm, however, still isn't mountable. That fails with Failed to mount '/odm' (Block device required). A typo in the DTB perhaps?

Anyway, this represents major progress on the mounting front, of course.

I tried Format Data, but it caused an immediate reboot. Odd. When I returned to TWRP, I tried it again, and this time it didn't reboot. Indeed, the log suggests it completed successfully, and I can mount DATA.

At this point, I decided to reinstall the stock firmware and attempt rooting the machine from scratch.

After installing the stock firmware with Odin and rebooting back to TWRP, I installed the dm-verity modified boot image. No error.

I then rebooted to TWRP and installed the force-encryption disabler. Again, no error.

I was then about to format DATA, when I noticed that it was already mountable. I confirmed with the ls command in the TWRP Terminal that the contents were, indeed, readable. Odd. I would have expected booting into the newly reinstalled stock firmware a few minutes ago to have re-encrypted DATA, but it hadn't.

Anyway, I formatted it again for good measure and then rebooted back into TWRP.

At this point, I thought I might as well have a shot at installing Magisk, so I had a go with a (known good) build I made yesterday. Alas, that was a bridge too far still. Photo attached. It seems /system can't be mounted.

One concern is that I can no longer boot into Android after performing the above steps, so either that modified boot image or the force-encryption disabler isn't quite right, I think.

Anyway, we're making excellent progress now. Still no adb, but you haven't delved into that yet, I think.

I'm at your disposal for further testing.
Odd I've never come across the system mount error before. I hope I can fix that or did you only see that after flashing something?
I don't think odm is Important as far as recovery is concerned, but I'll mount it by block device (why that's required is a new one on me?)
The booting to the OS issue is a DM-VERITY issue.
I can't disable DM-VERITY until I fix the dtb issue.
Any modification to either system or vendor partitions will render the device unbootable
Even simply allowing twrp to mount the partitions might cause it.

However I'm a little concerned that you say the device auto reboots when you format DATA.
Does it complete the format or reboot right away?

I don't suppose you could save and post the recovery log?

Thanks.

By the way I've been invited to join the moderation team.
Apparently I'm one of the higher regarded RC's and have been selected to be invited to join the team.
Unfortunately I will have to decline as my time on XDA is limited, so wouldn't be able to give it my full commitment.
Nice to be asked though.:victory:

EDIT: Just reread your post and I'm unclear as to whether the device booted with the patched boot image?
Reason I ask is because the patched boot image also includes the patched dtb which I expected not to boot. :confused:
 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,322
3,693
208
Amsterdam
localhost
Odd I've never come across the system mount error before. I hope I can fix that or did you only see that after flashing something?
No, it comes up once already after just booting into TWRP.

The booting to the OS issue is a DM-VERITY issue.

I can't disable DM-VERITY until I fix the dtb issue.

Any modification to either system or vendor partitions will render the device unbootable
Even simply allowing twrp to mount the partitions might cause it.
Oh, I thought the modified boot image you supplied was supposed to fix that. OK.

However I'm a little concerned that you say the device auto reboots when you format DATA.
Does it complete the format or reboot right away?
It happened just the once. I can't reproduce it now. When it happened, it appeared to happen as soon as I hit the button, but the format operations I've carried out since occurred so quickly that it's possible it did complete before rebooting.

I don't suppose you could save and post the recovery log?
Sorry, I knew I was being remiss there. It's just a pain in the arse to keep removing the SDHC card and popping it into the adapter to read it on the laptop. I knew the missus would be coming through the door at any moment, so I was pushing to get my posting to you finished before the whole effort had to go on hiatus until later in the evening.

After I've done the dishes, I'll play around with TWRP some more and send you a log of the whole session.

By the way I've been invited to join the moderation team.
Apparently I'm one of the higher regarded RC's and have been selected to be invited to join the team.
Unfortunately I will have to decline as my time on XDA is limited, so wouldn't be able to give it my full commitment.
Nice to be asked though.:victory:
Yes, indeed. Congratulations.

EDIT: Just reread your post and I'm unclear as to whether the device booted with the patched boot image?
Reason I ask is because the patched boot image also includes the patched dtb which I expected not to boot. :confused:
No, after installing the patched boot image and the force-encryption disabler, the device would only boot back into TWRP.

I was still following your original instructions, so I thought that I still had to install the modified boot image after installing TWRP. Am I correct in understanding that this step should now be skipped?
 

ashyx

Recognized Contributor
Oct 14, 2012
15,110
9,831
0
No, it comes up once already after just booting into TWRP.



Oh, I thought the modified boot image you supplied was supposed to fix that. OK.



It happened just the once. I can't reproduce it now. When it happened, it appeared to happen as soon as I hit the button, but the format operations I've carried out since occurred so quickly that it's possible it did complete before rebooting.



Sorry, I knew I was being remiss there. It's just a pain in the arse to keep removing the SDHC card and popping it into the adapter to read it on the laptop. I knew the missus would be coming through the door at any moment, so I was pushing to get my posting to you finished before the whole effort had to go on hiatus until later in the evening.

After I've done the dishes, I'll play around with TWRP some more and send you a log of the whole session.



Yes, indeed. Congratulations.



No, after installing the patched boot image and the force-encryption disabler, the device would only boot back into TWRP.

I was still following your original instructions, so I thought that I still had to install the modified boot image after installing TWRP. Am I correct in understanding that this step should now be skipped?
Yep you're correct the patched boot was intended to disable dm-verity, however it won't work because of the dtb issue.
Unless the dtb can be patched no modifications are possible.


Upon checking the stock and repacked dtb the headers are indeed different which I guess is why it won't boot.

So I have taken a different tack and hex edited the dtb to preserve the header. Now I have done this two different ways as I don't know which will be successful, if any.
Have also recompiled TWRP with fixes for mounting the partitions with errors and fixed some errors in the forced encryption patch.

Just to note, the encryption patch modifies the vendor partition which means dm-verity will be triggered. This is fine as long as the patched dtb boots and does it's job and disables dm-verity!

I have put the files in order of flashing (note: don't flash both patched boots at the same time).
twrp_3.2.3-1_sm-t830_19918

T830XXU1ARH8_dmverity_patched_boot1

T830XXU1ARH8_dmverity_patched_boot2

If any of the patched boot images above boots then flash this:
TabS4_oreo_forced_encryption_disabler

Sorry it's late, the missus has gone out lol. So no rush when you can mate. ;)