[GUIDE] EROFS - Mounting/ Accessing/ Creating system.img

Dispossible

Member
Dec 17, 2018
39
11
0
Beijing
@newbit
I have only one SUPER.img. It means that my tools is too old to unpack the UPDATE.APP???

Huawei's erofs has two versions. One supports no more than 4G. The other is large enough. 4*0.931=3.72
May be the super is too large so the version 1 cannot support.
you get the two super.img from emui9.1 or emui10?
 
Last edited:

newbit

Senior Member
Nov 16, 2008
91
38
38
I have only one SUPER.img. It means that my tools is too old to unpack the UPDATE.APP???
Maybe, why don't you just try it out and see what happens? splituapp.py
Or The Huawei Update Extractor, it tells you what files are in the UPDATE.APP, it even runs very well under Linux via wine.

Huawei's erofs has two versions. One supports no more than 4G. The other is large enough. 4*0.931=3.72
May be the super is too large so the version 1 cannot support.
Do you have any source for that claim?

you get the two super.img from emui9.1 or emui10?
I believe if the Firmware Version contains like 10. something, it also implies it is EMUI10.
So far I didn't see any super.img in Android 9 Firmware files.

If you checkout the Firmware Finder for Huawei it can tell you a lot of details regarding the Firmware files.

Cheers NewBit
 

oslo83

Senior Member
Jun 12, 2016
1,384
406
93
It's great news. In the past I only managed to sparse a super image. Now I see the missing key was lpunpack.

Any idea how to make an arm build of lpunpack from termux ?
 

newbit

Senior Member
Nov 16, 2008
91
38
38
Hi @oslo83,

Any idea how to make an arm build of lpunpack from termux ?
What a challenging task you have...

Well the source of lpunpack you can get from AOSP -> android / platform / system / extras / partition_tools

Also a build environment from ASOP -> android / platform / build / envsetup.sh

And on top a nice guide from Google on how to actually build the Blueprint Android.bp:
Follow these instructions to begin building Android.

Please let me know on how it goes.

Cheers NewBit
 
  • Like
Reactions: rubiicon59

Dispossible

Member
Dec 17, 2018
39
11
0
Beijing
@newbit
I got the max size of EROFS from wiki, and the source of wiki is erofs.txt from linux kernel. You can search the EROFS from wiki. My super.img is less than 4G.

---------- Post added at 01:35 PM ---------- Previous post was at 01:23 PM ----------

I've got more interested as this thread has progressed.
Am I right in thinking there may be a chance of getting root on the P30 Pro?
1. wish that someone would sell the unlock code of Huawei (maybe, I haven't paid attention to this news recently)
2.wish that someone could crack the EMUI9 (maybe, but not now), now, EMUI8.0 8.1 8.2 can read unlock code by using some special method.
3.In my opinion, the key is not in EROFS but in unlock code. EMUI9+EROFS can be unlocked and flash all kinds of ROMs.....
 
  • Like
Reactions: rubiicon59

newbit

Senior Member
Nov 16, 2008
91
38
38
I got the max size of EROFS from wiki, and the source of wiki is erofs.txt from linux kernel. You can search the EROFS from wiki. My super.img is less than 4G.
Thanks for the hint. I've found it in an Android 10 Opensource Kernel
Code:
Laya_10_EMUI10.0_opensource.tar/Code_Opensource/kernel/fs/erofs/Documentation/filesystems/erofs.txt
The Wiki page you are referring to is probably from LinuxReviews.org !?
They basically copied the content of this View attachment erofs.txt file.

Regarding the size. Is it possible that you are mixing up something?
In both descriptions they write about the main features of EROFS:
  • Currently 4 KB block size (nobh) and therefore maximum 16 TB address space
  • 4KB block size. This limits the total possible capacity of a EROFS filesystem to 16 TB
  • 2 inode versions for different requirements:
    Code:
                              v1            v2
       [B]Max file size:         4 GB          16 EB (also limited by max. vol size)[/B]

This sounds to me that in v1 the maximum file size was limited to 4 GB, inside
this erofs partition, like on FAT32. But in both versions they have 4 KB block size and this limits the
maximum addressable partition size to 16 TB.

From all the Firmware files I investigated the last weeks, all of the unsparsed super.img.raw files were larger
than 5 GB. Which I wouldn't interpret as a rule.

1. wish that someone would sell the unlock code of Huawei (maybe, I haven't paid attention to this news recently)
2.wish that someone could crack the EMUI9 (maybe, but not now), now, EMUI8.0 8.1 8.2 can read unlock code by using some special method.
The only half war serious "ad" I have heard so far is from this website.
Can't give you source-able details, but I've read that in order to get access to present Huawei Bootloader Unlock codes,
one must have some insider contacts from Huawei and its database.
Update 04.06.2020
Found the source I was referring to. It links back to XDA with lots of feedback that they really got the codes back in 2018.
Translated it says:
What's behind it?

Actually, it's almost funny what strange curiosities result in the blocking of the bootloader release from Huawei. We can guess what is actually behind the method on Ministryofsolutions. We have two explanations. Option 1 is that the operator found a hack on the website to get the code. We think this is unlikely since this hack would hardly be possible with the IMEI number alone. So the more likely possibility is that the operator knows an insider at Huawei who has access to a database with the codes. This source is now used to earn a lot of money from it.

3.In my opinion, the key is not in EROFS but in unlock code. EMUI9+EROFS can be unlocked and flash all kinds of ROMs.....
I don't think this is a matter of opinion. It is a fact, no unlocked Bootloader no flashing. But once it is unlocked,
Magisk should do the trick, even without TWRP.

Cheers NewBit
 
Last edited:
  • Like
Reactions: rubiicon59

rubiicon59

Senior Member
Mar 8, 2015
854
271
63
Liverpool
I've read those references you linked above, and..... WOW lol. Very interesting but way above my level of understanding.
But I'm going to read some more, try and get a better grasp.
Thanks